feat: add collaborative shopping lists with items and invitations
Some checks failed
CI / Verify (push) Has been cancelled
Some checks failed
CI / Verify (push) Has been cancelled
API: lists, items and invitations modules (list, create, get, update, set-primary, items create/list, invitation create/accept/list-pending), BetterAuth session helper, list membership, mailer and Prisma schema plus migrations. Web: lists overview, list detail (items) and list management (settings) views, item and invitation forms/hooks, sign-up and invitation accept pages. Shared: shopping list DTOs. Tooling: ignore the generated TanStack Router cache (apps/web/.tanstack).
This commit is contained in:
@@ -1,34 +1,35 @@
|
||||
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 usePageTitle() {
|
||||
const pathname = useRouterState({ select: (state) => state.location.pathname })
|
||||
|
||||
if (pathname === '/') return 'Dashboard'
|
||||
|
||||
const segment = pathname.split('/').filter(Boolean).at(0) ?? ''
|
||||
return segment.charAt(0).toUpperCase() + segment.slice(1)
|
||||
function titleFor(pathname: string) {
|
||||
if (pathname === '/') return 'Panel'
|
||||
if (pathname.startsWith('/lists')) return 'Listas'
|
||||
if (pathname.startsWith('/tasks')) return 'Tareas'
|
||||
if (pathname.startsWith('/settings')) return 'Ajustes'
|
||||
return 'Superlist'
|
||||
}
|
||||
|
||||
export function AppHeader() {
|
||||
const title = usePageTitle()
|
||||
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" />
|
||||
<Separator orientation="vertical" className="mr-2 h-4" />
|
||||
<h1 className="text-sm font-medium">{title}</h1>
|
||||
<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" />
|
||||
Search
|
||||
Buscar
|
||||
<kbd className="bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-[10px]">
|
||||
⌘K
|
||||
</kbd>
|
||||
|
||||
Reference in New Issue
Block a user