Files
streamyfin/components/tv/settings/TVLogoutButton.tsx
Lance Chant 03f17a758f chore: updated usage of tv scaling, alert text fix
Sweep across a few pages to ensure they use the scaling factors now
Added a plugin to fix the alert text on android tv

Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
2026-05-22 15:00:13 +02:00

66 lines
1.8 KiB
TypeScript

import React from "react";
import { useTranslation } from "react-i18next";
import { Animated, Pressable, View } from "react-native";
import { Text } from "@/components/common/Text";
import { useScaledTVTypography } from "@/constants/TVTypography";
import { scaleSize } from "@/utils/scaleSize";
import { useTVFocusAnimation } from "../hooks/useTVFocusAnimation";
export interface TVLogoutButtonProps {
onPress: () => void;
disabled?: boolean;
}
export const TVLogoutButton: React.FC<TVLogoutButtonProps> = ({
onPress,
disabled,
}) => {
const { t } = useTranslation();
const typography = useScaledTVTypography();
const { focused, handleFocus, handleBlur, animatedStyle } =
useTVFocusAnimation({ scaleAmount: 1.05 });
return (
<Pressable
onPress={onPress}
onFocus={handleFocus}
onBlur={handleBlur}
disabled={disabled}
focusable={!disabled}
>
<Animated.View
style={[
animatedStyle,
{
shadowColor: "#ef4444",
shadowOffset: { width: 0, height: 0 },
shadowOpacity: focused ? 0.6 : 0,
shadowRadius: focused ? 20 : 0,
},
]}
>
<View
style={{
backgroundColor: focused ? "#ef4444" : "rgba(239, 68, 68, 0.8)",
borderRadius: scaleSize(12),
paddingVertical: scaleSize(18),
paddingHorizontal: scaleSize(48),
alignItems: "center",
justifyContent: "center",
}}
>
<Text
style={{
fontSize: typography.body,
fontWeight: "bold",
color: "#FFFFFF",
}}
>
{t("home.settings.log_out_button")}
</Text>
</View>
</Animated.View>
</Pressable>
);
};