1
1
import { Tabs } from 'expo-router' ;
2
- import React from 'react' ;
2
+ import { Image , View , Text , StyleSheet } from 'react-native' ;
3
+ import React , { useEffect } from 'react' ;
3
4
4
- import { TabBarIcon } from '@/components/navigation/TabBarIcon' ;
5
5
import { Colors } from '@/constants/Colors' ;
6
6
import { useColorScheme } from '@/hooks/useColorScheme' ;
7
7
import Feather from '@expo/vector-icons/Feather' ;
8
8
import Entypo from '@expo/vector-icons/Entypo' ;
9
9
10
- const ICON_SIZE = 34 ;
10
+ const ICON_SIZE = 29 ;
11
11
12
12
export default function TabLayout ( ) {
13
13
const colorScheme = useColorScheme ( ) ;
@@ -17,60 +17,127 @@ export default function TabLayout() {
17
17
screenOptions = { {
18
18
tabBarActiveTintColor : Colors [ colorScheme ?? 'light' ] . tint ,
19
19
tabBarInactiveTintColor : 'black' ,
20
- headerShown : false ,
20
+ tabBarShowLabel : true ,
21
21
tabBarStyle : {
22
22
backgroundColor : '#CCCCCC' ,
23
23
borderTopWidth : 0 ,
24
- height : 68 ,
25
- paddingBottom : 10 ,
24
+ height : 85 ,
25
+ paddingBottom : 0 ,
26
26
paddingTop : 10 ,
27
27
} ,
28
+ headerShown : true ,
28
29
} } >
29
30
< Tabs . Screen
30
31
name = "index"
31
32
options = { {
32
- title : " ",
33
+ tabBarLabel : "Home ",
33
34
tabBarIcon : ( { color } ) => (
34
35
< Feather name = "home" size = { ICON_SIZE } color = { color } />
35
36
) ,
37
+ header : ( ) => (
38
+ < View style = { styles . customHeader } >
39
+ < Text style = { styles . headerText } > Home</ Text >
40
+ < Image
41
+ source = { require ( '../../assets/images/aarti-logo.png' ) }
42
+ style = { styles . logo }
43
+ />
44
+ </ View >
45
+ )
36
46
} }
37
47
/>
38
48
< Tabs . Screen
39
49
name = "resources"
40
50
options = { {
41
- title : " ",
51
+ tabBarLabel : "Resources ",
42
52
tabBarIcon : ( { color } ) => (
43
53
< Feather name = "book-open" size = { ICON_SIZE } color = { color } />
44
54
) ,
55
+ header : ( ) => (
56
+ < View style = { styles . customHeader } >
57
+ < Text style = { styles . headerText } > Resources</ Text >
58
+ < Image
59
+ source = { require ( '../../assets/images/aarti-logo.png' ) }
60
+ style = { styles . logo }
61
+ />
62
+ </ View >
63
+ )
45
64
} }
46
65
/>
47
66
< Tabs . Screen
48
67
name = "quizzes"
49
68
options = { {
50
- title : " ",
69
+ tabBarLabel : "Quizzes ",
51
70
tabBarIcon : ( { color } ) => (
52
71
< Entypo name = "graduation-cap" size = { ICON_SIZE } color = { color } />
53
72
) ,
73
+ header : ( ) => (
74
+ < View style = { styles . customHeader } >
75
+ < Text style = { styles . headerText } > Quizzes</ Text >
76
+ < Image
77
+ source = { require ( '../../assets/images/aarti-logo.png' ) }
78
+ style = { styles . logo }
79
+ />
80
+ </ View >
81
+ )
54
82
} }
55
83
/>
56
84
< Tabs . Screen
57
85
name = "profile"
58
86
options = { {
59
- title : " ",
87
+ tabBarLabel : "Profile ",
60
88
tabBarIcon : ( { color } ) => (
61
89
< Feather name = "user" size = { ICON_SIZE } color = { color } />
62
90
) ,
91
+ header : ( ) => (
92
+ < View style = { styles . customHeader } >
93
+ < Text style = { styles . headerText } > Profile</ Text >
94
+ < Image
95
+ source = { require ( '../../assets/images/aarti-logo.png' ) }
96
+ style = { styles . logo }
97
+ />
98
+ </ View >
99
+ )
63
100
} }
64
101
/>
65
102
< Tabs . Screen
66
103
name = "chatbot"
67
104
options = { {
68
- title : " ",
105
+ tabBarLabel : "Chat ",
69
106
tabBarIcon : ( { color } ) => (
70
107
< Entypo name = "chat" size = { ICON_SIZE } color = { color } />
71
108
) ,
109
+ header : ( ) => (
110
+ < View style = { styles . customHeader } >
111
+ < Text style = { styles . headerText } > Chat</ Text >
112
+ < Image
113
+ source = { require ( '../../assets/images/aarti-logo.png' ) }
114
+ style = { styles . logo }
115
+ />
116
+ </ View >
117
+ )
72
118
} }
73
119
/>
74
120
</ Tabs >
75
121
) ;
76
122
}
123
+
124
+ const styles = StyleSheet . create ( {
125
+ customHeader : {
126
+ flexDirection : 'row' ,
127
+ alignItems : 'center' ,
128
+ height : 100 ,
129
+ backgroundColor : '#5f2446' ,
130
+ justifyContent : 'space-between' ,
131
+ paddingHorizontal : 15 ,
132
+ } ,
133
+ logo : {
134
+ width : 120 ,
135
+ height : 70 ,
136
+ marginRight : 10 ,
137
+ } ,
138
+ headerText : {
139
+ fontSize : 25 ,
140
+ fontWeight : 'bold' ,
141
+ color : '#fff' ,
142
+ } ,
143
+ } ) ;
0 commit comments