diff --git a/navigation/index.js b/navigation/index.js index 33df595d..8e57a638 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -12,6 +12,6 @@ const SwitchNavigator = createSwitchNavigator( } ) -const AppContainer = createAppContainer(AuthNavigation) +const AppContainer = createAppContainer(SwitchNavigator) export default AppContainer diff --git a/screens/Login.js b/screens/Login.js index 53b9645e..ba9db5c0 100644 --- a/screens/Login.js +++ b/screens/Login.js @@ -1,12 +1,56 @@ import React from 'react' -import { StyleSheet, Text, View, Button } from 'react-native' +import { StyleSheet, View, Button, TextInput } from 'react-native' export default class Login extends React.Component { + state = { + email: '', + password: '' + } + + handleEmailChange = email => { + this.setState({ email }) + } + + handlePasswordChange = password => { + this.setState({ password }) + } + + onLogin = async () => { + const { email, password } = this.state + try { + if (email.length > 0 && password.length > 0) { + this.props.navigation.navigate('App') + } + } catch (error) { + alert(error) + } + } + goToSignup = () => this.props.navigation.navigate('Signup') render() { + const { email, password } = this.state + return ( - Login + + + + + + +