Skip to content

Commit c26d50a

Browse files
committed
added header for each page
1 parent 8991ce7 commit c26d50a

9 files changed

+2688
-4679
lines changed

app.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"favicon": "./assets/images/favicon.png"
2828
},
2929
"plugins": [
30-
"expo-router"
30+
"expo-router",
31+
"expo-font"
3132
],
3233
"experiments": {
3334
"typedRoutes": true

app/(tabs)/_layout.tsx

+78-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
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';
34

4-
import { TabBarIcon } from '@/components/navigation/TabBarIcon';
55
import { Colors } from '@/constants/Colors';
66
import { useColorScheme } from '@/hooks/useColorScheme';
77
import Feather from '@expo/vector-icons/Feather';
88
import Entypo from '@expo/vector-icons/Entypo';
99

10-
const ICON_SIZE = 34;
10+
const ICON_SIZE = 29;
1111

1212
export default function TabLayout() {
1313
const colorScheme = useColorScheme();
@@ -17,60 +17,127 @@ export default function TabLayout() {
1717
screenOptions={{
1818
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
1919
tabBarInactiveTintColor: 'black',
20-
headerShown: false,
20+
tabBarShowLabel: true,
2121
tabBarStyle: {
2222
backgroundColor: '#CCCCCC',
2323
borderTopWidth: 0,
24-
height: 68,
25-
paddingBottom: 10,
24+
height: 85,
25+
paddingBottom: 0,
2626
paddingTop: 10,
2727
},
28+
headerShown: true,
2829
}}>
2930
<Tabs.Screen
3031
name="index"
3132
options={{
32-
title:"",
33+
tabBarLabel: "Home",
3334
tabBarIcon: ({ color }) => (
3435
<Feather name="home" size={ICON_SIZE} color = {color} />
3536
),
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+
)
3646
}}
3747
/>
3848
<Tabs.Screen
3949
name="resources"
4050
options={{
41-
title:"",
51+
tabBarLabel: "Resources",
4252
tabBarIcon: ({ color }) => (
4353
<Feather name="book-open" size={ICON_SIZE} color = {color} />
4454
),
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+
)
4564
}}
4665
/>
4766
<Tabs.Screen
4867
name="quizzes"
4968
options={{
50-
title:"",
69+
tabBarLabel: "Quizzes",
5170
tabBarIcon: ({ color }) => (
5271
<Entypo name="graduation-cap" size={ICON_SIZE} color= {color} />
5372
),
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+
)
5482
}}
5583
/>
5684
<Tabs.Screen
5785
name="profile"
5886
options={{
59-
title:"",
87+
tabBarLabel: "Profile",
6088
tabBarIcon: ({ color }) => (
6189
<Feather name="user" size={ICON_SIZE} color = {color} />
6290
),
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+
)
63100
}}
64101
/>
65102
<Tabs.Screen
66103
name="chatbot"
67104
options={{
68-
title:"",
105+
tabBarLabel: "Chat",
69106
tabBarIcon: ({ color }) => (
70107
<Entypo name="chat" size={ICON_SIZE} color = {color} />
71108
),
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+
)
72118
}}
73119
/>
74120
</Tabs>
75121
);
76122
}
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+
});

assets/images/aarti-logo.png

32.5 KB
Loading

assets/images/partial-react-logo.png

-4.96 KB
Binary file not shown.

assets/images/react-logo.png

-6.19 KB
Binary file not shown.

assets/images/react-logo@2x.png

-13.9 KB
Binary file not shown.

assets/images/react-logo@3x.png

-20.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)