forked from wahello/peerio-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
277 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import { observer } from 'mobx-react/native'; | ||
import ActionSheet from 'react-native-actionsheet'; | ||
import SafeComponent from '../shared/safe-component'; | ||
import { tx } from '../utils/translator'; | ||
|
||
@observer | ||
export default class InlineImageActionSheet extends SafeComponent { | ||
RETRY_INDEX = 0; | ||
DELETE_INDEX = 1; | ||
CANCEL_INDEX = 2; | ||
|
||
items = [ | ||
{ title: tx('button_retry') /* , action: () => this._message.send() */ }, | ||
{ title: tx('button_delete') /* , action: () => this._chat.removeMessage(this._message) */ }, | ||
{ title: tx('button_cancel') } | ||
]; | ||
|
||
onPress = index => { | ||
const { action } = this.items[index]; | ||
action && action(); | ||
}; | ||
|
||
show() { | ||
this._actionSheet.show(); | ||
} | ||
|
||
renderThrow() { | ||
return ( | ||
<ActionSheet | ||
ref={sheet => { this._actionSheet = sheet; }} | ||
options={this.items.map(i => i.title)} | ||
cancelButtonIndex={this.CANCEL_INDEX} | ||
destructiveButtonIndex={this.DELETE_INDEX} | ||
onPress={this.onPress} | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.