-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
33 lines (29 loc) · 999 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
import React from "react";
import AppLoading from "expo-app-loading";
import { useFonts } from "expo-font";
import { Ionicons } from "@expo/vector-icons";
import { useAssets } from "expo-asset";
import {
NavigationContainer,
DarkTheme,
DefaultTheme,
} from "@react-navigation/native";
import Tabs from "./navigation/Tabs";
import { useColorScheme } from "react-native";
import Stack from "./navigation/Stack";
import Root from "./navigation/Root";
import { ThemeProvider } from "styled-components";
import { darkTheme, lightTheme } from "./styled";
export default function App() {
const [assets] = useAssets([require("./bg.jpeg")]);
const [loaded] = useFonts(Ionicons.font);
const isDark = useColorScheme() === "dark";
if (!assets || !loaded) return <AppLoading />;
return (
<ThemeProvider theme={isDark ? darkTheme : lightTheme}>
<NavigationContainer theme={isDark ? DarkTheme : DefaultTheme}>
<Root />
</NavigationContainer>
</ThemeProvider>
);
}