-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
56 lines (48 loc) · 1.7 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
import React, { useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
import HomeScreen from './screens/HomeScreen';
import VirtualCard from './screens/VirtualCard';
import MemoriesScreen from './screens/MemoriesScreen';
const fetchFonts = () => {
return Font.loadAsync({
balqis: require('./assets/fonts/Balqis.ttf'),
'dm-sans-boldItalic': require('./assets/fonts/DMSans-BoldItalic.ttf'),
porcelain: require('./assets/fonts/Porcelain.ttf'),
Reckless: require('./assets/fonts/Reckless.otf'),
});
};
const ApplicationNavigator = createStackNavigator();
const AppStack = () => (
<NavigationContainer>
<ApplicationNavigator.Navigator screenOptions={{ headerShown: false }}>
<ApplicationNavigator.Screen name='Home' component={HomeScreen} />
<ApplicationNavigator.Screen name='Card' component={VirtualCard} />
<ApplicationNavigator.Screen name='Memories' component={MemoriesScreen} />
</ApplicationNavigator.Navigator>
</NavigationContainer>
);
export default function App() {
const [fontLoaded, setFontLoaded] = useState(false);
while (!fontLoaded) {
return (
<AppLoading
startAsync={fetchFonts}
onFinish={() => setFontLoaded(true)}
onError={(err) => console.log('Error in Loading Fonts', err)}
/>
);
}
return <AppStack />;
}
// const styles = StyleSheet.create({
// container: {
// flex: 1,
// backgroundColor: '#fff',
// alignItems: 'center',
// justifyContent: 'center',
// },
// });