@@ -3,10 +3,15 @@ import { Text } from "react-native";
33import { SafeAreaView } from "react-native-safe-area-context" ;
44
55import { HapticTab } from "@/components/HapticTab" ;
6- import { TabColors } from "@/constants/Colors" ;
76import { ROUTES } from "@/constants/Routes" ;
87import { TAB_SCREENS } from "@/constants/TabScreens" ;
98
9+ const TabColors = {
10+ active : "#6C4DFF" ,
11+ inactive : "#424242" ,
12+ inactiveText : "#767676" ,
13+ } ;
14+
1015export default function TabLayout ( ) {
1116 const pathname = usePathname ( ) ;
1217
@@ -16,19 +21,16 @@ export default function TabLayout() {
1621 // activeGroup이 정의된 경우, 해당 그룹 경로로 시작하는지 확인
1722 return pathname ?. startsWith ( `/${ screen . activePage } ` ) ;
1823 } else if ( screen . name === "index" ) {
19- // 홈 탭은 홈 페이지이거나 detail 페이지에 있을 때 활성화
20- return pathname === ROUTES . HOME || pathname ?. includes ( "/detail/" ) ;
24+ // 홈 페이지에 있을 때 활성화
25+ return pathname === ROUTES . HOME ;
2126 } else {
2227 // activeGroup이 없는 경우, 해당 탭 경로와 정확히 일치하는지 확인
2328 return pathname === `/${ screen . name } ` ;
2429 }
2530 } ;
2631
2732 return (
28- < SafeAreaView
29- style = { { flex : 1 , backgroundColor : "#ffffff" } }
30- edges = { [ "bottom" ] }
31- >
33+ < SafeAreaView className = "flex-1 bg-white" edges = { [ "bottom" ] } >
3234 < Tabs
3335 screenOptions = { {
3436 headerShown : false ,
@@ -37,6 +39,13 @@ export default function TabLayout() {
3739 paddingBottom : 10 ,
3840 paddingTop : 5 ,
3941 height : 60 ,
42+ backgroundColor : "white" ,
43+ borderTopWidth : 0 , // 기존 border 제거
44+ shadowColor : "#575757" ,
45+ shadowOffset : { width : 0 , height : - 2 } ,
46+ shadowOpacity : 0.05 ,
47+ shadowRadius : 4 ,
48+ elevation : 4 , // Android를 위한 shadow
4049 } ,
4150 tabBarIconStyle : {
4251 marginBottom : 3 ,
@@ -71,13 +80,30 @@ export default function TabLayout() {
7180 const color = isActive
7281 ? TabColors . active
7382 : TabColors . inactive ;
74- return < screen . Icon color = { color } size = { size } /> ;
83+ const iconSize = 28 ; // 아이콘 크기를 28로 고정
84+
85+ // 홈, 일정, 마이페이지 아이콘의 경우 isActive prop 추가
86+ if (
87+ screen . name === "index" ||
88+ screen . name === "schedule" ||
89+ screen . name === "my/index"
90+ ) {
91+ return (
92+ < screen . Icon
93+ color = { color }
94+ size = { iconSize }
95+ isActive = { isActive }
96+ />
97+ ) ;
98+ }
99+
100+ return < screen . Icon color = { color } size = { iconSize } /> ;
75101 } ,
76102 tabBarLabel : ( { focused } ) => {
77103 const isActive = isTabActive ( screen ) ;
78104 const color = isActive
79105 ? TabColors . active
80- : TabColors . inactive ;
106+ : TabColors . inactiveText ;
81107 return (
82108 < Text
83109 style = { {
0 commit comments