timepill-app/src/page/EmptyPage.js
xuwenyang 6ff2670a3c 1. 评论,回复
2. 写日记,隐藏底栏问题(太耗时!)
3. 其他细节补充
2019-05-30 00:19:06 +08:00

74 lines
No EOL
1.8 KiB
JavaScript

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Alert} from 'react-native';
import {Navigation} from 'react-native-navigation';
export default class EmptyPage extends Component {
constructor(props) {
super(props);
this.state = {
from: props.from
}
}
componentDidMount() {
this.navigationEventListener = Navigation.events().bindComponent(this);
}
componentWillUnmount() {
this.navigationEventListener.remove();
}
componentDidAppear() {
let forword = true;
if(this.state.from == 'write') {
forword = false;
this.setState({from: ''});
}
if(!forword) {
Navigation.mergeOptions(this.props.componentId, {
bottomTabs: {
currentTabIndex: 4
}
});
} else {
Navigation.push(this.props.componentId, {
component: {
name: 'Write',
options: {
animations: {
push: {
enabled: false
},
pop: {
enabled: false
}
},
bottomTabs: {
visible: false,
// hide bottom tab for android
drawBehind: true,
animate: true
}
},
passProps: {
}
}
});
}
}
render() {
return null;
}
}