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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
import { Tabs } from 'expo-router';
import { Feather } from '@expo/vector-icons';
import { MaterialIcons } from '@expo/vector-icons';
import theme from '@/theme';
// accesos cortos al theme de estilos
const { colors, typography, fontWeight, layout } = theme;
export default function TabsLayout() {
return (
<Tabs
screenOptions={{
headerShown: false,
tabBarActiveTintColor: colors.primary,
tabBarInactiveTintColor: colors.textSecondary,
tabBarLabelStyle: {
fontSize: typography.sm,
fontWeight: fontWeight.regular,
},
tabBarStyle: {
height: layout.tabBarHeight,
paddingBottom: 2,
paddingTop: 6,
// ancho acotado igual que el container del home
width: '100%',
maxWidth: layout.contentWidth,
alignSelf: 'center',
backgroundColor: colors.surface,
borderTopColor: colors.border,
},
}}
>
<Tabs.Screen
/* el nombre debe coincidir con la ruta para que expo router
lo detecte bien y muestre el tabBarLabel y en el orden declarado */
name="home"
options={{
title: 'Inicio',
tabBarLabel: 'Inicio',
tabBarIcon: ({ color, size }) => (
<Feather name="home" size={size} color={color} />
),
}}
/>
<Tabs.Screen
name="offices/index"
options={{
title: 'Espacios',
tabBarLabel: 'Espacios',
tabBarIcon: ({ color, size }) => (
<MaterialIcons name="apartment" size={size} color={color} />
),
}}
/>
<Tabs.Screen
name="reservations/index"
options={{
title: 'Reservas',
tabBarLabel: 'Reservas',
tabBarIcon: ({ color, size }) => (
<Feather name="calendar" size={size} color={color} />
),
}}
/>
<Tabs.Screen
name="profile/index"
options={{
title: 'Perfil',
tabBarLabel: 'Perfil',
tabBarIcon: ({ color, size }) => (
<Feather name="user" size={size} color={color} />
),
}}
/>
</Tabs>
);
}
|