Files
superlist/apps/web/src/components/layout/app-header.tsx
Jose Selesan 370e3022c8 feat: make the web app installable and rework the app shell
Add a Vite PWA (`vite-plugin-pwa`): manifest, icons and an `autoUpdate`
service worker, plus an install prompt so the app can be added to the
home screen.

Rework the shell for mobile: mount the bottom navigation bar and the
install prompt in the authenticated layout, hide the sidebar trigger
below `md`, and add a sign-out card to Settings. Drop the placeholder
Tasks page together with its unused shadcn table and the
`@tanstack/react-table` dependency, and remove the in-app router/query
dev tools.
2026-10-16 15:44:20 -03:00

42 lines
1.6 KiB
TypeScript

import { useRouterState } from '@tanstack/react-router'
import { SearchIcon } from 'lucide-react'
import { ThemeToggle } from '@/components/theme-toggle'
import { Separator } from '@/components/ui/separator'
import { SidebarTrigger } from '@/components/ui/sidebar'
function titleFor(pathname: string) {
if (pathname === '/') return 'Panel'
if (pathname.startsWith('/lists')) return 'Listas'
if (pathname.startsWith('/settings')) return 'Ajustes'
return 'Superlist'
}
export function AppHeader() {
const pathname = useRouterState({ select: (state) => state.location.pathname })
const title = titleFor(pathname)
return (
<header className="bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 flex h-16 shrink-0 items-center gap-2 border-b backdrop-blur">
<div className="flex w-full items-center gap-2 px-4">
<SidebarTrigger className="-ml-1 hidden md:inline-flex" />
<Separator orientation="vertical" className="mr-2 h-4" />
<h1 className="truncate text-sm font-medium">{title}</h1>
<div className="ml-auto flex items-center gap-1">
<button
type="button"
className="text-muted-foreground hover:bg-accent hover:text-accent-foreground mr-1 hidden items-center gap-2 rounded-md border px-3 py-1.5 text-xs md:flex"
>
<SearchIcon className="size-3.5" />
Buscar
<kbd className="bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-[10px]">
⌘K
</kbd>
</button>
<ThemeToggle />
</div>
</div>
</header>
)
}