diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 5658722..688a049 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -34,6 +34,7 @@ import Toaster from "./components/Toaster"; import About from "./components/About"; import ReleaseNotes from "./components/ReleaseNotes"; import VersionBanner from "./components/VersionBanner"; +import DemoBanner from "./components/DemoBanner"; import { CURRENT_VERSION } from "./lib/releaseNotes"; const DEFAULT_FILTERS: FeedFilters = { @@ -190,15 +191,10 @@ export default function App() { }); } // The demo account is shared: there are no subscriptions, so default it to the whole - // library (the "my" feed would be empty), and warn that its state is communal. + // library (the "my" feed would be empty). The communal-state warning is a permanent + // banner (see DemoBanner below), not a toast that re-pops on every reload. if (meQuery.data?.is_demo) { setFilters({ ...loadStoredFilters(), scope: "all" }); - notify({ - level: "warning", - title: t("common.demoTitle"), - message: t("common.demoSharedNotice"), - requiresInteraction: true, - }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [meQuery.data?.id]); @@ -250,6 +246,7 @@ export default function App() { setPage("channels"); }} /> + {meQuery.data!.is_demo && } openReleaseNotes(CURRENT_VERSION)} />
{page === "feed" && ( diff --git a/frontend/src/components/DemoBanner.tsx b/frontend/src/components/DemoBanner.tsx new file mode 100644 index 0000000..2fe59bd --- /dev/null +++ b/frontend/src/components/DemoBanner.tsx @@ -0,0 +1,17 @@ +import { useTranslation } from "react-i18next"; +import { AlertTriangle } from "lucide-react"; + +// Permanent, non-dismissible bar shown to the shared demo account so it's always clear the +// state is communal. (Replaces the old login-time toast, which re-popped on every reload.) +export default function DemoBanner() { + const { t } = useTranslation(); + return ( +
+ + + {t("common.demoTitle")} + — {t("common.demoSharedNotice")} + +
+ ); +}