From 5672bc1c616122bd9b3bf9bb0535b9ff3f2c155b Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 24 Feb 2026 23:03:00 -0800 Subject: [PATCH] feat: standardize header with AppSwitcher, SpaceSwitcher, and UserMenu - Replace inline nav/Navbar with shared Header component - Header pattern: AppSwitcher dropdown / SpaceSwitcher / actions / Sign In - SpaceSwitcher and UserMenu work without SDK dependency - Consistent across all r*Apps Co-Authored-By: Claude Opus 4.6 --- src/app/page.tsx | 1 + src/components/Header.tsx | 13 ++++----- src/components/SpaceSwitcher.tsx | 38 +++++++++++++-------------- src/components/UserMenu.tsx | 45 +++++++++++++++++++++++--------- 4 files changed, 59 insertions(+), 38 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 118e0d1..b8f5c45 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -32,6 +32,7 @@ export default function HomePage() { return (
diff --git a/src/components/Header.tsx b/src/components/Header.tsx index eac671c..0d4599d 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,6 +1,5 @@ 'use client'; -import Link from 'next/link'; import { AppSwitcher } from './AppSwitcher'; import { SpaceSwitcher } from './SpaceSwitcher'; import { UserMenu } from './UserMenu'; @@ -11,7 +10,9 @@ export interface BreadcrumbItem { } interface HeaderProps { - /** Breadcrumb trail after the switchers (e.g. [{label: 'Notebooks', href: '/notebooks'}, {label: 'My Notebook'}]) */ + /** Which r*App is current (e.g. 'notes', 'vote', 'funds') */ + current?: string; + /** Breadcrumb trail after the switchers */ breadcrumbs?: BreadcrumbItem[]; /** Right-side actions (rendered between breadcrumbs and UserMenu) */ actions?: React.ReactNode; @@ -19,13 +20,13 @@ interface HeaderProps { maxWidth?: string; } -export function Header({ breadcrumbs, actions, maxWidth = 'max-w-6xl' }: HeaderProps) { +export function Header({ current = 'notes', breadcrumbs, actions, maxWidth = 'max-w-6xl' }: HeaderProps) { return (