-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
70 lines (64 loc) · 1.96 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import "parse-prop-types";
import * as React from "react";
import "react-native-gesture-handler";
import {
NavigationContainer,
DefaultTheme,
DarkTheme,
} from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { Appearance } from "react-native-appearance";
import { ThemeProvider, color } from "./src/unikit";
import Home from "./src/pages";
import Template from "./src/templates/component";
import { pages } from "./pages";
console.disableYellowBox = true;
const Stack = createStackNavigator();
export default function App() {
let colorScheme = Appearance.getColorScheme();
return (
<NavigationContainer
theme={colorScheme === "dark" ? DarkTheme : DefaultTheme}
>
<ThemeProvider
mode={colorScheme === "dark" ? "dark" : "dark"}
theme={{
colors: {
background: "#F9F8F2",
primary: "#54C1BE",
shadow: "#E6E3E3",
primaryLight: color("#54C1BE").setAlpha(0.1).toRgbString(),
primaryMedium: color("#54C1BE").setAlpha(0.5).toRgbString(),
text: "#5A6175",
success: "#54C1BE",
border: "rgba(0,0,0,0.1)",
modes: {
dark: {
background: "#211E39",
surface: "#34345D",
input: "#34345D",
shadow: "rgba(0,0,0,0.3)",
text: "#FFF",
border: "rgba(255,255,255,0.1)",
},
},
},
}}
>
<Stack.Navigator>
<Stack.Screen name="Unikit" component={Home} />
{pages.map(({ path, ...rest }, index) => {
return (
<Stack.Screen
key={index}
name={path.replace("/", "")}
component={Template}
initialParams={rest}
/>
);
})}
</Stack.Navigator>
</ThemeProvider>
</NavigationContainer>
);
}