From b20b183545477098743be7fd9152cfc3114bd9c4 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Tue, 28 Oct 2025 17:27:01 -0600 Subject: [PATCH] fix febbox input not fitting on mobile --- src/pages/onboarding/Onboarding.tsx | 220 +------------------ src/pages/parts/settings/ConnectionsPart.tsx | 101 +++++++-- 2 files changed, 86 insertions(+), 235 deletions(-) diff --git a/src/pages/onboarding/Onboarding.tsx b/src/pages/onboarding/Onboarding.tsx index 99105f87..b45eab04 100644 --- a/src/pages/onboarding/Onboarding.tsx +++ b/src/pages/onboarding/Onboarding.tsx @@ -18,7 +18,6 @@ import { StatusCircle, StatusCircleProps, } from "@/components/player/internals/StatusCircle"; -import { MwLink } from "@/components/text/Link"; import { AuthInputBox } from "@/components/text-inputs/AuthInputBox"; import { Divider } from "@/components/utils/Divider"; import { Ol } from "@/components/utils/Ol"; @@ -44,215 +43,8 @@ import { conf } from "@/setup/config"; import { usePreferencesStore } from "@/stores/preferences"; import { getProxyUrls } from "@/utils/proxyUrls"; -import { RegionSelectorPart } from "../parts/settings/RegionSelectorPart"; -import { - Status, - testFebboxKey, - testRealDebridKey, -} from "../parts/settings/SetupPart"; - -async function getFebboxKeyStatus(febboxKey: string | null) { - if (febboxKey) { - const status: Status = await testFebboxKey(febboxKey); - return status; - } - return "unset"; -} - -export function FEDAPISetup() { - const { t } = useTranslation(); - const febboxKey = usePreferencesStore((s) => s.febboxKey); - const setFebboxKey = usePreferencesStore((s) => s.setFebboxKey); - const exampleModal = useModal("febbox-example"); - - // Initialize isExpanded based on whether febboxKey has a value - const [isExpanded, setIsExpanded] = useState( - febboxKey !== null && febboxKey !== "", - ); - - // Add a separate effect to set the initial state - useEffect(() => { - // If we have a valid key, make sure the section is expanded - if (febboxKey && febboxKey.length > 0) { - setIsExpanded(true); - } - }, [febboxKey]); - - const [status, setStatus] = useState("unset"); - const statusMap: Record = { - error: "error", - success: "success", - unset: "noresult", - api_down: "error", - invalid_token: "error", - }; - - useEffect(() => { - const checkTokenStatus = async () => { - const result = await getFebboxKeyStatus(febboxKey); - setStatus(result); - }; - checkTokenStatus(); - }, [febboxKey]); - - // Toggle handler that preserves the key - const toggleExpanded = () => { - if (isExpanded) { - // Store the key temporarily instead of setting to null - setFebboxKey(""); - setIsExpanded(false); - } else { - setIsExpanded(true); - } - }; - - const [showVideo, setShowVideo] = useState(false); - - if (conf().ALLOW_FEBBOX_KEY) { - return ( - <> -
- -
-
-

- {t("fedapi.onboarding.title")} -

-

- -

-
-
- -
-
- {isExpanded ? ( - <> - - -
-

- {t("fedapi.setup.title")} -
-

setShowVideo(!showVideo)} - className="flex items-center justify-between p-1 px-2 my-2 w-fit border border-type-secondary rounded-lg cursor-pointer text-type-secondary hover:text-white transition-colors duration-200" - > - - {showVideo - ? t("fedapi.setup.hideVideo") - : t("fedapi.setup.showVideo")} - - {showVideo ? ( - - ) : ( - - )} -
- {showVideo && ( - <> -
-