mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 01:52:56 +03:00
enhanced process
This commit is contained in:
parent
8af537aff4
commit
fa8875e3e7
@ -70,7 +70,7 @@ class BasicHeaderView extends Component {
|
||||
isModalHeader,
|
||||
handleOnPressClose,
|
||||
isHasSearch,
|
||||
isPostSending,
|
||||
isLoading,
|
||||
handleOnSaveButtonPress,
|
||||
isDraftSaving,
|
||||
isDraftSaved,
|
||||
@ -169,7 +169,7 @@ class BasicHeaderView extends Component {
|
||||
iconStyle={styles.rightIcon}
|
||||
name={isPreviewActive ? 'ios-eye' : 'ios-eye-off'}
|
||||
/>
|
||||
{!isPostSending ? (
|
||||
{!isLoading ? (
|
||||
<TextButton
|
||||
textStyle={[
|
||||
styles.textButton,
|
||||
|
@ -38,6 +38,7 @@ class EditorContainer extends Component {
|
||||
isCameraOrPickerOpen: false,
|
||||
autoFocusText: false,
|
||||
uploadedImage: null,
|
||||
isUploading: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -81,8 +82,8 @@ class EditorContainer extends Component {
|
||||
|
||||
_handleOpenImagePicker = () => {
|
||||
ImagePicker.openPicker({
|
||||
width: 1500,
|
||||
height: 800,
|
||||
width: 300,
|
||||
height: 400,
|
||||
cropping: true,
|
||||
// writeTempFile: true,
|
||||
// includeBase64: true,
|
||||
@ -112,7 +113,7 @@ class EditorContainer extends Component {
|
||||
};
|
||||
|
||||
_handleMediaOnSelected = (media) => {
|
||||
this.setState({ isCameraOrPickerOpen: false }, () => {
|
||||
this.setState({ isCameraOrPickerOpen: false, isUploading: true }, () => {
|
||||
this._uploadImage(media);
|
||||
});
|
||||
// For new image api
|
||||
@ -137,11 +138,12 @@ class EditorContainer extends Component {
|
||||
uploadImage(file)
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
this.setState({ uploadedImage: res.data });
|
||||
this.setState({ uploadedImage: res.data, isUploading: false });
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
alert(error);
|
||||
this.setState({ isUploading: false });
|
||||
});
|
||||
};
|
||||
|
||||
@ -229,6 +231,7 @@ class EditorContainer extends Component {
|
||||
autoFocusText,
|
||||
uploadedImage,
|
||||
isPostSending,
|
||||
isUploading,
|
||||
} = this.state;
|
||||
|
||||
return (
|
||||
@ -247,6 +250,7 @@ class EditorContainer extends Component {
|
||||
isLoggedIn={isLoggedIn}
|
||||
isOpenCamera={isOpenCamera}
|
||||
uploadedImage={uploadedImage}
|
||||
isUploading={isUploading}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { View, ActivityIndicator, Text } from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Utils
|
||||
@ -131,6 +131,7 @@ class EditorScreen extends Component {
|
||||
isLoggedIn,
|
||||
isPostSending,
|
||||
uploadedImage,
|
||||
isUploading,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
@ -144,7 +145,7 @@ class EditorScreen extends Component {
|
||||
isFormValid={isFormValid}
|
||||
isHasIcons
|
||||
isLoggedIn={isLoggedIn}
|
||||
isPostSending={isPostSending}
|
||||
isLoading={isPostSending || isUploading}
|
||||
isPreviewActive={isPreviewActive}
|
||||
quickTitle={wordsCount > 0 && `${wordsCount} words`}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user