Skip to content

Instantly share code, notes, and snippets.

@spencercarli
Created March 9, 2016 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spencercarli/724d370ddaa129b6f715 to your computer and use it in GitHub Desktop.
Save spencercarli/724d370ddaa129b6f715 to your computer and use it in GitHub Desktop.
Setup the React Native App - signIn.js
import React, {
Component,
StyleSheet,
Text,
View
} from 'react-native';
import Button from '../components/button';
import ddpClient from '../ddp';
export default class SignIn extends Component {
constructor(props) {
super(props);
this.state = {
error: null
}
}
render() {
let button;
if (this.props.connected) {
button = <Button text="Sign In with Google" />;
}
return (
<View style={styles.container}>
<Text style={styles.main}>
Sign In Screen
</Text>
<Text style={styles.error}>{this.state.error}</Text>
{button}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
main: {
fontSize: 20,
textAlign: 'center',
margin: 10
},
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
marginHorizontal: 20,
marginVertical: 5,
padding: 5
},
buttons: {
flexDirection: 'row'
},
error: {
color: 'red',
height: 20
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment