Skip to content

Instantly share code, notes, and snippets.

@voratham
Created February 26, 2018 08:12
Show Gist options
  • Save voratham/2c3066d88e4464ab584bc4c3f11cf8fa to your computer and use it in GitHub Desktop.
Save voratham/2c3066d88e4464ab584bc4c3f11cf8fa to your computer and use it in GitHub Desktop.
SolutionWixDrawerSomeScreen
constructor(props) {
super(props);
this.props.navigator.setOnNavigatorEvent(
this.onNavigatorEvent.bind(this)
);
}
// If this screen was the first screen app (like a slash or login page), you will need do this
// componentWillMount() {
// this.props.navigator.setDrawerEnabled({
// side: "left",
// enabled: false
// });
// }
onNavigatorEvent(event) {
switch (event.id) {
case "willAppear":
// On enter on this screen, enable the drawer
// set it on constructor for screen not drawer
this.props.navigator.setDrawerEnabled({
side: "left",
enabled: false
});
break;
case "willDisappear":
// On leave from this screen, enable the drawer
this.props.navigator.setDrawerEnabled({
side: "left",
enabled: true
});
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment