-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.tsx
43 lines (37 loc) · 978 Bytes
/
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
import React, { useEffect } from 'react'
import { StatusBar } from 'react-native'
import { useFonts } from 'expo-font'
import AppLoading from 'expo-app-loading'
import { decode, encode } from 'base-64'
import { AppProvider } from './src/contexts'
import { useLocale } from './src/hooks/useLocale'
import { Routes } from './src/routes'
export default function App() {
const { getStoredLocale } = useLocale()
const [areFontsLoaded] = useFonts({
Uchen: require('./src/assets/fonts/Uchen-Regular.ttf'),
ZenLoop: require('./src/assets/fonts/ZenLoop-Regular.ttf'),
})
if (!global.btoa) {
global.btoa = encode
}
if (!global.atob) {
global.atob = decode
}
useEffect(() => {
getStoredLocale()
}, [])
if (!areFontsLoaded) {
return <AppLoading />
}
return (
<AppProvider>
<StatusBar
barStyle='light-content'
backgroundColor='transparent'
translucent
/>
<Routes />
</AppProvider>
)
}