mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-01 00:43:12 +03:00
added closing post button when change routes
This commit is contained in:
parent
9039e04600
commit
21a5cc38dc
@ -5,6 +5,7 @@ export default EStyleSheet.create({
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
height: '$deviceHeight / 4',
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
},
|
||||
body: {
|
||||
flexDirection: 'row',
|
||||
|
@ -47,6 +47,6 @@ export default EStyleSheet.create({
|
||||
height: 20,
|
||||
},
|
||||
disableTouchable: {
|
||||
backgroundColor:"$iconColor",
|
||||
backgroundColor: '$iconColor',
|
||||
},
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ class PostButtonContainer extends Component {
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
isLoggedIn: state.application.isLoggedIn,
|
||||
routes: state.nav.routes,
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(withNavigation(PostButtonContainer));
|
||||
|
@ -22,6 +22,6 @@ export default EStyleSheet.create({
|
||||
justifyContent: 'center',
|
||||
shadowColor: '$shadowColor',
|
||||
shadowOffset: { height: 0 },
|
||||
shadowOpacity: 1,
|
||||
shadowOpacity: 0.5,
|
||||
},
|
||||
});
|
||||
|
@ -26,6 +26,16 @@ class PostButtonView extends Component {
|
||||
|
||||
icon3 = new Animated.Value(0);
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { routes } = this.props;
|
||||
const nextRouteName = nextProps.routes[0].routes[nextProps.routes[0].routes.length - 1].routeName;
|
||||
const routeName = routes[0].routes[routes[0].routes.length - 1].routeName;
|
||||
// For closing sub buttons
|
||||
if (routeName !== nextRouteName && nextRouteName !== 'MainDrawer') {
|
||||
this.toggleView();
|
||||
}
|
||||
}
|
||||
|
||||
toggleView = () => {
|
||||
if (this.mode._value) {
|
||||
Animated.parallel(
|
||||
@ -95,8 +105,7 @@ class PostButtonView extends Component {
|
||||
top: firstY,
|
||||
}}
|
||||
icon="camera"
|
||||
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR)
|
||||
}
|
||||
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR)}
|
||||
/>
|
||||
<SubPostButton
|
||||
size={SIZE}
|
||||
@ -105,8 +114,7 @@ class PostButtonView extends Component {
|
||||
top: secondY,
|
||||
}}
|
||||
icon="pencil"
|
||||
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR)
|
||||
}
|
||||
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR)}
|
||||
/>
|
||||
<SubPostButton
|
||||
size={SIZE}
|
||||
@ -115,8 +123,7 @@ class PostButtonView extends Component {
|
||||
top: thirdY,
|
||||
}}
|
||||
icon="video-camera"
|
||||
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR)
|
||||
}
|
||||
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR)}
|
||||
/>
|
||||
<TouchableOpacity onPress={this.toggleView} activeOpacity={1}>
|
||||
<Animated.View
|
||||
|
Loading…
Reference in New Issue
Block a user