refactor: improve auth defaults, update UI, and docs
- Provide fallback values for auth environment variables - Refine global CSS styles and typography - Update application metadata descriptions - Add toast error handling to clients page - Formalize phase implementation guidelines in AGENTS.md
This commit is contained in:
1 parent
df14ee1a9a
commit
fde2c86b1e
48 files changed
+1062
-1665
No files matched your search
@@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { Button } from '@/components/ui/Button';
|
||||
import { Icon } from '@/components/ui/Icon';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
@@ -20,119 +19,103 @@ export const Navbar: React.FC<NavbarProps> = ({
|
||||
|
||||
useEffect(() => {
|
||||
const saved = localStorage.getItem('datastack-theme') as 'dark' | 'light' | null;
|
||||
const initial = saved || 'dark';
|
||||
const initial = saved === 'light' ? 'light' : 'dark';
|
||||
setTheme(initial);
|
||||
if (initial === 'light') {
|
||||
document.documentElement.classList.remove('dark');
|
||||
document.documentElement.classList.add('light');
|
||||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.classList.remove('light');
|
||||
}
|
||||
document.documentElement.classList.toggle('light', initial === 'light');
|
||||
document.documentElement.classList.toggle('dark', initial === 'dark');
|
||||
}, []);
|
||||
|
||||
const toggleTheme = () => {
|
||||
const nextTheme = theme === 'dark' ? 'light' : 'dark';
|
||||
setTheme(nextTheme);
|
||||
localStorage.setItem('datastack-theme', nextTheme);
|
||||
if (nextTheme === 'light') {
|
||||
document.documentElement.classList.remove('dark');
|
||||
document.documentElement.classList.add('light');
|
||||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.classList.remove('light');
|
||||
}
|
||||
document.documentElement.classList.toggle('light', nextTheme === 'light');
|
||||
document.documentElement.classList.toggle('dark', nextTheme === 'dark');
|
||||
};
|
||||
|
||||
const isVcon = pathname?.startsWith('/vcon');
|
||||
|
||||
return (
|
||||
<header className="h-14 shrink-0 bg-[var(--bg-activity)] border-b border-[var(--border)] px-4 sm:px-6 flex items-center justify-between gap-3 z-40 select-none">
|
||||
<header className="h-11 shrink-0 bg-[var(--bg-activity)] border-b border-[var(--border)] px-3.5 sm:px-5 flex items-center justify-between gap-4 z-40 select-none">
|
||||
{/* Left: Mobile hamburger + Brand */}
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<div className="flex items-center gap-2.5 min-w-0">
|
||||
{showSidebarToggle && (
|
||||
<button
|
||||
<Button
|
||||
type="button"
|
||||
variant="icon"
|
||||
size="icon"
|
||||
icon="Menu"
|
||||
onClick={onToggleSidebar}
|
||||
className="lg:hidden w-9 h-9 shrink-0 flex items-center justify-center text-[var(--text-muted)] hover:text-[var(--text)] border border-[var(--border)] bg-[var(--bg-elevated)] cursor-pointer"
|
||||
className="lg:hidden h-7 w-7 shrink-0 border border-[var(--border)] bg-[var(--bg-elevated)]"
|
||||
aria-label="Toggle Navigation"
|
||||
>
|
||||
<Icon name="Menu" size={13} />
|
||||
</button>
|
||||
title="Toggle Navigation"
|
||||
/>
|
||||
)}
|
||||
|
||||
<Link href="/" className="flex items-center gap-2 min-w-0 text-[14px] font-medium">
|
||||
<span className="grid h-4 w-4 shrink-0 place-items-center bg-[var(--accent)]">
|
||||
<Link href="/" className="flex items-center gap-1.5 min-w-0 text-[13px] font-medium whitespace-nowrap shrink-0">
|
||||
<span className="grid h-3.5 w-3.5 shrink-0 place-items-center bg-[var(--accent)]">
|
||||
<span className="h-1.5 w-1.5 bg-[var(--bg)]" />
|
||||
</span>
|
||||
<span className="truncate text-[var(--text)]">
|
||||
DataStack
|
||||
</span>
|
||||
{isVcon && (
|
||||
<span className="hidden lg:inline text-[11px] text-[var(--text-dim)] font-mono border border-[var(--border)] px-1.5 py-1">
|
||||
v2.4
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Middle: Links */}
|
||||
<nav className="hidden sm:flex items-center gap-6 text-[13px]">
|
||||
<nav className="hidden sm:flex items-center gap-5 text-[12px]">
|
||||
{isVcon ? (
|
||||
<>
|
||||
<Link href="/" className="text-[var(--text-muted)] hover:text-[var(--text)]">
|
||||
<Link href="/" className="text-[var(--text-muted)] hover:text-[var(--text)] whitespace-nowrap shrink-0">
|
||||
Overview
|
||||
</Link>
|
||||
<Link
|
||||
href="/vcon/dashboard"
|
||||
className="px-3 py-2 transition-colors border-b-2 flex items-center gap-2 border-[var(--accent)] text-[var(--text)] font-medium"
|
||||
className={`px-2 py-1.5 transition-colors border-b-2 whitespace-nowrap shrink-0 ${
|
||||
pathname !== '/vcon/export'
|
||||
? 'border-[var(--accent)] text-[var(--text)] font-medium'
|
||||
: 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'
|
||||
}`}
|
||||
>
|
||||
<span>Admin Console</span>
|
||||
<span className="w-1.5 h-1.5 bg-[var(--success)] shrink-0" />
|
||||
Console
|
||||
</Link>
|
||||
<Link
|
||||
href="/vcon/export"
|
||||
className={`px-3 py-2 transition-colors border-b-2 ${
|
||||
className={`px-2 py-1.5 transition-colors border-b-2 whitespace-nowrap shrink-0 ${
|
||||
pathname === '/vcon/export'
|
||||
? 'border-[var(--accent)] text-[var(--text)] font-medium'
|
||||
: 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'
|
||||
}`}
|
||||
>
|
||||
CSV Exporter
|
||||
Export
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Link href="#features" className="text-[var(--text-muted)] hover:text-[var(--text)]">Features</Link>
|
||||
<Link href="#sdk" className="text-[var(--text-muted)] hover:text-[var(--text)]">SDK</Link>
|
||||
<Link href="#about" className="text-[var(--text-muted)] hover:text-[var(--text)]">About</Link>
|
||||
<Link href="#features" className="text-[var(--text-muted)] hover:text-[var(--text)] whitespace-nowrap shrink-0">Features</Link>
|
||||
<Link href="#sdk" className="text-[var(--text-muted)] hover:text-[var(--text)] whitespace-nowrap shrink-0">SDK</Link>
|
||||
<Link href="#about" className="text-[var(--text-muted)] hover:text-[var(--text)] whitespace-nowrap shrink-0">About</Link>
|
||||
</>
|
||||
)}
|
||||
</nav>
|
||||
|
||||
{/* Right: Admin runtime indicators or public feature action */}
|
||||
{/* Right: Theme switcher or public CTA */}
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
{isVcon && (
|
||||
<div className="hidden xl:flex items-center gap-2 text-[11px] text-[var(--text-dim)] font-mono border border-[var(--border)] px-2.5 py-1.5 bg-[var(--bg-main)]">
|
||||
<span className="w-1.5 h-1.5 bg-[var(--success)] inline-block" />
|
||||
<span>:4000</span>
|
||||
<span className="text-[var(--border-strong)]">|</span>
|
||||
<span className="w-1.5 h-1.5 bg-[var(--accent)] inline-block" />
|
||||
<span>:3000</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<button
|
||||
<Button
|
||||
type="button"
|
||||
variant="icon"
|
||||
size="icon"
|
||||
icon={theme === 'dark' ? 'Sun' : 'Moon'}
|
||||
onClick={toggleTheme}
|
||||
aria-label="Toggle Theme"
|
||||
className="w-9 h-9 flex items-center justify-center border border-[var(--border)] bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text)] cursor-pointer"
|
||||
>
|
||||
<Icon name={theme === 'dark' ? 'Sun' : 'Moon'} size={12} />
|
||||
</button>
|
||||
title="Toggle Theme"
|
||||
className="h-7 w-7 border border-[var(--border)] bg-[var(--bg-elevated)]"
|
||||
/>
|
||||
|
||||
{!isVcon && (
|
||||
<Link href="#sdk">
|
||||
<Button size="sm" variant="primary">
|
||||
Read the SDK guide
|
||||
<Button size="xs" variant="primary">
|
||||
SDK Guide
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user