Created
July 3, 2018 22:44
-
-
Save danielglans/3d5785eb25ee456f9ccb2e1dca2478fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class HomeView extends React.Component { | |
| state = { | |
| modalVisible: false | |
| }; | |
| setModalVisible = visible => { | |
| this.setState({ modalVisible: visible }); | |
| }; | |
| render() { | |
| return ( | |
| <Background> | |
| <Container onButtonPress={this.setModalVisible} /> | |
| <Modal | |
| animationType="slide" | |
| transparent={false} | |
| visible={this.state.modalVisible} | |
| > | |
| <View style={{ marginTop: 30 }}> | |
| <View> | |
| <Text>Please set the time</Text> | |
| </View> | |
| <CloseModal | |
| onButtonClosePress={this.setModalVisible} | |
| style={{ flex: 1 }} | |
| text="Close Modal" | |
| /> | |
| </View> | |
| </Modal> | |
| </Background> | |
| ); | |
| } | |
| } | |
| class CloseModal extends React.Component { | |
| render() { | |
| console.log(this.props); | |
| return ( | |
| <TouchableHighlight | |
| onPress={this.props.onButtonClosePress} | |
| style={{ | |
| width: "80%", | |
| padding: 10, | |
| justifyContent: "center", | |
| backgroundColor: "#2196F3", | |
| borderRadius: 50 | |
| }} | |
| > | |
| <Text | |
| style={{ | |
| color: "white", | |
| textAlign: "center" | |
| }} | |
| > | |
| {this.props.text} | |
| </Text> | |
| </TouchableHighlight> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment