Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
React Native Stream Group Chat Tutorial: render login screen UI
// src/screens/Login.js
render() {
const { username, is_loading } = this.state;
return (
<View style={styles.wrapper}>
<View style={styles.container}>
<View style={styles.main}>
<View style={styles.field_container}>
<Text style={styles.label}>Enter your username</Text>
<TextInput
style={styles.text_input}
onChangeText={username => this.setState({ username })}
value={username}
/>
</View>
{!is_loading && (
<Button title="Login" color="#0064e1" onPress={this.login} />
)}
{is_loading && (
<Text style={styles.loading_text}>Loading...</Text>
)}
</View>
</View>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.