Added game sign in menus

This commit is contained in:
lesmaux
2018-09-30 17:17:26 +13:00
parent b448b2537d
commit 5f09789043
4 changed files with 90 additions and 42 deletions
+4 -3
View File
@@ -11,7 +11,7 @@ import {
export default class JoinButton extends Component {
constructor(props) {
super(props);
this.join = this.props.join;
this.modal = this.props.modal;
this.state = { value: this.props.value};
}
@@ -23,13 +23,14 @@ export default class JoinButton extends Component {
return (
<View style ={[sharedStyles.runInfoWrapper, {flex: 1}]}>
<TouchableHighlight
onPress= {() => this.join()}
onPress= {() => this.modal()}
// style={sharedStyles.new}
>
<Text style={{fontSize: 25, textAlign: 'center'}}>Join</Text>
<Text style={{fontSize: 25, textAlign: 'center'}}>Join Room</Text>
</TouchableHighlight>
</View>
)
}
}
+2 -2
View File
@@ -8,7 +8,7 @@ import {
View
} from 'react-native';
export default class NewButton extends Component {
export default class WalkButton extends Component {
constructor(props) {
super(props);
this.erase = this.props.erase;
@@ -26,7 +26,7 @@ export default class NewButton extends Component {
onPress= {() => this.erase()}
// style={sharedStyles.new}
>
<Text style={{
<Text style={{
paddingVertical: 10,
fontSize: 30,
backgroundColor: 'rgba(0,255,0,0.5)',
+53 -20
View File
@@ -1,9 +1,24 @@
import React, {Component} from 'react';
import {Modal, Text, TouchableHighlight, View, Alert} from 'react-native';
import {
Modal,
Text,
TouchableHighlight,
View,
Alert,
StyleSheet,
TextInput
} from 'react-native';
class RoomInput extends Component {
export default class RoomInput extends Component {
constructor(props) {
super(props);
this.join = this.props.join;;
}
state = {
modalVisible: false,
gameText: "",
userText: ""
};
setModalVisible(visible) {
@@ -12,35 +27,53 @@ class RoomInput extends Component {
render() {
return (
<View style={{marginTop: 22}}>
<View>
<Modal
animationType="slide"
transparent={false}
visible={this.state.modalVisible}
visible={this.state.modalVisible}
onRequestClose={() => {
Alert.alert('Modal has been closed.');
}}>
<View style={{marginTop: 22}}>
}}
style={styles.modal}>
<View>
<Text>Hello World!</Text>
<Text>Enter Game ID:</Text>
<TextInput
style={styles.textInput}
placeholder="Username"
onChangeText={(text) => this.setState({userText: text})}
/>
<TextInput
style={styles.textInput}
placeholder="Game No."
onChangeText={(texta) => this.setState({gameText: texta})}
/>
<TouchableHighlight
onPress={() => {
this.join(this.state.userText, this.state.gameText);
this.setModalVisible(!this.state.modalVisible)
}}>
<Text>Join</Text>
</TouchableHighlight>
<TouchableHighlight
onPress={() => {
this.setModalVisible(!this.state.modalVisible);
}}>
<Text>Hide Modal</Text>W
<Text>Cancel</Text>
</TouchableHighlight>
</View>
</View>
</Modal>
<TouchableHighlight
onPress={() => {
this.setModalVisible(true);
}}>
<Text>Show Modal</Text>
</TouchableHighlight>
</View>
</Modal>
</View>
);
}
}
}
const styles = StyleSheet.create({
modal: {
backgroundColor: 'white',
margin: 15,
alignItems: undefined,
justifyContent: undefined,
}
})