Addressing code rabbit comments

Fixed some issues code rabbit raised

Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
Lance Chant
2026-06-24 14:53:31 +02:00
parent 25d7b17fcd
commit 3d93c2cecb
2 changed files with 12 additions and 4 deletions

View File

@@ -50,7 +50,8 @@ function TVTabLayout() {
const router = useRouter(); const router = useRouter();
const currentTab = segments.find(isTabRoute); 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( const tabs: TVNavBarTab[] = useMemo(
() => () =>

View File

@@ -1,11 +1,18 @@
import React from "react"; 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 { useSafeAreaInsets } from "react-native-safe-area-context";
import { Text } from "@/components/common/Text"; import { Text } from "@/components/common/Text";
import { useTVFocusAnimation } from "@/components/tv/hooks/useTVFocusAnimation";
import { TVPadding } from "@/constants/TVSizes"; import { TVPadding } from "@/constants/TVSizes";
import { useScaledTVTypography } from "@/constants/TVTypography"; import { useScaledTVTypography } from "@/constants/TVTypography";
import { scaleSize } from "@/utils/scaleSize"; import { scaleSize } from "@/utils/scaleSize";
import { useTVFocusAnimation } from "./hooks/useTVFocusAnimation";
export interface TVNavBarTab { export interface TVNavBarTab {
key: string; key: string;
@@ -16,7 +23,7 @@ export interface TVNavBarProps {
tabs: TVNavBarTab[]; tabs: TVNavBarTab[];
activeTabKey: string; activeTabKey: string;
onTabChange: (key: string) => void; onTabChange: (key: string) => void;
style?: ViewStyleProp; style?: StyleProp<ViewStyle>;
} }
const TVNavBarTabItem: React.FC<{ const TVNavBarTabItem: React.FC<{