-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
89 lines (80 loc) · 2.44 KB
/
App.js
File metadata and controls
89 lines (80 loc) · 2.44 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { StatusBar } from "expo-status-bar";
import React, { useState, useEffect } from "react";
import { NavigationContainer } from "@react-navigation/native";
import BottomTabNavigation from "./navigation/BottomTabNavigation";
import { createStackNavigator } from "@react-navigation/stack";
import {
LoaderScreen,
IntroductionScreen,
SignupScreen,
SigninScreen,
} from "./screens";
import { AntDesign } from "@expo/vector-icons";
import { Text, View, Image } from "react-native";
const Stacks = createStackNavigator();
export default function App() {
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 500);
}, [loading]);
const [loading, setLoading] = useState(true);
const [user, setUser] = useState({});
if (loading) return <LoaderScreen />;
if (!user)
return (
<NavigationContainer>
<StatusBar type="light" />
<Stacks.Navigator initialRouteName="Intro">
<Stacks.Screen
name="Intro"
component={IntroductionScreen}
options={{ headerShown: false }}
/>
<Stacks.Screen
name="Signup"
component={SignupScreen}
setUser={setUser}
options={{
headerShown: false,
}}
/>
<Stacks.Screen
name="Signin"
component={SigninScreen}
options={{
title: "",
headerStyle: { backgroundColor: "black" },
headerLeft: () => {
return (
<View
style={{
flexDirection: "row",
alignItems: "center",
paddingHorizontal: 8,
}}>
<AntDesign name="arrowleft" size={24} color="white" />
<Image
source={require("./assets/images/logo.png")}
style={{
aspectRatio: 2 / 1,
width: 150,
height: 70,
}}
/>
</View>
);
},
}}
/>
</Stacks.Navigator>
</NavigationContainer>
);
return (
<NavigationContainer>
<Stacks.Navigator screenOptions={{ headerShown: false }}>
<Stacks.Screen name="Home" component={BottomTabNavigation} />
</Stacks.Navigator>
</NavigationContainer>
);
}