mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-25 07:10:30 +01:00
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:
@@ -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(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
@@ -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<{
|
||||||
|
|||||||
Reference in New Issue
Block a user