Created
February 26, 2018 08:12
-
-
Save voratham/2c3066d88e4464ab584bc4c3f11cf8fa to your computer and use it in GitHub Desktop.
SolutionWixDrawerSomeScreen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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