-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
62 lines (54 loc) · 1.55 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React, {Component} from 'react';
import {StyleSheet, Button, SafeAreaView, View, ScrollView} from 'react-native';
import {createAppContainer} from 'react-navigation';
import {createDrawerNavigator, DrawerItems} from 'react-navigation-drawer';
import Email_Login from './src/Login/Email/index';
import Number_Login from './src/Login/Number/index';
import Verification from './src/Login/Number/Verification/index';
import Register from './src/Register/Email/index';
import Loading from './src/Loading/index';
import Map from './src/Map/index';
import {firebase} from '@react-native-firebase/auth';
export default class Drawer extends Component {
render() {
return <AppContainer></AppContainer>;
}
}
const signOutUser = async () => {
try {
await firebase.auth().signOut();
navigate('Init');
} catch (e) {
console.log(e);
}
};
const CustomDrawerComponent = props => (
<SafeAreaView style={{flex:1}}>
<ScrollView>
<DrawerItems {...props}></DrawerItems>
</ScrollView>
<View style={{justifyContent:'flex-end'}}>
<Button
title="Sair"
color='#fbb13c'
onPress={signOutUser}></Button>
</View>
</SafeAreaView>
);
const AppDrawerNavigator = createDrawerNavigator(
{
Loading: Loading,
Email_Login: Email_Login,
Number_Login: Number_Login,
Register: Register,
Map: Map,
Verification, Verification,
},
{
contentComponent: CustomDrawerComponent,
contentOptions: {
activeTintColor: '#fbb13c',
},
},
);
const AppContainer = createAppContainer(AppDrawerNavigator);