parent
b9678a745f
commit
b448b2537d
@ -0,0 +1,46 @@
|
||||
import React, {Component} from 'react';
|
||||
import {Modal, Text, TouchableHighlight, View, Alert} from 'react-native';
|
||||
|
||||
class RoomInput extends Component {
|
||||
state = {
|
||||
modalVisible: false,
|
||||
};
|
||||
|
||||
setModalVisible(visible) {
|
||||
this.setState({modalVisible: visible});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{marginTop: 22}}>
|
||||
<Modal
|
||||
animationType="slide"
|
||||
transparent={false}
|
||||
visible={this.state.modalVisible}
|
||||
onRequestClose={() => {
|
||||
Alert.alert('Modal has been closed.');
|
||||
}}>
|
||||
<View style={{marginTop: 22}}>
|
||||
<View>
|
||||
<Text>Hello World!</Text>
|
||||
|
||||
<TouchableHighlight
|
||||
onPress={() => {
|
||||
this.setModalVisible(!this.state.modalVisible);
|
||||
}}>
|
||||
<Text>Hide Modal</Text>W
|
||||
</TouchableHighlight>
|
||||
</View>
|
||||
</View>
|
||||
</Modal>
|
||||
|
||||
<TouchableHighlight
|
||||
onPress={() => {
|
||||
this.setModalVisible(true);
|
||||
}}>
|
||||
<Text>Show Modal</Text>
|
||||
</TouchableHighlight>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue