-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
30 lines (27 loc) · 851 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
import { useFonts } from "@use-expo/font";
import React, { useEffect, useState } from "react";
import CameraPage from "./components/CameraPage";
import Loading from "./components/Loading";
import { AppLoading } from "expo";
import { View } from "react-native";
export default function App() {
const [fontsLoaded] = useFonts({
"rubik-regular": require("./assets/fonts/Rubik/Rubik-Regular.ttf"),
"rubik-bold": require("./assets/fonts/Rubik/Rubik-Bold.ttf"),
"rubik-black": require("./assets/fonts/Rubik/Rubik-Black.ttf"),
});
const [ready, setReady] = useState(0);
useEffect(() => {
setTimeout(() => {
setReady(1);
}, 2000);
});
if (!fontsLoaded) {
return <AppLoading />;
}
return (
<View style={{ flex: 1, backgroundColor: "black" }}>
{ready ? <CameraPage /> : <Loading />}
</View>
);
}