Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Respostas extends React.Component {
- state = {
- modalVisible: false,
- };
- setModalVisible(visible) {
- this.setState({ modalVisible: visible });
- }
- render() {
- return (
- <View style={styles.container}>
- <Modal
- animationType="fade"
- transparent={true}
- visible={this.state.modalVisible}
- onRequestClose={() => {
- this.setModalVisible(false);
- }}
- >
- <TouchableWithoutFeedback onPress={() => {this.setModalVisible(false);}}>
- <View style={styles.modalstyle}>
- <View style={styles.modalcontent}>
- <Image source={positive} />
- <Text style={styles.title}>Parabéns!</Text>
- <Text style={styles.body}>Cadastro realizado com sucesso</Text>
- <TouchableHighlight style={styles.btnyes}
- underlayColor="#D6F22C"
- onPress={() => {
- this.setModalVisible(!this.state.modalVisible);
- }}>
- <Text style={{ color: 'white', fontSize: 14, fontWeight: 'bold' }}>Concluir</Text>
- </TouchableHighlight>
- </View>
- </View>
- </TouchableWithoutFeedback>
- </Modal>
- <TouchableHighlight
- style={styles.button}
- onPress={() => {
- this.setModalVisible(true);
- }}>
- <Text>Show Modal</Text>
- </TouchableHighlight>
- </View>
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement