Last active
August 27, 2019 20:57
-
-
Save EkaanshArora/f4222301350e72e425e69b340cf144da to your computer and use it in GitHub Desktop.
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
.... | |
handleSubmit = () => { | |
let AppID = this.state.AppID; | |
let ChannelName = this.state.ChannelName; | |
if (AppID !== '' && ChannelName !== '') { | |
Actions.video({ AppID, ChannelName }); | |
} | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.formLabel}>App ID</Text> | |
<TextInput | |
style={styles.formInput} | |
onChangeText={(AppID) => this.setState({ AppID })} | |
value={this.state.AppID} | |
/> | |
<Text style={styles.formLabel}>Channel Name</Text> | |
<TextInput | |
style={styles.formInput} | |
onChangeText={(ChannelName) => this.setState({ ChannelName })} | |
value={this.state.ChannelName} | |
/> | |
<View style={styles.buttonContainer}> | |
<TouchableOpacity | |
title="Start Call!" | |
onPress={this.handleSubmit} | |
style={styles.submitButton} | |
> | |
<Text style={{ color: '#ffffff' }}> Start Call </Text> | |
</TouchableOpacity> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
justifyContent: 'center', | |
marginTop: 0, | |
padding: 20, | |
flex: 1, | |
backgroundColor: '#ffffff', | |
}, | |
formLabel: { | |
paddingBottom: 10, | |
paddingTop: 10, | |
color: '#0093E9', | |
}, | |
buttonContainer: { | |
alignItems: 'center', | |
paddingTop: 20, | |
}, | |
submitButton: { | |
paddingHorizontal: 60, | |
paddingVertical: 10, | |
backgroundColor: '#0093E9', | |
borderRadius: 25, | |
}, | |
formInput: { | |
height: 40, | |
backgroundColor: '#f5f5f5', | |
color: '#0093E9', | |
borderRadius: 4, | |
paddingLeft: 20, | |
}, | |
}); | |
export default Home; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment