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,6 +1,6 @@
|
||||
import { Link, useRouterState } from '@tanstack/react-router'
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
import { LayoutDashboardIcon, ListTodoIcon, SettingsIcon } from 'lucide-react'
|
||||
import { HomeIcon, ListTodoIcon, SettingsIcon, ShoppingCartIcon } from 'lucide-react'
|
||||
|
||||
import { NavUser } from '@/components/layout/nav-user'
|
||||
import {
|
||||
@@ -23,11 +23,17 @@ type NavItem = {
|
||||
}
|
||||
|
||||
const NAV_ITEMS: NavItem[] = [
|
||||
{ title: 'Dashboard', to: '/', icon: LayoutDashboardIcon },
|
||||
{ title: 'Tasks', to: '/tasks', icon: ListTodoIcon },
|
||||
{ title: 'Settings', to: '/settings', icon: SettingsIcon },
|
||||
{ title: 'Principal', to: '/', icon: HomeIcon },
|
||||
{ title: 'Listas', to: '/lists', icon: ShoppingCartIcon },
|
||||
{ title: 'Tareas', to: '/tasks', icon: ListTodoIcon },
|
||||
{ title: 'Ajustes', to: '/settings', icon: SettingsIcon },
|
||||
]
|
||||
|
||||
function isActive(pathname: string, to: string) {
|
||||
if (to === '/') return pathname === '/'
|
||||
return pathname === to || pathname.startsWith(`${to}/`)
|
||||
}
|
||||
|
||||
export function AppSidebar() {
|
||||
const pathname = useRouterState({ select: (state) => state.location.pathname })
|
||||
|
||||
@@ -43,7 +49,7 @@ export function AppSidebar() {
|
||||
</div>
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
<span className="truncate font-medium">Superlist</span>
|
||||
<span className="text-muted-foreground truncate text-xs">Admin</span>
|
||||
<span className="text-muted-foreground truncate text-xs">Listas compartidas</span>
|
||||
</div>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
@@ -53,11 +59,15 @@ export function AppSidebar() {
|
||||
|
||||
<SidebarContent>
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel>Platform</SidebarGroupLabel>
|
||||
<SidebarGroupLabel>Plataforma</SidebarGroupLabel>
|
||||
<SidebarMenu>
|
||||
{NAV_ITEMS.map((item) => (
|
||||
<SidebarMenuItem key={item.to}>
|
||||
<SidebarMenuButton asChild isActive={pathname === item.to} tooltip={item.title}>
|
||||
<SidebarMenuButton
|
||||
asChild
|
||||
isActive={isActive(pathname, item.to)}
|
||||
tooltip={item.title}
|
||||
>
|
||||
<Link to={item.to}>
|
||||
<item.icon />
|
||||
<span>{item.title}</span>
|
||||
|
||||
Reference in New Issue
Block a user