-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
executable file
·31 lines (25 loc) · 901 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
import React from 'react';
import * as eva from '@eva-design/eva';
import { ApplicationProvider, IconRegistry } from '@ui-kitten/components';
import { EvaIconsPack } from '@ui-kitten/eva-icons';
import { AppNavigator } from './navigation/mainNavigation.component';
import { ThemeContext } from './theme-context';
import { Appearance, LogBox } from 'react-native';
export default () => {
const [theme, setTheme] = React.useState(Appearance.getColorScheme());
const toggleTheme = () => {
//console.log(theme);
const nextTheme = theme === 'dark' ? 'light' : 'dark';
setTheme(nextTheme);
};
return (
<>
<IconRegistry icons={EvaIconsPack}/>
<ThemeContext.Provider value={{ theme, toggleTheme }}>
<ApplicationProvider {...eva} theme={eva[theme]}>
<AppNavigator/>
</ApplicationProvider>
</ThemeContext.Provider>
</>
);
};