From 084078d75a0317a4af7a7310786803778d1f2dca Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Sun, 27 Jul 2025 21:25:51 -0700 Subject: [PATCH] add febbox token example modal --- src/assets/locales/en.json | 8 + src/pages/onboarding/Onboarding.tsx | 243 +++++++++++-------- src/pages/parts/settings/ConnectionsPart.tsx | 229 +++++++++-------- 3 files changed, 276 insertions(+), 204 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index d598bcf7..10007e97 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -1105,6 +1105,14 @@ "4": "4. Copy the 'ui' cookie's value.", "5": "5. Close the tab, but do NOT logout!", "warning": "(Do not share this token!)" + }, + "tokenLabel": "Token", + "tokenExample": { + "button": "(Example)", + "title": "Example Token", + "description": "This is what a Febbox UI token looks like:", + "warning": "Don't try to use, it's fake.", + "close": "Got it" } }, "status": { diff --git a/src/pages/onboarding/Onboarding.tsx b/src/pages/onboarding/Onboarding.tsx index 439d9914..0a6b7e14 100644 --- a/src/pages/onboarding/Onboarding.tsx +++ b/src/pages/onboarding/Onboarding.tsx @@ -62,6 +62,7 @@ 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( @@ -108,116 +109,148 @@ export function FEDAPISetup() { if (conf().ALLOW_FEBBOX_KEY) { return ( -
- -
-
-

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

-

- -

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

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

- {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 ? ( - - ) : ( - + +

+
+
+ +
+
+ {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 && ( + <> +
+