diff --git a/js/web/src/routes/settings.tsx b/js/web/src/routes/settings.tsx index 7b0182cb..b7a1d67a 100644 --- a/js/web/src/routes/settings.tsx +++ b/js/web/src/routes/settings.tsx @@ -1,13 +1,58 @@ -import { createFileRoute, Outlet } from "@tanstack/react-router"; +import { cn } from "@/lib/utils"; +import { createFileRoute, Link, Outlet } from "@tanstack/react-router"; +import { Globe, Info, Lock, Shield, User2, Video } from "lucide-react"; +import { useTranslation } from "react-i18next"; + +const NAV_ITEMS = [ + { to: "/settings/account", icon: User2, labelKey: "account" }, + { to: "/settings/streaming", icon: Video, labelKey: "streaming" }, + { to: "/settings/privacy", icon: Shield, labelKey: "privacy-security" }, + { to: "/settings/languages", icon: Globe, labelKey: "languages" }, + { to: "/settings/advanced", icon: Lock, labelKey: "advanced" }, + { to: "/settings/about", icon: Info, labelKey: "about" }, +] as const; export const Route = createFileRoute("/settings")({ component: SettingsLayout, }); function SettingsLayout() { + const { t } = useTranslation("settings"); + return ( -
- +
+

+ {t("settings-title")} +

+ + + +
+ +
); } diff --git a/js/web/src/routes/settings/about.tsx b/js/web/src/routes/settings/about.tsx index 2d4e95fa..4d213d98 100644 --- a/js/web/src/routes/settings/about.tsx +++ b/js/web/src/routes/settings/about.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { CardMenuSection } from "@/components/ui/card"; import { createFileRoute } from "@tanstack/react-router"; import { useState } from "react"; @@ -32,7 +31,6 @@ function AboutSettings() { return (
-

{t("about")}

diff --git a/js/web/src/routes/settings/account.tsx b/js/web/src/routes/settings/account.tsx index 761cf5f0..262fa810 100644 --- a/js/web/src/routes/settings/account.tsx +++ b/js/web/src/routes/settings/account.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { CardMenuSection } from "@/components/ui/card"; import { createFileRoute, Link, useNavigate } from "@tanstack/react-router"; import { LogOut } from "lucide-react"; @@ -19,7 +18,6 @@ function AccountSettings() { if (state.status !== "authenticated" || !userProfile) { return (
-
Please log in to access this page.
@@ -29,8 +27,6 @@ function AccountSettings() { return (
- - {/* Profile header */}
{userProfile.avatar && ( diff --git a/js/web/src/routes/settings/advanced.tsx b/js/web/src/routes/settings/advanced.tsx index 49e755b4..dc2adee9 100644 --- a/js/web/src/routes/settings/advanced.tsx +++ b/js/web/src/routes/settings/advanced.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Card, CardRow } from "@/components/ui/card"; import { Switch } from "@/components/ui/switch"; import { createFileRoute } from "@tanstack/react-router"; @@ -41,7 +40,6 @@ function AdvancedSettings() { return (
-

{t("advanced")}

diff --git a/js/web/src/routes/settings/backup.tsx b/js/web/src/routes/settings/backup.tsx index 4411aea5..0d75fbb1 100644 --- a/js/web/src/routes/settings/backup.tsx +++ b/js/web/src/routes/settings/backup.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; @@ -165,8 +164,6 @@ function BackupSettings() { return (
- -

{t("backup")}

{loading ? ( diff --git a/js/web/src/routes/settings/badge-issuer.tsx b/js/web/src/routes/settings/badge-issuer.tsx index d7e3a0d9..001d18af 100644 --- a/js/web/src/routes/settings/badge-issuer.tsx +++ b/js/web/src/routes/settings/badge-issuer.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { createFileRoute } from "@tanstack/react-router"; @@ -346,8 +345,6 @@ function BadgeIssuerPanel() { // Main view return (
- -

{t("issue-badges-manage-description")}

diff --git a/js/web/src/routes/settings/badges.tsx b/js/web/src/routes/settings/badges.tsx index 08d2f9b4..fad6892f 100644 --- a/js/web/src/routes/settings/badges.tsx +++ b/js/web/src/routes/settings/badges.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { createFileRoute } from "@tanstack/react-router"; import { Check } from "lucide-react"; import { useCallback, useEffect, useRef, useState } from "react"; @@ -162,8 +161,6 @@ function BadgeSelectionManager() { return (
- -

{t("badges")}

{loading ? ( diff --git a/js/web/src/routes/settings/branding.tsx b/js/web/src/routes/settings/branding.tsx index 466f6dd3..130eb1e9 100644 --- a/js/web/src/routes/settings/branding.tsx +++ b/js/web/src/routes/settings/branding.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { createFileRoute } from "@tanstack/react-router"; @@ -153,8 +152,6 @@ function BrandingAdmin() { return (
- -

{t("branding-admin")}

diff --git a/js/web/src/routes/settings/index.tsx b/js/web/src/routes/settings/index.tsx index 23a2fddd..5ee24e02 100644 --- a/js/web/src/routes/settings/index.tsx +++ b/js/web/src/routes/settings/index.tsx @@ -1,132 +1,5 @@ -import { CardMenuSection } from "@/components/ui/card"; -import { createFileRoute, Link } from "@tanstack/react-router"; -import { Globe, Info, Lock, Shield, User2, Video } from "lucide-react"; -import { useTranslation } from "react-i18next"; -import { EMPTY_LOGIN_SEARCH } from "../../lib/login-search"; -import { useSession } from "../../lib/session"; +import { createFileRoute, Navigate } from "@tanstack/react-router"; export const Route = createFileRoute("/settings/")({ - component: SettingsIndex, + component: () => , }); - -interface CategoryLinkProps { - to: string; - icon: React.ComponentType<{ size?: number; className?: string }>; - label: string; -} - -function CategoryLink({ to, icon: Icon, label }: CategoryLinkProps) { - return ( - -

- - {label} -
- - - - - ); -} - -function SettingsIndex() { - const { t } = useTranslation("settings"); - const { state, signOut } = useSession(); - const isLoggedIn = state.status === "authenticated"; - - return ( -
-
-

{t("settings-title")}

-
- - {/* Account status */} - -
-
- {state.status === "authenticated" ? ( - <> - Signed in as{" "} - {state.session.did} - - ) : state.status === "loading" ? ( - Checking… - ) : ( - - Not signed in - - )} -
- {state.status === "authenticated" ? ( - - ) : ( - - {t("sign-in")} - - )} -
-
- - {isLoggedIn && ( - - - - - - )} - - - - - - -
- ); -} diff --git a/js/web/src/routes/settings/keys.tsx b/js/web/src/routes/settings/keys.tsx index d97f6f51..90a1dade 100644 --- a/js/web/src/routes/settings/keys.tsx +++ b/js/web/src/routes/settings/keys.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { createFileRoute } from "@tanstack/react-router"; import { X } from "lucide-react"; import { useEffect, useState } from "react"; @@ -57,8 +56,6 @@ function KeyManager() { return (
- -

{t("key-manager")}

{keyRecords === null || keyObj === null ? ( diff --git a/js/web/src/routes/settings/languages.tsx b/js/web/src/routes/settings/languages.tsx index 1e7617cd..23eef6d8 100644 --- a/js/web/src/routes/settings/languages.tsx +++ b/js/web/src/routes/settings/languages.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { CardMenuSection } from "@/components/ui/card"; import { manifest } from "@streamplace/i18n"; import { createFileRoute } from "@tanstack/react-router"; @@ -27,8 +26,6 @@ function LanguagesSettings() { return (
- -

{t("language-selection")}

diff --git a/js/web/src/routes/settings/multistream.tsx b/js/web/src/routes/settings/multistream.tsx index 37ac5a0d..df955e73 100644 --- a/js/web/src/routes/settings/multistream.tsx +++ b/js/web/src/routes/settings/multistream.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -206,8 +205,6 @@ function MultistreamManager() { return (

- -

{t("multistream-targets")}

diff --git a/js/web/src/routes/settings/privacy.tsx b/js/web/src/routes/settings/privacy.tsx index 8cacfc9b..0c0d783e 100644 --- a/js/web/src/routes/settings/privacy.tsx +++ b/js/web/src/routes/settings/privacy.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Card, CardRow } from "@/components/ui/card"; import { Switch } from "@/components/ui/switch"; import { createFileRoute } from "@tanstack/react-router"; @@ -34,7 +33,6 @@ function PrivacySettings() { return (

-

{t("privacy-security")}

diff --git a/js/web/src/routes/settings/recommendations.tsx b/js/web/src/routes/settings/recommendations.tsx index 04dd78fc..2cb91eda 100644 --- a/js/web/src/routes/settings/recommendations.tsx +++ b/js/web/src/routes/settings/recommendations.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -225,8 +224,6 @@ function RecommendationsManager() { return (
- -

diff --git a/js/web/src/routes/settings/streaming.tsx b/js/web/src/routes/settings/streaming.tsx index 488842b4..1f0c3ebd 100644 --- a/js/web/src/routes/settings/streaming.tsx +++ b/js/web/src/routes/settings/streaming.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { CardMenuSection } from "@/components/ui/card"; import { createFileRoute, Link } from "@tanstack/react-router"; import { Globe, Heart, Key, Webhook } from "lucide-react"; @@ -60,7 +59,6 @@ function StreamingSettings() { return (
-

{t("streaming")}

diff --git a/js/web/src/routes/settings/webhooks.tsx b/js/web/src/routes/settings/webhooks.tsx index 7d8cb8f5..a42d7436 100644 --- a/js/web/src/routes/settings/webhooks.tsx +++ b/js/web/src/routes/settings/webhooks.tsx @@ -1,4 +1,3 @@ -import { BackLink } from "@/components/settings/back-link"; import { Button } from "@/components/ui/button"; import { CardMenuSection } from "@/components/ui/card"; import { @@ -169,8 +168,6 @@ function WebhookManager() { return (
- -

{t("webhook-integrations")}