-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
54 lines (48 loc) · 1.22 KB
/
App.tsx
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
52
53
54
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/emin93/react-native-template-typescript
*
* @format
*/
import React from 'react'
import { Provider as ReduxProvider } from 'react-redux'
import store from './app/store/BridgeStore'
import { Provider as PaperProvider } from 'react-native-paper'
import RootNavigation from './app/navigation/RootNavigation'
import firebase from 'react-native-firebase'
import { StatusBar } from 'react-native'
class App extends React.Component {
componentWillUnmount() {
firebase.database().ref('bridges').off('value')
const { currentUser } = firebase.auth()
if (currentUser) {
firebase.database()
.ref('ui')
.child(currentUser.uid)
.off('value')
}
console.log('firebase listener closed')
}
render() {
return (
<PaperProvider>
<StatusBar
barStyle="light-content"
backgroundColor="#6200ee"
/>
<RootNavigation />
</PaperProvider>
)
}
}
const AppContainer = (props: any) => {
return (
<ReduxProvider store={store}>
<App {...props} />
</ReduxProvider>
)
}
export default AppContainer