-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
34 lines (31 loc) · 930 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
32
33
34
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 './navigator/AppNavigator'
import { ThemeContext } from './context/ThemeContext'
import { QuizProvider } from './context/QuizContext'
export default () => {
const [theme, setTheme] = React.useState('light')
const toggleTheme = () => {
const nextTheme = theme === 'light' ? 'dark' : 'light'
setTheme(nextTheme)
}
return (
<>
<IconRegistry icons={EvaIconsPack} />
<ThemeContext.Provider
value={{
theme,
toggleTheme,
}}
>
<QuizProvider>
<ApplicationProvider {...eva} theme={eva[theme]}>
<AppNavigator />
</ApplicationProvider>
</QuizProvider>
</ThemeContext.Provider>
</>
)
}