-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
37 lines (32 loc) · 913 Bytes
/
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
import React, { useState } from 'react'
import { StyleSheet, View, Alert } from 'react-native'
import * as Font from 'expo-font'
import { AppLoading } from 'expo'
import { TodoState } from './src/context/todo/TodoState'
import { ScreenState } from './src/context/screen/ScreenState'
import { MainLayout } from './src/MainLayout'
async function loadApplication() {
await Font.loadAsync({
'roboto-regular': require('./assets/fonts/Roboto-Regular.ttf'),
'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf')
})
}
export default function App() {
const [isReady, setIsReady] = useState(false)
if (!isReady) {
return (
<AppLoading
startAsync={loadApplication}
onError={err => console.log(err)}
onFinish={() => setIsReady(true)}
/>
)
}
return (
<ScreenState>
<TodoState>
<MainLayout />
</TodoState>
</ScreenState>
)
}