forked from kushendesilva/pickngo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
37 lines (33 loc) · 1.36 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
import React, { useState } from "react";
import { default as colors } from "./src/configs/Colors.json";
import AppNavigator from "./src/navigation/AppNavigator";
import * as eva from "@eva-design/eva";
import { LogBox } from "react-native";
import { ApplicationProvider, IconRegistry } from "@ui-kitten/components";
import { EvaIconsPack } from "@ui-kitten/eva-icons";
import { ThemeContext } from "./src/configs/Theme";
import { AuthProvider } from "./src/provider/AuthProvider";
export default function App() {
React.useEffect(() => {
LogBox.ignoreLogs([
"AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage",
]);
}, []);
const [theme, setTheme] = useState("light");
const toggleTheme = () => {
const nextTheme = theme === "light" ? "dark" : "light";
setTheme(nextTheme);
};
return (
<>
<IconRegistry icons={EvaIconsPack} />
<ThemeContext.Provider value={{ theme, toggleTheme }}>
<ApplicationProvider {...eva} theme={{ ...eva[theme], ...colors }}>
<AuthProvider>
<AppNavigator />
</AuthProvider>
</ApplicationProvider>
</ThemeContext.Provider>
</>
);
}