Basic Navigation
This commit is contained in:
35
Views/Login.js
Normal file
35
Views/Login.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { StyleSheet, Text, View, TextInput, SafeAreaView } from 'react-native';
|
||||
import API from './../API.js';
|
||||
import LoginForm from './../components/Login.js';
|
||||
|
||||
export default function App({navigation, route}) {
|
||||
useEffect(async () => {
|
||||
let r = await API.isLoggedIn();
|
||||
if(r) navigation.navigate('Feed')
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PaperProvider settings={{
|
||||
icon: props => <AwesomeIcon {...props} />,
|
||||
}}>
|
||||
<SafeAreaView style={styles.container}>
|
||||
<Text>EMI Social LOGO</Text>
|
||||
<LoginForm />
|
||||
<StatusBar style="auto" />
|
||||
</SafeAreaView>
|
||||
</PaperProvider>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
marginTop: 25,
|
||||
paddingTop: 10,
|
||||
backgroundColor: "#edf2f7"
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user