@@ -3,7 +3,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
33import { Link } from "expo-router";
44import { Drawer } from "expo-router/drawer";
55import { useThemeColor } from "heroui-native";
6- import { Pressable } from "react-native";
6+ import { Pressable, Text } from "react-native";
77import { ThemeToggle } from "@/components/theme-toggle";
88
99function DrawerLayout() {
@@ -29,19 +29,23 @@ function DrawerLayout() {
2929 name =" index"
3030 options = \{{
3131 headerTitle : " Home" ,
32- drawerLabel : " Home" ,
33- drawerIcon : ({ size , color }) => (
34- <Ionicons name =" home-outline" size = {size } color = {color } />
32+ drawerLabel : ({ color , focused }) => (
33+ <Text style = {{ color : focused ? color : themeColorForeground }} >Home</Text >
34+ ),
35+ drawerIcon: ({ size, color, focused }) => (
36+ <Ionicons name =" home-outline" size = {size} color = {focused ? color : themeColorForeground} />
3537 ),
3638 }}
3739 />
3840 <Drawer .Screen
3941 name =" (tabs)"
4042 options = \{{
4143 headerTitle : " Tabs" ,
42- drawerLabel : " Tabs" ,
43- drawerIcon : ({ size , color }) => (
44- <MaterialIcons name =" border-bottom" size = {size } color = {color } />
44+ drawerLabel : ({ color , focused }) => (
45+ <Text style = {{ color : focused ? color : themeColorForeground }} >Tabs</Text >
46+ ),
47+ drawerIcon: ({ size, color, focused }) => (
48+ <MaterialIcons name =" border-bottom" size = {size} color = {focused ? color : themeColorForeground} />
4549 ),
4650 headerRight: () => (
4751 <Link href =" /modal" asChild>
@@ -57,9 +61,11 @@ function DrawerLayout() {
5761 name =" todos"
5862 options = \{{
5963 headerTitle : " Todos" ,
60- drawerLabel : " Todos" ,
61- drawerIcon : ({ size , color }) => (
62- <Ionicons name =" checkbox-outline" size = {size } color = {color } />
64+ drawerLabel : ({ color , focused }) => (
65+ <Text style = {{ color : focused ? color : themeColorForeground }} >Todos</Text >
66+ ),
67+ drawerIcon: ({ size, color, focused }) => (
68+ <Ionicons name =" checkbox-outline" size = {size} color = {focused ? color : themeColorForeground} />
6369 ),
6470 }}
6571 />
@@ -69,9 +75,11 @@ function DrawerLayout() {
6975 name =" ai"
7076 options = \{{
7177 headerTitle : " AI" ,
72- drawerLabel : " AI" ,
73- drawerIcon : ({ size , color }) => (
74- <Ionicons name =" chatbubble-ellipses-outline" size = {size } color = {color } />
78+ drawerLabel : ({ color , focused }) => (
79+ <Text style = {{ color : focused ? color : themeColorForeground }} >AI</Text >
80+ ),
81+ drawerIcon: ({ size, color, focused }) => (
82+ <Ionicons name =" chatbubble-ellipses-outline" size = {size} color = {focused ? color : themeColorForeground} />
7583 ),
7684 }}
7785 />
0 commit comments