Add HIDE_PROXY_ONBOARDING config and onboarding UI updates

Introduces the HIDE_PROXY_ONBOARDING config option to conditionally hide proxy onboarding steps in the UI. Updates OnboardingPage to use this config for rendering logic and adjusts card layouts accordingly. Also adds support for displaying additional sources heading when relevant, and updates English locale strings for clarity.
This commit is contained in:
Pas 2025-12-03 18:33:55 -07:00
parent 0576c9fed0
commit bf359916b6
3 changed files with 58 additions and 35 deletions

View file

@ -610,7 +610,7 @@
"defaultDescription": "Uses P-Stream's built-in proxy. It's the easiest option but might be slower due to shared bandwidth.",
"fedapi": {
"fedapi": "Additional: Febbox token",
"fedapiDescription": "Bring your own FREE Febbox account to gain access to FED API and CIA API, the best sources with 4K quality, Dolby Atmos, skip intro and the fastest load times! Highly recommended option!"
"fedapiDescription": "Bring your own FREE Febbox account to gain access to FED API, the best sources with 4K quality, Dolby Atmos, skip intro and the fastest load times! Highly recommended option!"
},
"outro": "If you have more questions on how this works, feel free to ask on the <0>P-Stream Discord</0> server!"
},
@ -647,6 +647,9 @@
"description": "Setup a free proxy in just 5 minutes! Improves loading reliability!",
"quality": "Good quality",
"title": "Custom proxy"
},
"addons": {
"title": "Additional sources:"
}
},
"title": "Let's get you setup with P-Stream 🥳"
@ -1248,7 +1251,7 @@
"fedapi": {
"onboarding": {
"title": "Febbox token",
"description": "Bring your own FREE Febbox account to gain access to FED API and CIA API, the best sources with 4K quality, Dolby Atmos, skip intro and the fastest load times! Highly recommended option!"
"description": "Bring your own FREE Febbox account to gain access to FED API, the best sources with 4K quality, Dolby Atmos, skip intro and the fastest load times! Highly recommended option!"
},
"setup": {
"title": "To get your UI token:",

View file

@ -1,3 +1,4 @@
import classNames from "classnames";
import { Trans, useTranslation } from "react-i18next";
import { Button } from "@/components/buttons/Button";
@ -179,7 +180,9 @@ export function OnboardingPage() {
<div className="hidden md:flex w-full flex-col md:flex-row gap-3 pb-6">
<Card
onClick={() => navigate("/onboarding/extension")}
className="md:w-1/3"
className={classNames(
conf().HIDE_PROXY_ONBOARDING ? "md:w-1/2" : "md:w-1/3",
)}
>
<CardContent
colorClass="!text-onboarding-best"
@ -192,26 +195,30 @@ export function OnboardingPage() {
</Link>
</CardContent>
</Card>
<div className="hidden md:grid grid-rows-[1fr,auto,1fr] justify-center gap-4">
<VerticalLine className="items-end" />
<span className="text-xs uppercase font-bold">
{t("onboarding.start.options.or")}
</span>
<VerticalLine />
</div>
<Card
onClick={() => navigate("/onboarding/proxy")}
className="md:w-1/3"
>
<CardContent
colorClass="!text-onboarding-good"
title={t("onboarding.start.options.proxy.title")}
subtitle={t("onboarding.start.options.proxy.quality")}
description={t("onboarding.start.options.proxy.description")}
>
<Link>{t("onboarding.start.options.proxy.action")}</Link>
</CardContent>
</Card>
{conf().HIDE_PROXY_ONBOARDING ? null : (
<>
<div className="hidden md:grid grid-rows-[1fr,auto,1fr] justify-center gap-4">
<VerticalLine className="items-end" />
<span className="text-xs uppercase font-bold">
{t("onboarding.start.options.or")}
</span>
<VerticalLine />
</div>
<Card
onClick={() => navigate("/onboarding/proxy")}
className="md:w-1/3"
>
<CardContent
colorClass="!text-onboarding-good"
title={t("onboarding.start.options.proxy.title")}
subtitle={t("onboarding.start.options.proxy.quality")}
description={t("onboarding.start.options.proxy.description")}
>
<Link>{t("onboarding.start.options.proxy.action")}</Link>
</CardContent>
</Card>
</>
)}
{noProxies ? null : (
<>
<div className="hidden md:grid grid-rows-[1fr,auto,1fr] justify-center gap-4">
@ -227,7 +234,9 @@ export function OnboardingPage() {
? () => completeAndRedirect() // Skip modal on Safari
: skipModal.show // Show modal on other browsers
}
className="md:w-1/3"
className={classNames(
conf().HIDE_PROXY_ONBOARDING ? "md:w-1/2" : "md:w-1/3",
)}
>
<CardContent
colorClass="!text-onboarding-bad"
@ -255,17 +264,19 @@ export function OnboardingPage() {
description={t("onboarding.start.options.extension.description")}
/>
</Card>
<Card
onClick={() => navigate("/onboarding/proxy")}
className="md:w-1/3"
>
<MiniCardContent
colorClass="!text-onboarding-good"
title={t("onboarding.start.options.proxy.title")}
subtitle={t("onboarding.start.options.proxy.quality")}
description={t("onboarding.start.options.proxy.description")}
/>
</Card>
{conf().HIDE_PROXY_ONBOARDING ? null : (
<Card
onClick={() => navigate("/onboarding/proxy")}
className="md:w-1/3"
>
<MiniCardContent
colorClass="!text-onboarding-good"
title={t("onboarding.start.options.proxy.title")}
subtitle={t("onboarding.start.options.proxy.quality")}
description={t("onboarding.start.options.proxy.description")}
/>
</Card>
)}
{noProxies ? null : (
<Card
onClick={
@ -285,6 +296,11 @@ export function OnboardingPage() {
)}
</div>
{(conf().ALLOW_FEBBOX_KEY || conf().ALLOW_DEBRID_KEY) === true && (
<Heading3 className="text-white font-bold mb-3 mt-6">
{t("onboarding.start.options.addons.title")}
</Heading3>
)}
<div className="mt-6">
<FebboxSetup
febboxKey={usePreferencesStore((s) => s.febboxKey)}

View file

@ -33,6 +33,7 @@ interface Config {
BANNER_MESSAGE: string;
BANNER_ID: string;
USE_TRAKT: boolean;
HIDE_PROXY_ONBOARDING: boolean;
}
export interface RuntimeConfig {
@ -62,6 +63,7 @@ export interface RuntimeConfig {
BANNER_MESSAGE: string | null;
BANNER_ID: string | null;
USE_TRAKT: boolean;
HIDE_PROXY_ONBOARDING: boolean;
}
const env: Record<keyof Config, undefined | string> = {
@ -94,6 +96,7 @@ const env: Record<keyof Config, undefined | string> = {
BANNER_MESSAGE: import.meta.env.VITE_BANNER_MESSAGE,
BANNER_ID: import.meta.env.VITE_BANNER_ID,
USE_TRAKT: import.meta.env.VITE_USE_TRAKT,
HIDE_PROXY_ONBOARDING: import.meta.env.VITE_HIDE_PROXY_ONBOARDING,
};
function coerceUndefined(value: string | null | undefined): string | undefined {
@ -169,5 +172,6 @@ export function conf(): RuntimeConfig {
BANNER_MESSAGE: getKey("BANNER_MESSAGE"),
BANNER_ID: getKey("BANNER_ID"),
USE_TRAKT: getKey("USE_TRAKT", "false") === "true",
HIDE_PROXY_ONBOARDING: getKey("HIDE_PROXY_ONBOARDING", "false") === "true",
};
}