-
Notifications
You must be signed in to change notification settings - Fork 47
/
Main.web.tsx
48 lines (43 loc) · 1.47 KB
/
Main.web.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
import { NavigationContainer } from "@react-navigation/native";
import { Theme } from "@react-navigation/native/lib/typescript/src/types";
import { StyleSheet, View } from "react-native";
import { useThemeContext } from "@waveshq/walletkit-ui";
import { tailwind } from "@tailwind";
import { EnvironmentName, getEnvironment } from "@waveshq/walletkit-core";
import { getReleaseChannel } from "@api/releaseChannel";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { getDefaultTheme } from "@constants/Theme";
import { RootNavigator } from "./RootNavigator";
import { PlaygroundNavigator } from "./PlaygroundNavigator/PlaygroundNavigator";
export function Main(): JSX.Element {
const env = getEnvironment(getReleaseChannel());
const { isLight } = useThemeContext();
const DeFiChainTheme: Theme = getDefaultTheme(isLight);
return (
<SafeAreaProvider>
<View
style={tailwind("flex-row flex-1 justify-center items-center bg-black")}
>
<View style={styles.phone}>
<RootNavigator />
</View>
{env.name !== EnvironmentName.Production && (
<View style={[styles.phone, tailwind("bg-white ml-2")]}>
<NavigationContainer theme={DeFiChainTheme}>
<PlaygroundNavigator />
</NavigationContainer>
</View>
)}
</View>
</SafeAreaProvider>
);
}
/**
* iPhone 8 Size
*/
const styles = StyleSheet.create({
phone: {
height: 667,
width: 375,
},
});