-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
102 lines (92 loc) · 3.02 KB
/
App.tsx
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
90
91
92
93
94
95
96
97
98
99
100
101
102
import { StatusBar } from "expo-status-bar";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Home from "./src/screens/Home";
import Search from "./src/screens/Search";
import JobDetails from "./src/screens/JobDetails";
import SignUp from './src/screens/SignUp';
import SignIn from './src/screens/SignIn';
import { COLORS, icons, images, SIZES } from "./src/constants";
import { ScreenHeaderBtn, ScreenHeaderProfileBtn } from "./src/components";
import { useEffect } from "react";
import { useFonts } from "expo-font";
import * as SplashScreen from "expo-splash-screen";
import { RootStackParamList } from "./src/constants/types";
SplashScreen.preventAutoHideAsync();
const Stack = createNativeStackNavigator<RootStackParamList>();
export default function App() {
const [fontsLoaded] = useFonts({
bold: require("./assets/fonts/DMSans-Bold.ttf"),
medium: require("./assets/fonts/DMSans-Medium.ttf"),
regular: require("./assets/fonts/DMSans-Regular.ttf"),
});
useEffect(() => {
console.log("fontsLoaded is", fontsLoaded);
if (fontsLoaded) {
SplashScreen.hideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<>
<StatusBar style="dark" />
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Sign In"
component={SignIn}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Sign Up"
component={SignUp}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Home"
component={Home}
options={{
headerShadowVisible: false,
headerStyle: { backgroundColor: COLORS.lightWhite },
headerRight: () => (
<ScreenHeaderProfileBtn
initial={''}
/>
),
headerTitle: () => "",
headerBackVisible: false
}}
/>
<Stack.Screen
name="Search"
component={Search}
options={{
headerStyle: { backgroundColor: COLORS.lightWhite },
headerShadowVisible: false,
headerTitle: "",
}}
/>
<Stack.Screen
name="JobDetails"
component={JobDetails}
options={{
headerStyle: { backgroundColor: COLORS.lightWhite },
headerShadowVisible: false,
headerBackVisible: false,
headerRight: () => (
<ScreenHeaderBtn iconUrl={icons.share} dimension="60%" />
),
headerTitle: "",
}}
/>
</Stack.Navigator>
</NavigationContainer>
</>
);
}