mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 01:52:56 +03:00
added action menu
This commit is contained in:
parent
fa8875e3e7
commit
0616c797e4
@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import {
|
||||
View, KeyboardAvoidingView, ScrollView, FlatList, Text,
|
||||
View, KeyboardAvoidingView, ScrollView, FlatList, Text, ActionSheetIOS
|
||||
} from 'react-native';
|
||||
import Markdown, { getUniqueID } from 'react-native-markdown-renderer';
|
||||
// Components
|
||||
@ -121,9 +121,21 @@ export default class MarkdownEditorView extends Component {
|
||||
</View>
|
||||
);
|
||||
|
||||
_renderEditorButtons = ({ getState, setState }) => {
|
||||
_handleOnImageButtonPress = () => {
|
||||
const { handleOpenImagePicker } = this.props;
|
||||
|
||||
ActionSheetIOS.showActionSheetWithOptions(
|
||||
{
|
||||
options: ['Cancel', 'Take Photo', 'Select From Gallery'],
|
||||
cancelButtonIndex: 0,
|
||||
},
|
||||
(buttonIndex) => {
|
||||
handleOpenImagePicker(buttonIndex === 1 ? 'camera' : buttonIndex === 2 && 'image');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
_renderEditorButtons = ({ getState, setState }) => {
|
||||
return (
|
||||
<StickyBar>
|
||||
<View style={styles.leftButtonsWrapper}>
|
||||
@ -145,7 +157,7 @@ export default class MarkdownEditorView extends Component {
|
||||
onPress={() => Formats[9].onPress({ getState, setState })}
|
||||
/>
|
||||
<IconButton
|
||||
onPress={() => handleOpenImagePicker()}
|
||||
onPress={() => this._handleOnImageButtonPress()}
|
||||
style={styles.rightIcons}
|
||||
size={20}
|
||||
iconStyle={styles.icon}
|
||||
|
@ -239,7 +239,7 @@ class EditorContainer extends Component {
|
||||
autoFocusText={autoFocusText}
|
||||
draftPost={draftPost}
|
||||
handleFormChanged={this._handleFormChanged}
|
||||
handleOnImagePicker={this._handleOpenImagePicker}
|
||||
handleOnImagePicker={this._handleRoutingAction}
|
||||
handleOnSaveButtonPress={this._handleOnSaveButtonPress}
|
||||
handleOnSubmit={this._handleSubmit}
|
||||
isCameraOrPickerOpen={isCameraOrPickerOpen}
|
||||
|
Loading…
Reference in New Issue
Block a user