-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
45 lines (38 loc) · 1.35 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
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import Card from "./src/sections/Card";
import Transactions from "./src/sections/Transactions";
import Header from "./src/sections/Header";
import { useColorScheme } from "nativewind";
import { useFonts } from "expo-font";
import { useCallback } from "react";
import * as SplashScreen from "expo-splash-screen";
export default function App() {
const { colorScheme, toggleColorScheme } = useColorScheme();
const [fontsLoaded, fontError] = useFonts({
SpaceGroteskSemiBold: require("./src/font/SpaceGrotesk-SemiBold.ttf"),
SpaceGroteskBold: require("./src/font/SpaceGrotesk-Bold.ttf"),
SpaceGroteskMedium: require("./src/font/SpaceGrotesk-Medium.ttf"),
});
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded || fontError) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded, fontError]);
if (!fontsLoaded) {
return null;
}
return (
<SafeAreaView className="p-6 dark:bg-neutral-900">
<StatusBar style={colorScheme == "dark" ? "light" : "dark"} />
<View onLayout={onLayoutRootView}>
<View className="my-6">
<Header />
<Card />
<Transactions />
</View>
</View>
</SafeAreaView>
);
}