summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-11 03:43:10 +0000
committersoryu <soryu@soryu.co>2026-01-11 03:43:10 +0000
commit3d15ec753f93babcc1fa0cf3958f1f164e98fea4 (patch)
treec75eac7455c4714497e67df82725c47d588ebcb3 /makima/frontend/src/components
parent8b17a175c3e7e27b789812eba4e3cd760beadb10 (diff)
downloadsoryu-3d15ec753f93babcc1fa0cf3958f1f164e98fea4.tar.gz
soryu-3d15ec753f93babcc1fa0cf3958f1f164e98fea4.zip
Disable buttons if logged out
Also add prod.env for FE config
Diffstat (limited to 'makima/frontend/src/components')
-rw-r--r--makima/frontend/src/components/NavStrip.tsx11
1 files changed, 7 insertions, 4 deletions
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 (
<nav
className="flex items-center gap-2.5 px-3 py-2.5 border-t border-b border-dashed border-[rgba(117,170,252,0.35)] bg-[#0c1729] font-mono uppercase tracking-wide text-[11px]"
@@ -35,7 +38,7 @@ export function NavStrip() {
<RewriteLink
key={link.label}
to={link.href}
- disabled={link.disabled}
+ disabled={link.requiresAuth && !hasAccess}
external={link.external}
>
{link.label}