rename deprecated

This commit is contained in:
feruz 2019-12-03 13:34:54 +02:00
parent e405c20a79
commit c59d0c663a
6 changed files with 88 additions and 88 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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,

View File

@ -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;

View File

@ -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 {

View File

@ -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,