43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
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';
|
|
import { Provider as PaperProvider } from 'react-native-paper';
|
|
import AwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
|
import { NavigationContainer } from '@react-navigation/native';
|
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
import Login from "./Views/Login.js"
|
|
import Feed from "./Views/Feed.js"
|
|
|
|
const Stack = createNativeStackNavigator();
|
|
|
|
export default function App() {
|
|
let [isLoggedIn, setIsLoggedIn] = useState(false);
|
|
|
|
useEffect(async () => {
|
|
let r = await API.isLoggedIn();
|
|
setIsLoggedIn(r);
|
|
}, []);
|
|
|
|
return (
|
|
<NavigationContainer>
|
|
<Stack.Navigator>
|
|
<Stack.Screen name="Feed" component={Feed} />
|
|
<Stack.Screen name="Login" component={Login} />
|
|
</Stack.Navigator>
|
|
</NavigationContainer>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
marginTop: 25,
|
|
paddingTop: 10,
|
|
backgroundColor: "#edf2f7"
|
|
},
|
|
});
|