-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
49 lines (42 loc) · 1.24 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
import Toast from "react-native-toast-message";
import { ActivityIndicator, StatusBar } from "react-native";
import { ThemeProvider } from "styled-components/native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import {
Roboto_300Light,
Roboto_400Regular,
Roboto_500Medium,
Roboto_700Bold,
useFonts,
} from "@expo-google-fonts/roboto";
import { Routes } from "./src/routes";
import { defaultTheme } from "./src/styles/themes/default";
import { toastConfig } from "./src/shared/utils/toastConfigs";
export default function App() {
const [LoadFonts] = useFonts({
Roboto_300Light,
Roboto_400Regular,
Roboto_500Medium,
Roboto_700Bold,
});
const handleFontsLoading = () => {
if (!LoadFonts) {
return (
<ActivityIndicator
style={{ flex: 1, backgroundColor: defaultTheme["primary-dark"] }}
color={defaultTheme.secondary}
/>
);
}
return <Routes />;
};
return (
<>
<GestureHandlerRootView style={{ flex: 1 }}>
<ThemeProvider theme={defaultTheme}>{handleFontsLoading()}</ThemeProvider>
<Toast config={toastConfig} />
</GestureHandlerRootView>
<StatusBar backgroundColor="transparent" translucent />
</>
);
}