-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
45 lines (42 loc) · 1.08 KB
/
App.tsx
File metadata and controls
45 lines (42 loc) · 1.08 KB
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 {
Box,
NativeBaseProvider,
NativeBaseProviderProps,
useColorModeValue,
} from "native-base";
import { PropsWithChildren } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
import { WordleScreen } from "./src/components/WordleScreen";
import { wordleTheme } from "./src/theme/theme";
/** Wrapper with all context providers. */
export function AppWrapper({
children,
nativeBaseProps,
}: PropsWithChildren<{ nativeBaseProps?: Partial<NativeBaseProviderProps> }>) {
return (
<NativeBaseProvider theme={wordleTheme} {...nativeBaseProps}>
{children}
</NativeBaseProvider>
);
}
function BackgroundProvider({
children,
}: PropsWithChildren<Record<string, unknown>>) {
const bg = useColorModeValue("white", "gray.900") as string;
return (
<Box size="full" bg={bg}>
{children}
</Box>
);
}
export default function App() {
return (
<AppWrapper>
<SafeAreaView style={{ height: "100%" }}>
<BackgroundProvider>
<WordleScreen />
</BackgroundProvider>
</SafeAreaView>
</AppWrapper>
);
}