-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
42 lines (36 loc) · 1.08 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
import React, {useEffect, useState} from 'react';
import {Appearance} from 'react-native';
import MainNavigation from './app/navigation/MainNavigation';
import SplashScreen from 'react-native-splash-screen';
import {SafeAreaProvider} from 'react-native-safe-area-context';
const App = () => {
const PremiumUser = false;
const colorScheme = Appearance.getColorScheme();
const [appTheme, setAppTheme] = useState(colorScheme);
const onChangeAppTheme = () => {
//console.log('onChangeAppTheme');
setAppTheme(Appearance.getColorScheme());
// Appearance.addChangeListener(({colorScheme}) => {
// setAppTheme(Appearance.getColorScheme() === 'dark' ? 'dark' : 'light');
// console.log('test', appTheme);
// });
};
useEffect(() => {
/*
setTimeout(() => {
SplashScreen.hide();
}, 1000);
*/
SplashScreen.hide();
}, []);
return (
<SafeAreaProvider>
<MainNavigation
isPremiumUser={PremiumUser}
appTheme={appTheme}
onChangeAppTheme={onChangeAppTheme}
/>
</SafeAreaProvider>
);
};
export default App;