import type { BottomTabBarProps } from 'expo-router/tabs'; import { LinearGradient } from 'expo-linear-gradient'; import { Pressable, View } from 'react-native'; import { Text } from '@/components/text'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useCSSVariable } from 'uniwind'; import { TabIcon, type TabName } from '@/components/svg'; import { useSky } from '@/lib/sky'; const LABELS: Record = { sky: ['sky', '노을'], gak: ['gak', '각'], index: ['today', '오늘'], week: ['week', '주말·행사'], season: ['season', '계절·상식'], }; /** 아래 탭 막대. 가운데 오늘 탭은 막대 위로 솟은 큰 주황 동그라미 */ export function TabBar({ state, navigation }: BottomTabBarProps) { const { bottom } = useSafeAreaInsets(); const { kind } = useSky(); const [ink, ink3, orange] = useCSSVariable(['--color-ink', '--color-ink3', '--color-orange']).map(String); const night = kind === 'night'; return ( {state.routes.map((route, i) => { const [icon, label] = LABELS[route.name] ?? ['today', route.name]; const focused = state.index === i; const onPress = () => { const event = navigation.emit({ type: 'tabPress', target: route.key, canPreventDefault: true }); if (!focused && !event.defaultPrevented) navigation.navigate(route.name); }; if (icon === 'today') return ( {label} ); return ( {label} ); })} ); }