-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
35 lines (30 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
import React from 'react';
import * as eva from '@eva-design/eva';
import {StatusBar} from 'react-native';
import {ApplicationProvider, IconRegistry} from '@ui-kitten/components';
import {EvaIconsPack} from '@ui-kitten/eva-icons';
import {AppNavigator} from './navigation.component';
import {ThemeContext} from './theme-context';
import Amplify from 'aws-amplify'
import { withAuthenticator } from 'aws-amplify-react-native'
import config from './src/aws-exports'
Amplify.configure(config)
const App = () => {
const [theme, setTheme] = React.useState('light');
const toggleTheme = () => {
const nextTheme = theme === 'light' ? 'dark' : 'light';
setTheme(nextTheme);
};
return (
<>
<StatusBar barStyle={`${theme === 'light' ? 'dark' : 'light'}-content`} translucent={true} />
<IconRegistry icons={EvaIconsPack} />
<ThemeContext.Provider value={{theme, toggleTheme}}>
<ApplicationProvider {...eva} theme={eva[theme]}>
<AppNavigator />
</ApplicationProvider>
</ThemeContext.Provider>
</>
);
};
export default withAuthenticator(App)