From 3d15ec753f93babcc1fa0cf3958f1f164e98fea4 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 11 Jan 2026 03:43:10 +0000 Subject: Disable buttons if logged out Also add prod.env for FE config --- makima/frontend/prod.env | 3 +++ makima/frontend/src/components/NavStrip.tsx | 11 ++++++---- makima/frontend/src/routes/files.tsx | 32 ++++++++++++++++++++++++++++ makima/frontend/src/routes/mesh.tsx | 33 +++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 makima/frontend/prod.env (limited to 'makima') diff --git a/makima/frontend/prod.env b/makima/frontend/prod.env new file mode 100644 index 0000000..ac420e2 --- /dev/null +++ b/makima/frontend/prod.env @@ -0,0 +1,3 @@ +# These are all public tokens / config +VITE_SUPABASE_URL=https://jalcdbwvbzvtxrwduwop.supabase.co +VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_publishable_7aM3npUD3py5tVei-juGJw_PmdT-hl0 diff --git a/makima/frontend/src/components/NavStrip.tsx b/makima/frontend/src/components/NavStrip.tsx index 806f0c5..642e9a3 100644 --- a/makima/frontend/src/components/NavStrip.tsx +++ b/makima/frontend/src/components/NavStrip.tsx @@ -4,14 +4,14 @@ import { RewriteLink } from "./RewriteLink"; interface NavLink { label: string; href: string; - disabled?: boolean; + requiresAuth?: boolean; external?: boolean; } const NAV_LINKS: NavLink[] = [ { label: "Listen", href: "/listen" }, - { label: "Files", href: "/files" }, - { label: "Mesh", href: "/mesh" }, + { label: "Files", href: "/files", requiresAuth: true }, + { label: "Mesh", href: "/mesh", requiresAuth: true }, ]; export function NavStrip() { @@ -22,6 +22,9 @@ export function NavStrip() { window.location.href = "/login"; }; + // Check if user has access (authenticated or auth not configured) + const hasAccess = isAuthenticated || !isAuthConfigured; + return (