Basic Navigation
This commit is contained in:
23
App.js
23
App.js
@@ -3,9 +3,14 @@ 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 Feed from './components/Feed.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);
|
||||
@@ -16,16 +21,12 @@ export default function App() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PaperProvider settings={{
|
||||
icon: props => <AwesomeIcon {...props} />,
|
||||
}}>
|
||||
<SafeAreaView style={styles.container}>
|
||||
<Text>EMI Social LOGO</Text>
|
||||
{!isLoggedIn && <LoginForm />}
|
||||
{isLoggedIn && <Feed />}
|
||||
<StatusBar style="auto" />
|
||||
</SafeAreaView>
|
||||
</PaperProvider>
|
||||
<NavigationContainer>
|
||||
<Stack.Navigator>
|
||||
<Stack.Screen name="Feed" component={Feed} />
|
||||
<Stack.Screen name="Login" component={Login} />
|
||||
</Stack.Navigator>
|
||||
</NavigationContainer>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user