mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-28 07:55:08 +03:00
rename deprecated
This commit is contained in:
parent
e405c20a79
commit
c59d0c663a
@ -17,11 +17,6 @@ class ToastNotification extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
componentWillMount() {
|
||||
this._showToast();
|
||||
}
|
||||
|
||||
// Component Functions
|
||||
_showToast() {
|
||||
const { duration } = this.props;
|
||||
@ -53,6 +48,11 @@ class ToastNotification extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
UNSAFE_componentWillMount() {
|
||||
this._showToast();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { text, textStyle, style, onPress, isTop } = this.props;
|
||||
const { animatedValue } = this.state;
|
||||
|
@ -28,9 +28,6 @@ class ToggleSwitchView extends PureComponent {
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
componentWillMount() {
|
||||
this.setState({ duration: 0 });
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({ duration: 300 });
|
||||
@ -96,6 +93,10 @@ class ToggleSwitchView extends PureComponent {
|
||||
}).start();
|
||||
};
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
this.setState({ duration: 0 });
|
||||
}
|
||||
|
||||
render() {
|
||||
this._triggerAnimation();
|
||||
|
||||
|
@ -96,11 +96,6 @@ class ApplicationContainer extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { isDarkTheme: _isDarkTheme } = this.props;
|
||||
EStyleSheet.build(_isDarkTheme ? darkTheme : lightTheme);
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
const { isIos } = this.state;
|
||||
this._setNetworkListener();
|
||||
@ -613,6 +608,11 @@ class ApplicationContainer extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
const { isDarkTheme: _isDarkTheme } = this.props;
|
||||
EStyleSheet.build(_isDarkTheme ? darkTheme : lightTheme);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
selectedLanguage,
|
||||
|
@ -27,7 +27,13 @@ class ApplicationScreen extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
_handleOnHideToastNotification = () => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch(toastNotificationAction(''));
|
||||
this.setState({ isShowToastNotification: false });
|
||||
};
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
const { isDarkTheme } = this.props;
|
||||
EStyleSheet.build(isDarkTheme ? darkTheme : lightTheme);
|
||||
}
|
||||
@ -39,12 +45,6 @@ class ApplicationScreen extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
_handleOnHideToastNotification = () => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch(toastNotificationAction(''));
|
||||
this.setState({ isShowToastNotification: false });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isConnected, isDarkTheme, toastNotification, isReady } = this.props;
|
||||
const { isShowToastNotification } = this.state;
|
||||
|
@ -54,67 +54,6 @@ class EditorContainer extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
// Component Life Cycle Functions
|
||||
|
||||
componentWillMount() {
|
||||
const { currentAccount, navigation } = this.props;
|
||||
const username = currentAccount && currentAccount.name ? currentAccount.name : '';
|
||||
let isReply;
|
||||
let isEdit;
|
||||
let post;
|
||||
let _draft;
|
||||
|
||||
if (navigation.state && navigation.state.params) {
|
||||
const navigationParams = navigation.state.params;
|
||||
|
||||
if (navigationParams.draft) {
|
||||
_draft = navigationParams.draft;
|
||||
|
||||
this.setState({
|
||||
draftPost: {
|
||||
title: _draft.title,
|
||||
body: _draft.body,
|
||||
tags: _draft.tags.includes(' ') ? _draft.tags.split(' ') : _draft.tags.split(','),
|
||||
},
|
||||
draftId: _draft._id,
|
||||
isDraft: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (navigationParams.post) {
|
||||
({ post } = navigationParams);
|
||||
this.setState({ post });
|
||||
}
|
||||
|
||||
if (navigationParams.isReply) {
|
||||
({ isReply } = navigationParams);
|
||||
this.setState({ isReply });
|
||||
}
|
||||
|
||||
if (navigationParams.isEdit) {
|
||||
({ isEdit } = navigationParams);
|
||||
this.setState({
|
||||
isEdit,
|
||||
draftPost: {
|
||||
title: get(post, 'title', ''),
|
||||
body: get(post, 'markdownBody', ''),
|
||||
tags: get(post, 'json_metadata.tags', []),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (navigationParams.action) {
|
||||
this._handleRoutingAction(navigationParams.action);
|
||||
}
|
||||
} else {
|
||||
this.setState({ autoFocusText: true });
|
||||
}
|
||||
|
||||
if (!isEdit && !_draft) {
|
||||
this._getDraft(username, isReply);
|
||||
}
|
||||
}
|
||||
|
||||
_getDraft = async (username, isReply) => {
|
||||
if (isReply) {
|
||||
const draftReply = await AsyncStorage.getItem('temp-reply');
|
||||
@ -553,6 +492,66 @@ class EditorContainer extends Component {
|
||||
this.setState({ uploadedImage: null });
|
||||
};
|
||||
|
||||
// Component Life Cycle Functions
|
||||
UNSAFE_componentWillMount() {
|
||||
const { currentAccount, navigation } = this.props;
|
||||
const username = currentAccount && currentAccount.name ? currentAccount.name : '';
|
||||
let isReply;
|
||||
let isEdit;
|
||||
let post;
|
||||
let _draft;
|
||||
|
||||
if (navigation.state && navigation.state.params) {
|
||||
const navigationParams = navigation.state.params;
|
||||
|
||||
if (navigationParams.draft) {
|
||||
_draft = navigationParams.draft;
|
||||
|
||||
this.setState({
|
||||
draftPost: {
|
||||
title: _draft.title,
|
||||
body: _draft.body,
|
||||
tags: _draft.tags.includes(' ') ? _draft.tags.split(' ') : _draft.tags.split(','),
|
||||
},
|
||||
draftId: _draft._id,
|
||||
isDraft: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (navigationParams.post) {
|
||||
({ post } = navigationParams);
|
||||
this.setState({ post });
|
||||
}
|
||||
|
||||
if (navigationParams.isReply) {
|
||||
({ isReply } = navigationParams);
|
||||
this.setState({ isReply });
|
||||
}
|
||||
|
||||
if (navigationParams.isEdit) {
|
||||
({ isEdit } = navigationParams);
|
||||
this.setState({
|
||||
isEdit,
|
||||
draftPost: {
|
||||
title: get(post, 'title', ''),
|
||||
body: get(post, 'markdownBody', ''),
|
||||
tags: get(post, 'json_metadata.tags', []),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (navigationParams.action) {
|
||||
this._handleRoutingAction(navigationParams.action);
|
||||
}
|
||||
} else {
|
||||
this.setState({ autoFocusText: true });
|
||||
}
|
||||
|
||||
if (!isEdit && !_draft) {
|
||||
this._getDraft(username, isReply);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isLoggedIn, isDarkTheme } = this.props;
|
||||
const {
|
||||
|
@ -48,13 +48,6 @@ class PowerDownView extends Component {
|
||||
this.stopActionSheet = React.createRef();
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
componentWillMount() {
|
||||
const { currentAccountName } = this.props;
|
||||
|
||||
this._fetchRoutes(currentAccountName);
|
||||
}
|
||||
|
||||
// Component Functions
|
||||
|
||||
_fetchRoutes = username => {
|
||||
@ -189,6 +182,13 @@ class PowerDownView extends Component {
|
||||
}
|
||||
};
|
||||
|
||||
// Component Life Cycles
|
||||
UNSAFE_componentWillMount() {
|
||||
const { currentAccountName } = this.props;
|
||||
|
||||
this._fetchRoutes(currentAccountName);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
accounts,
|
||||
|
Loading…
Reference in New Issue
Block a user