-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
51 lines (46 loc) · 1.73 KB
/
App.js
File metadata and controls
51 lines (46 loc) · 1.73 KB
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
43
44
45
46
47
48
49
50
51
import 'moment/locale/nb'
import { AppStackNavigator, AuthStackNavigator } from './src/navigators'
import { NativeBaseProvider, extendTheme } from 'native-base'
import React, { useEffect } from 'react'
import { UserAuthContext, UserAuthProvider, UserProvider } from './src/contexts'
import { nativeBaseTheme, theme } from './src/styles/theme'
import { AppearanceProvider } from 'react-native-appearance'
import { NavigationContainer } from '@react-navigation/native'
import Orientation from 'react-native-orientation'
import { Root } from 'react-native-alert-notification'
import { ThemeProvider } from '@qonsoll/react-native-design'
import TranslationProvider from './src/contexts/TranslationContext'
const App = () => {
useEffect(() => {
Orientation.lockToPortrait()
}, [])
const nativeBaseThemeExtended = extendTheme(nativeBaseTheme)
return (
<Root>
<NativeBaseProvider theme={nativeBaseThemeExtended}>
<AppearanceProvider>
<ThemeProvider theme={theme}>
<TranslationProvider>
<UserAuthProvider>
<NavigationContainer>
<UserAuthContext.Consumer>
{({ _isUserAuthExists }) =>
_isUserAuthExists ? (
<UserProvider>
<AppStackNavigator />
</UserProvider>
) : (
<AuthStackNavigator />
)
}
</UserAuthContext.Consumer>
</NavigationContainer>
</UserAuthProvider>
</TranslationProvider>
</ThemeProvider>
</AppearanceProvider>
</NativeBaseProvider>
</Root>
)
}
export default App