From 3d93c2cecb400aaf38ab68e6ba2a67958cbec35d Mon Sep 17 00:00:00 2001 From: Lance Chant <13349722+lancechant@users.noreply.github.com> Date: Wed, 24 Jun 2026 14:53:31 +0200 Subject: [PATCH] Addressing code rabbit comments Fixed some issues code rabbit raised Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> --- app/(auth)/(tabs)/_layout.tsx | 3 ++- components/tv/TVNavBar.tsx | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/(auth)/(tabs)/_layout.tsx b/app/(auth)/(tabs)/_layout.tsx index e94e7b4f..45f246a5 100644 --- a/app/(auth)/(tabs)/_layout.tsx +++ b/app/(auth)/(tabs)/_layout.tsx @@ -50,7 +50,8 @@ function TVTabLayout() { const router = useRouter(); const currentTab = segments.find(isTabRoute); - const atTabRoot = isTabRoute(segments[segments.length - 1] ?? ""); + const lastSegment = segments[segments.length - 1] ?? ""; + const atTabRoot = isTabRoute(lastSegment) || lastSegment === "index"; const tabs: TVNavBarTab[] = useMemo( () => diff --git a/components/tv/TVNavBar.tsx b/components/tv/TVNavBar.tsx index abf39ff5..759c283a 100644 --- a/components/tv/TVNavBar.tsx +++ b/components/tv/TVNavBar.tsx @@ -1,11 +1,18 @@ import React from "react"; -import { Animated, Pressable, ScrollView, View } from "react-native"; +import { + Animated, + Pressable, + ScrollView, + StyleProp, + View, + ViewStyle, +} from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Text } from "@/components/common/Text"; +import { useTVFocusAnimation } from "@/components/tv/hooks/useTVFocusAnimation"; import { TVPadding } from "@/constants/TVSizes"; import { useScaledTVTypography } from "@/constants/TVTypography"; import { scaleSize } from "@/utils/scaleSize"; -import { useTVFocusAnimation } from "./hooks/useTVFocusAnimation"; export interface TVNavBarTab { key: string; @@ -16,7 +23,7 @@ export interface TVNavBarProps { tabs: TVNavBarTab[]; activeTabKey: string; onTabChange: (key: string) => void; - style?: ViewStyleProp; + style?: StyleProp; } const TVNavBarTabItem: React.FC<{