-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
66 lines (64 loc) · 2.39 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React, {useEffect}from 'react';
import { SafeAreaView, StyleSheet, Text, View,StatusBar} from 'react-native';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import Login from './component/login';
import Signup from './component/signup';
import Home from './component/home';
import Calc from './component/calc';
import Charts from './component/charts';
import Steps from './component/steps';
import Accomplishment from './component/accomp';
import Bmi from './component/caclcomponent/bmi';
import Macro from './component/caclcomponent/macro';
import Calorie from './component/caclcomponent/calorie';
import Bmiout from './component/caclcomponent/bmiout';
import Macout from './component/caclcomponent/macout';
import Calout from './component/caclcomponent/calout';
import About from './component/About';
import SplashScreen from 'react-native-splash-screen';
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
let cond;
if (!firebase.app.length){
cond='Home'
}
else{
cond='Login'
}
const Stack = createStackNavigator();
export default function App() {
useEffect(() => {
SplashScreen.hide();
}, [])
return (
<SafeAreaView style={styles.container}>
<NavigationContainer>
<Stack.Navigator initialRouteName={cond}
screenOptions={{headerShown:false}}
>
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Signup" component={Signup} />
<Stack.Screen name="Home" component={Home}/>
<Stack.Screen name="Calc" component={Calc}/>
<Stack.Screen name="Chart" component={Charts}/>
<Stack.Screen name="Step" component={Steps}/>
<Stack.Screen name="Accomplishment" component={Accomplishment}/>
<Stack.Screen name="Bmi" component={Bmi}/>
<Stack.Screen name="Macro" component={Macro}/>
<Stack.Screen name="Calorie" component={Calorie}/>
<Stack.Screen name="Bmiout" component={Bmiout}/>
<Stack.Screen name="Macout" component={Macout}/>
<Stack.Screen name="Calout" component={Calout}/>
<Stack.Screen name="About" component={About}/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});