1
1
import React , { useContext } from 'react' ;
2
2
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' ;
3
- import { View , Text , StyleSheet , Button } from 'react-native' ;
3
+ import { View , Text , StyleSheet } from 'react-native' ;
4
4
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5' ;
5
5
6
6
import { primaryColor } from '../theme' ;
7
- import { CTX } from '../tools/context' ;
8
7
9
8
const styles = StyleSheet . create ( {
10
9
container : {
@@ -32,22 +31,9 @@ function Notifications() {
32
31
) ;
33
32
}
34
33
35
- function Profile ( props ) {
36
- console . log ( props ) ;
37
-
38
- const authContext = useContext ( CTX ) ;
39
- const { _logout} = authContext ;
40
-
41
- // const {loading, error, data} = useQuery(GET_GREETING);
42
-
43
- function _onLogout ( ) {
44
- _logout ( ) ;
45
- navigate ( 'Login' ) ;
46
- }
47
-
34
+ function Profile ( ) {
48
35
return (
49
36
< View style = { styles . container } >
50
- < Button onPress = { _onLogout } title = "Log out" color = "#841584" />
51
37
< Text > Profile</ Text >
52
38
</ View >
53
39
) ;
@@ -62,23 +48,23 @@ export default function TabNavigator(props) {
62
48
} } >
63
49
< Tab . Screen
64
50
name = "Feed"
65
- component = { Feed }
66
51
options = { {
67
52
tabBarLabel : 'Home' ,
68
53
tabBarIcon : ( { color, size} ) => (
69
54
< FontAwesome5 name = { 'home' } color = { color } size = { size } />
70
55
) ,
71
56
} }
57
+ children = { ( ) => < Feed { ...props } /> }
72
58
/>
73
59
< Tab . Screen
74
60
name = "Notifications"
75
- component = { Notifications }
76
61
options = { {
77
62
tabBarLabel : 'Notifications' ,
78
63
tabBarIcon : ( { color, size} ) => (
79
64
< FontAwesome5 name = { 'bell' } color = { color } size = { size } />
80
65
) ,
81
66
} }
67
+ children = { ( ) => < Notifications { ...props } /> }
82
68
/>
83
69
< Tab . Screen
84
70
name = "Profile"
@@ -89,6 +75,7 @@ export default function TabNavigator(props) {
89
75
< FontAwesome5 name = { 'user' } color = { color } size = { size } />
90
76
) ,
91
77
} }
78
+ children = { props => < Profile { ...props } /> }
92
79
/>
93
80
</ Tab . Navigator >
94
81
) ;
0 commit comments