chore: moved constant values to a file

Reduced duplication and removed constants to a new file

Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
Lance Chant
2025-09-20 13:03:07 +02:00
parent 621d164402
commit 388f65b443
5 changed files with 53 additions and 98 deletions

View File

@@ -40,7 +40,6 @@ export const StorageSettings = () => {
};
const calculatePercentage = (value: number, total: number) => {
console.log("usage", value, total);
return ((value / total) * 100).toFixed(2);
};

View File

@@ -18,31 +18,7 @@ import { useMedia } from "./MediaContext";
interface Props extends ViewProps {}
const VLC_COLORS = {
Black: 0,
Gray: 8421504,
Silver: 12632256,
White: 16777215,
Maroon: 8388608,
Red: 16711680,
Fuchsia: 16711935,
Yellow: 16776960,
Olive: 8421376,
Green: 32768,
Teal: 32896,
Lime: 65280,
Purple: 8388736,
Navy: 128,
Blue: 255,
Aqua: 65535,
};
const OUTLINE_THICKNESS = {
None: 0,
Thin: 2,
Normal: 4,
Thick: 6,
};
import { OUTLINE_THICKNESS, VLC_COLORS } from "@/constants/SubtitleConstants";
export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
const isTv = Platform.isTV;

View File

@@ -3,34 +3,9 @@ import { useEffect, useState } from "react";
import { View } from "react-native";
import { ListGroup } from "@/components/list/ListGroup";
import { ListItem } from "@/components/list/ListItem";
import { OUTLINE_THICKNESS, VLC_COLORS } from "@/constants/SubtitleConstants";
import { storage } from "@/utils/mmkv";
const VLC_COLORS = {
Black: 0,
Gray: 8421504,
Silver: 12632256,
White: 16777215,
Maroon: 8388608,
Red: 16711680,
Fuchsia: 16711935,
Yellow: 16776960,
Olive: 8421376,
Green: 32768,
Teal: 32896,
Lime: 65280,
Purple: 8388736,
Navy: 128,
Blue: 255,
Aqua: 65535,
};
const OUTLINE_THICKNESS = {
None: 0,
Thin: 2,
Normal: 4,
Thick: 6,
};
export function VLCSubtitleSettings({
className = "",
}: {