-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
82 lines (79 loc) · 2.5 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React, { useState } from 'react';
import Notes from './screens/Notes';
import AddNote from './screens/AddNote';
import ViewNote from './screens/ViewNote';
import SplashScreen from './screens/SplashScreen';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as Font from 'expo-font';
import {AppLoading} from 'expo';
const Stack = createStackNavigator();
const getFonts = async () =>
Font.loadAsync({
'Lato-Regular': require('./assets/fonts/Lato-Regular.ttf'),
'Roboto-Light': require('./assets/fonts/Roboto-Light.ttf'),
'DancingScript-Bold' : require('./assets/fonts/Roboto-Light.ttf'),
'Montserrat-SemiBold' : require('./assets/fonts/Montserrat-SemiBold.ttf'),
'Raleway-Medium' : require('./assets/fonts/Raleway-Medium.ttf'),
});
export default function App() {
const [fontsLoaded, setFontsLoaded] = useState(false);
if(fontsLoaded){
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="SplashScreen"
component={SplashScreen}
options={
{headerShown: false}
}
/>
<Stack.Screen
name="Notes"
component={Notes}
options={
{
title: 'My Notes',
headerStyle: {backgroundColor: '#FE7B76'},
headerTintColor: '#000',
headerLeft: null,
headerTitleStyle: {fontFamily: 'Raleway-Medium', fontSize: 30}
}
}
/>
<Stack.Screen
name="AddNote"
component={AddNote}
options={
{
title: 'Add Note',
headerStyle: {backgroundColor: '#160416'},
headerTintColor: '#FFF',
headerTitleStyle: {fontFamily: 'Raleway-Medium', fontSize: 30}
}
}
/>
<Stack.Screen
name="ViewNote"
component={ViewNote}
options={
{
headerStyle: {backgroundColor: '#160416'},
headerTintColor: '#FFF',
headerTitleStyle: {fontFamily: 'Raleway-Medium', fontSize: 30},
}
}
/>
</Stack.Navigator>
</NavigationContainer>
);
} else {
return (
<AppLoading
startAsync={getFonts}
onFinish={() => setFontsLoaded(true)}
/>
);
}
}