development #14
@@ -1,6 +1,6 @@
|
|||||||
import { Link, useLocation } from '@tanstack/react-router'
|
import { Link, useLocation } from '@tanstack/react-router'
|
||||||
import { cn } from '../../lib/utils'
|
import { cn } from '../../lib/utils'
|
||||||
import { NAV_ITEMS } from './nav-items'
|
import { isNavItemActive, NAV_ITEMS } from './nav-items'
|
||||||
|
|
||||||
export function BottomNav() {
|
export function BottomNav() {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
@@ -9,21 +9,28 @@ export function BottomNav() {
|
|||||||
<nav className="fixed inset-x-0 bottom-0 z-40 border-t border-border bg-surface/95 pb-[env(safe-area-inset-bottom)] backdrop-blur lg:hidden">
|
<nav className="fixed inset-x-0 bottom-0 z-40 border-t border-border bg-surface/95 pb-[env(safe-area-inset-bottom)] backdrop-blur lg:hidden">
|
||||||
<div className="mx-auto grid max-w-md grid-cols-4">
|
<div className="mx-auto grid max-w-md grid-cols-4">
|
||||||
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
||||||
const isActive = location.pathname === to
|
const isActive = isNavItemActive(location.pathname, to)
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
key={to}
|
key={to}
|
||||||
to={to}
|
to={to}
|
||||||
|
aria-current={isActive ? 'page' : undefined}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex flex-col items-center gap-0.5 py-2.5 text-[11px] font-medium transition-colors',
|
'flex min-h-14 flex-col items-center justify-center gap-1 py-2 text-[11px] font-medium transition-colors',
|
||||||
isActive ? 'text-accent-fg' : 'text-foreground/50 hover:text-primary',
|
isActive ? 'text-accent-fg' : 'text-foreground/80 hover:text-primary',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icon
|
{/* Pastilla suave detrás del ícono: el estado activo se lee por
|
||||||
className={cn('size-6', isActive && 'fill-accent/15 stroke-accent')}
|
color + fondo, no solo por el tono del texto. */}
|
||||||
strokeWidth={isActive ? 2.2 : 2}
|
<span
|
||||||
/>
|
className={cn(
|
||||||
{label}
|
'flex size-8 items-center justify-center rounded-lg transition-colors duration-150',
|
||||||
|
isActive && 'bg-accent-soft',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Icon className="size-5" strokeWidth={isActive ? 2.25 : 2} />
|
||||||
|
</span>
|
||||||
|
<span className="leading-none">{label}</span>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Link, useLocation } from '@tanstack/react-router'
|
import { Link, useLocation } from '@tanstack/react-router'
|
||||||
import { cn } from '../../lib/utils'
|
import { cn } from '../../lib/utils'
|
||||||
import { Logo } from '../brand'
|
import { Logo } from '../brand'
|
||||||
import { NAV_ITEMS } from './nav-items'
|
import { isNavItemActive, NAV_ITEMS } from './nav-items'
|
||||||
|
|
||||||
export function Sidebar() {
|
export function Sidebar() {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
@@ -16,16 +16,17 @@ export function Sidebar() {
|
|||||||
|
|
||||||
<nav className="flex flex-col gap-1">
|
<nav className="flex flex-col gap-1">
|
||||||
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
||||||
const isActive = location.pathname === to
|
const isActive = isNavItemActive(location.pathname, to)
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
key={to}
|
key={to}
|
||||||
to={to}
|
to={to}
|
||||||
|
aria-current={isActive ? 'page' : undefined}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-medium transition-colors',
|
'flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-medium transition-colors',
|
||||||
isActive
|
isActive
|
||||||
? 'bg-accent-soft text-accent-fg'
|
? 'bg-accent-soft text-accent-fg'
|
||||||
: 'text-foreground/60 hover:bg-primary-soft hover:text-primary',
|
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icon className="size-5" strokeWidth={isActive ? 2.2 : 2} />
|
<Icon className="size-5" strokeWidth={isActive ? 2.2 : 2} />
|
||||||
|
|||||||
@@ -12,3 +12,12 @@ export const NAV_ITEMS: NavItem[] = [
|
|||||||
{ label: 'Cobros', to: '/payments', icon: Wallet },
|
{ label: 'Cobros', to: '/payments', icon: Wallet },
|
||||||
{ label: 'Ajustes', to: '/settings', icon: Settings },
|
{ label: 'Ajustes', to: '/settings', icon: Settings },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/** Una sección sigue activa dentro de sus subrutas: en `/groups/abc` el ítem
|
||||||
|
* activo es "Grupos", no ninguno. El prefijo se corta en el separador para
|
||||||
|
* que `/groupsomething` no se considere "/groups". La raíz es exacta: no hay
|
||||||
|
* subrutas del home que deban marcarla. */
|
||||||
|
export function isNavItemActive(pathname: string, to: string): boolean {
|
||||||
|
if (to === '/') return pathname === '/'
|
||||||
|
return pathname === to || pathname.startsWith(`${to}/`)
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
|
|||||||
<span
|
<span
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',
|
'inline-flex shrink-0 items-center whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium',
|
||||||
variants[variant],
|
variants[variant],
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
type={type}
|
type={type}
|
||||||
className={cn(
|
className={cn(
|
||||||
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50',
|
// `transition-*` explícito en vez de `transition-all`: solo se animan
|
||||||
|
// color, fondo, borde y transform. El feedback de presión se anula
|
||||||
|
// con `motion-reduce` para respetar prefers-reduced-motion.
|
||||||
|
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl font-medium transition-[color,background-color,border-color,fill,stroke,transform] duration-150 ease-out active:scale-[0.96] motion-reduce:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50',
|
||||||
variants[variant],
|
variants[variant],
|
||||||
sizes[size],
|
sizes[size],
|
||||||
className,
|
className,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function GroupDetailView() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="animate-fade-in space-y-6">
|
<section className="animate-fade-in space-y-5 sm:space-y-6">
|
||||||
<GroupHeader />
|
<GroupHeader />
|
||||||
<GroupInfoCard />
|
<GroupInfoCard />
|
||||||
<MembersWaitlistSection />
|
<MembersWaitlistSection />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Link, useNavigate } from '@tanstack/react-router'
|
import { Link, useNavigate } from '@tanstack/react-router'
|
||||||
import { ArrowLeft, BarChart3, Share2, UserPlus } from 'lucide-react'
|
import { ArrowLeft, BarChart3, Share2, UserPlus } from 'lucide-react'
|
||||||
import { Badge, Button } from '../../../components/ui'
|
import { Badge, Button } from '../../../components/ui'
|
||||||
|
import { cn } from '../../../lib/utils'
|
||||||
import { RISK_LABELS } from '../constants'
|
import { RISK_LABELS } from '../constants'
|
||||||
import { useGroupDetail } from './GroupDetailProvider'
|
import { useGroupDetail } from './GroupDetailProvider'
|
||||||
|
|
||||||
@@ -13,38 +14,48 @@ export function GroupHeader() {
|
|||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
to="/groups"
|
to="/groups"
|
||||||
className="mb-3 hidden items-center gap-1 text-sm text-foreground/60 transition-colors hover:text-primary lg:inline-flex"
|
className="mb-3 hidden items-center gap-1 text-sm text-foreground/80 transition-colors hover:text-primary lg:inline-flex"
|
||||||
>
|
>
|
||||||
<ArrowLeft className="size-4" />
|
<ArrowLeft className="size-4" />
|
||||||
<span>Volver a grupos</span>
|
<span>Volver a grupos</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
{/* El título se queda con el ancho completo: los estados bajan a su propia
|
||||||
<div>
|
fila compacta en vez de competir con el nombre por el espacio. */}
|
||||||
<div className="flex items-center gap-2.5">
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-6">
|
||||||
<h1 className="text-2xl font-bold text-primary">{group?.name}</h1>
|
<div className="min-w-0 sm:max-w-2xl">
|
||||||
<Badge variant="success">Activo</Badge>
|
<h1 className="text-balance text-2xl font-bold leading-tight text-primary sm:text-[1.75rem]">
|
||||||
|
{group?.name}
|
||||||
|
</h1>
|
||||||
|
{group?.description ? (
|
||||||
|
<p className="mt-1.5 text-sm leading-relaxed text-foreground/80">{group.description}</p>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex flex-wrap items-center gap-2 sm:shrink-0 sm:justify-end">
|
||||||
|
<Badge variant="success" className="gap-1.5 text-[11px]">
|
||||||
|
<span className="size-1.5 rounded-full bg-success" aria-hidden="true" />
|
||||||
|
Activo
|
||||||
|
</Badge>
|
||||||
{hasRisk ? (
|
{hasRisk ? (
|
||||||
<Badge variant={riskLevel === 'HIGH' ? 'danger' : 'warning'} className="gap-1.5">
|
<Badge
|
||||||
|
variant={riskLevel === 'HIGH' ? 'danger' : 'warning'}
|
||||||
|
className="gap-1.5 text-[11px]"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
className={`size-2 rounded-full ${riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning'}`}
|
className={cn('size-1.5 rounded-full', riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning')}
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
{RISK_LABELS[riskLevel]}
|
{RISK_LABELS[riskLevel]}
|
||||||
</Badge>
|
</Badge>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{group?.description ? (
|
|
||||||
<p className="mt-1 text-sm text-foreground/70">{group.description}</p>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:flex-wrap sm:items-center sm:gap-2.5">
|
<div className="mt-4 grid grid-cols-2 gap-2.5 sm:mt-5 sm:flex sm:flex-wrap sm:items-center sm:justify-end sm:gap-2.5">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() =>
|
onClick={() => void navigate({ to: '/groups/$groupId/analytics', params: { groupId } })}
|
||||||
void navigate({ to: '/groups/$groupId/analytics', params: { groupId } })
|
|
||||||
}
|
|
||||||
className="w-full justify-center border-border sm:w-auto"
|
className="w-full justify-center border-border sm:w-auto"
|
||||||
>
|
>
|
||||||
<BarChart3 className="size-4 text-accent" />
|
<BarChart3 className="size-4 text-accent" />
|
||||||
@@ -74,6 +85,5 @@ export function GroupHeader() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,14 @@ export function GroupInfoCard() {
|
|||||||
if (!group) return null
|
if (!group) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-1 gap-4 rounded-xl border border-border bg-surface p-4 text-sm md:grid-cols-3">
|
<div className="grid grid-cols-1 gap-x-6 gap-y-4 rounded-2xl bg-primary-soft p-4 sm:p-5 md:grid-cols-3 md:gap-x-0 md:divide-x md:divide-border/70">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-start gap-3 md:pr-6">
|
||||||
<CalendarClock className="size-5 shrink-0 text-accent" />
|
<CalendarClock className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<p className="text-xs font-medium uppercase text-foreground/50">Horario</p>
|
<p className="text-[11px] font-semibold uppercase tracking-wide text-foreground/80">
|
||||||
<p className="font-medium text-primary">
|
Horario
|
||||||
|
</p>
|
||||||
|
<p className="mt-0.5 text-sm font-semibold text-primary">
|
||||||
{(group.days?.length ?? 0) > 0
|
{(group.days?.length ?? 0) > 0
|
||||||
? formatSchedule(group.days ?? [], group.time)
|
? formatSchedule(group.days ?? [], group.time)
|
||||||
: 'Sin horario definido'}
|
: 'Sin horario definido'}
|
||||||
@@ -20,22 +22,26 @@ export function GroupInfoCard() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-start gap-3 md:px-6">
|
||||||
<Users className="size-5 shrink-0 text-accent" />
|
<Users className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<p className="text-xs font-medium uppercase text-foreground/50">Miembros & Cupo</p>
|
<p className="text-[11px] font-semibold uppercase tracking-wide text-foreground/80">
|
||||||
<p className="font-medium text-primary">
|
Miembros & Cupo
|
||||||
|
</p>
|
||||||
|
<p className="mt-0.5 text-sm font-semibold tabular-nums text-primary">
|
||||||
{attendees.length} inscritos {waitlistTotal > 0 ? ` · ${waitlistTotal} en espera` : ''}
|
{attendees.length} inscritos {waitlistTotal > 0 ? ` · ${waitlistTotal} en espera` : ''}
|
||||||
{group.capacity ? ` · Cupo de ${group.capacity}` : ''}
|
{group.capacity ? ` · Cupo de ${group.capacity}` : ''}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-start gap-3 md:pl-6">
|
||||||
<div className="flex size-5 shrink-0 items-center justify-center font-bold text-accent">$</div>
|
<div className="mt-0.5 flex size-5 shrink-0 items-center justify-center text-sm font-bold leading-none text-accent">
|
||||||
<div>
|
$
|
||||||
<p className="text-xs font-medium uppercase text-foreground/50">Cobro</p>
|
</div>
|
||||||
<p className="font-medium text-primary">
|
<div className="min-w-0">
|
||||||
|
<p className="text-[11px] font-semibold uppercase tracking-wide text-foreground/80">Cobro</p>
|
||||||
|
<p className="mt-0.5 text-sm font-semibold tabular-nums text-primary">
|
||||||
{group.price != null ? formatPrice(group.price) : 'Sin precio'}
|
{group.price != null ? formatPrice(group.price) : 'Sin precio'}
|
||||||
{group.billingType ? ` · ${BILLING_LABELS[group.billingType]}` : ''}
|
{group.billingType ? ` · ${BILLING_LABELS[group.billingType]}` : ''}
|
||||||
{group.dueDay ? ` · Vence día ${group.dueDay}` : ''}
|
{group.dueDay ? ` · Vence día ${group.dueDay}` : ''}
|
||||||
|
|||||||
@@ -12,40 +12,50 @@ export function MembersTable({ attendees }: { attendees: AttendeeDto[] }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-x-auto">
|
<table className="w-full table-fixed text-left text-sm">
|
||||||
<table className="w-full text-left text-sm">
|
<thead>
|
||||||
<thead className="border-b border-border text-xs font-semibold uppercase text-foreground/60">
|
<tr className="border-b border-border/70 text-xs font-semibold text-foreground/80">
|
||||||
<tr>
|
<th scope="col" className="w-[54%] px-3 pb-2">Nombre</th>
|
||||||
<th className="px-3 pb-3">Nombre</th>
|
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||||
<th className="px-3 pb-3">Teléfono</th>
|
<th scope="col" className="w-9 px-1 pb-2">
|
||||||
<th className="w-8 px-3 pb-3" />
|
<span className="sr-only">Detalle</span>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-border">
|
<tbody>
|
||||||
{attendees.map((attendee) => (
|
{attendees.map((attendee) => (
|
||||||
<tr
|
<tr
|
||||||
key={attendee.id}
|
key={attendee.id}
|
||||||
className="cursor-pointer transition-colors hover:bg-primary-soft/50"
|
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||||
onClick={() => openAttendee(attendee.id)}
|
onClick={() => openAttendee(attendee.id)}
|
||||||
>
|
>
|
||||||
<td className="px-3 py-3">
|
<td className="px-3 py-2.5">
|
||||||
<div className="flex items-center gap-2.5">
|
<div className="flex min-w-0 items-center gap-2.5">
|
||||||
<div className="flex size-8 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||||
{attendee.fullName.charAt(0).toUpperCase()}
|
{attendee.fullName.charAt(0).toUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
<span className="font-medium text-primary">{attendee.fullName}</span>
|
{/* `truncate` solo recorta lo pintado: el texto completo sigue en
|
||||||
|
el DOM para lectores de pantalla, y `title` lo muestra al hover. */}
|
||||||
|
<span className="min-w-0 truncate font-medium text-primary" title={attendee.fullName}>
|
||||||
|
{attendee.fullName}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-3 py-3 text-foreground/70">
|
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||||
{attendee.phone || <span className="text-foreground/40">—</span>}
|
{attendee.phone ? (
|
||||||
|
<span className="block truncate tabular-nums" title={attendee.phone}>
|
||||||
|
{attendee.phone}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="text-foreground/60">—</span>
|
||||||
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-1 py-3 text-foreground/30">
|
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||||
<ChevronRight className="size-4" />
|
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -8,18 +8,9 @@ import { WaitlistTable } from './WaitlistTable'
|
|||||||
|
|
||||||
export function MembersWaitlistSection() {
|
export function MembersWaitlistSection() {
|
||||||
const {
|
const {
|
||||||
groupId,
|
groupId, attendees, attendeesTotal, attendeesPending,
|
||||||
attendees,
|
waitlistEntries, waitlistTotal, waitlistPending,
|
||||||
attendeesTotal,
|
listSection, setListSection, searchFilter, setSearchFilter, openInviteModal,
|
||||||
attendeesPending,
|
|
||||||
waitlistEntries,
|
|
||||||
waitlistTotal,
|
|
||||||
waitlistPending,
|
|
||||||
listSection,
|
|
||||||
setListSection,
|
|
||||||
searchFilter,
|
|
||||||
setSearchFilter,
|
|
||||||
openInviteModal,
|
|
||||||
} = useGroupDetail()
|
} = useGroupDetail()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
@@ -32,31 +23,44 @@ export function MembersWaitlistSection() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4 rounded-xl border border-border bg-surface p-5">
|
// Radios concéntricos: `rounded-2xl` (16px) con `p-2` (8px) deja a las
|
||||||
<div className="flex flex-col gap-3">
|
// superficies interiores un radio de 16 - 8 = 8px, o sea `rounded-lg`.
|
||||||
<div className="flex flex-col justify-between gap-3 sm:flex-row sm:items-center">
|
// Sin bordes: el lavado `bg-primary-soft` separa la sección del fondo.
|
||||||
<div className="flex w-full items-center rounded-xl bg-primary-soft p-1 sm:w-[26rem]">
|
<div className="rounded-2xl bg-primary-soft p-2">
|
||||||
|
<div className="space-y-2 p-2 sm:p-3">
|
||||||
|
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3">
|
||||||
|
<div
|
||||||
|
role="tablist"
|
||||||
|
aria-label="Listado del grupo"
|
||||||
|
className="flex w-full items-center gap-1 rounded-lg bg-surface p-0.5 shadow-xs sm:w-[26rem]"
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-selected={listSection === 'members'}
|
||||||
onClick={() => setListSection('members')}
|
onClick={() => setListSection('members')}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex flex-1 items-center justify-center gap-1.5 rounded-lg py-2 text-xs font-semibold transition-all',
|
'flex min-h-10 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-semibold transition-[color,background-color,box-shadow] duration-150',
|
||||||
listSection === 'members'
|
listSection === 'members'
|
||||||
? 'bg-surface text-primary shadow-xs'
|
? 'bg-accent text-on-accent shadow-xs'
|
||||||
: 'text-foreground/60 hover:text-primary',
|
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Users className="size-4 shrink-0" />
|
<Users className="size-4 shrink-0" />
|
||||||
<span className="whitespace-nowrap">Miembros ({attendeesTotal})</span>
|
<span className="whitespace-nowrap">
|
||||||
|
Miembros ({attendeesTotal})
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-selected={listSection === 'waitlist'}
|
||||||
onClick={() => setListSection('waitlist')}
|
onClick={() => setListSection('waitlist')}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex flex-1 items-center justify-center gap-1.5 rounded-lg py-2 text-xs font-semibold transition-all',
|
'flex min-h-10 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-semibold transition-[color,background-color,box-shadow] duration-150',
|
||||||
listSection === 'waitlist'
|
listSection === 'waitlist'
|
||||||
? 'bg-surface text-primary shadow-xs'
|
? 'bg-accent text-on-accent shadow-xs'
|
||||||
: 'text-foreground/60 hover:text-primary',
|
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Clock className="size-4 shrink-0" />
|
<Clock className="size-4 shrink-0" />
|
||||||
@@ -66,24 +70,26 @@ export function MembersWaitlistSection() {
|
|||||||
|
|
||||||
{listSection === 'members' ? (
|
{listSection === 'members' ? (
|
||||||
<div className="relative w-full sm:w-64">
|
<div className="relative w-full sm:w-64">
|
||||||
<Search className="absolute left-3 top-2.5 size-4 text-foreground/40" />
|
<Search className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-foreground/70" />
|
||||||
<Input
|
<Input
|
||||||
placeholder="Buscar por nombre o teléfono..."
|
placeholder="Buscar por nombre o teléfono..."
|
||||||
value={searchFilter}
|
value={searchFilter}
|
||||||
onChange={(e) => setSearchFilter(e.target.value)}
|
onChange={(e) => setSearchFilter(e.target.value)}
|
||||||
className="h-9 pl-9 text-xs"
|
aria-label="Buscar miembros"
|
||||||
|
className="h-10 rounded-lg border-transparent pl-9 shadow-xs placeholder:text-foreground/80"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-xs text-foreground/60">
|
<p className="text-xs leading-relaxed text-foreground/80">
|
||||||
{listSection === 'members'
|
{listSection === 'members'
|
||||||
? 'Listado de todos los miembros incorporados al grupo.'
|
? 'Listado de todos los miembros incorporados al grupo.'
|
||||||
: 'Personas que esperan un cupo libre en el grupo. Al pasar a alguien al grupo, se crea automáticamente su registro como miembro.'}
|
: 'Personas que esperan un cupo libre en el grupo. Al pasar a alguien al grupo, se crea automáticamente su registro como miembro.'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="rounded-lg bg-surface p-1 shadow-xs sm:p-2">
|
||||||
{listSection === 'members' ? (
|
{listSection === 'members' ? (
|
||||||
<>
|
<>
|
||||||
{attendeesPending ? (
|
{attendeesPending ? (
|
||||||
@@ -93,26 +99,22 @@ export function MembersWaitlistSection() {
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{!attendeesPending && attendees.length === 0 ? (
|
{!attendeesPending && attendees.length === 0 ? (
|
||||||
<div className="rounded-xl border border-dashed border-border px-4 py-12 text-center">
|
<div className="rounded-lg bg-primary-soft/50 px-4 py-10 text-center">
|
||||||
<Users className="mx-auto mb-2 size-10 text-foreground/30" />
|
<Users className="mx-auto mb-2 size-10 text-foreground/40" />
|
||||||
<p className="font-medium text-primary">Todavía no hay miembros en este grupo</p>
|
<p className="text-sm font-semibold text-primary">
|
||||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/60">
|
Todavía no hay miembros en este grupo
|
||||||
|
</p>
|
||||||
|
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||||
Puedes compartir el enlace de invitación único o agregar miembros de forma manual o
|
Puedes compartir el enlace de invitación único o agregar miembros de forma manual o
|
||||||
masiva.
|
masiva.
|
||||||
</p>
|
</p>
|
||||||
<div className="mt-4 flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-center sm:gap-3">
|
<div className="mt-4 flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-center sm:gap-3">
|
||||||
<Button
|
<Button variant="outline" onClick={openInviteModal} className="w-full sm:w-auto">
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={openInviteModal}
|
|
||||||
className="w-full sm:w-auto"
|
|
||||||
>
|
|
||||||
<Share2 className="size-4" />
|
<Share2 className="size-4" />
|
||||||
Compartir Enlace
|
Compartir Enlace
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
size="sm"
|
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
void navigate({ to: '/groups/$groupId/attendees/new', params: { groupId } })
|
void navigate({ to: '/groups/$groupId/attendees/new', params: { groupId } })
|
||||||
}
|
}
|
||||||
@@ -126,7 +128,7 @@ export function MembersWaitlistSection() {
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{attendees.length > 0 && filteredAttendees.length === 0 ? (
|
{attendees.length > 0 && filteredAttendees.length === 0 ? (
|
||||||
<div className="py-8 text-center text-sm text-foreground/60">
|
<div className="py-8 text-center text-sm text-foreground/80">
|
||||||
No se encontraron miembros que coincidan con la búsqueda.
|
No se encontraron miembros que coincidan con la búsqueda.
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -142,10 +144,10 @@ export function MembersWaitlistSection() {
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{!waitlistPending && waitlistEntries.length === 0 ? (
|
{!waitlistPending && waitlistEntries.length === 0 ? (
|
||||||
<div className="rounded-xl border border-dashed border-border px-4 py-12 text-center">
|
<div className="rounded-lg bg-primary-soft/50 px-4 py-10 text-center">
|
||||||
<Clock className="mx-auto mb-2 size-10 text-foreground/30" />
|
<Clock className="mx-auto mb-2 size-10 text-foreground/40" />
|
||||||
<p className="font-medium text-primary">No hay nadie en la lista de espera</p>
|
<p className="text-sm font-semibold text-primary">No hay nadie en la lista de espera</p>
|
||||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/60">
|
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||||
Cuando el grupo alcance su cupo, las personas podrán sumarse a la espera y podrás
|
Cuando el grupo alcance su cupo, las personas podrán sumarse a la espera y podrás
|
||||||
pasarlas al grupo desde aquí.
|
pasarlas al grupo desde aquí.
|
||||||
</p>
|
</p>
|
||||||
@@ -156,5 +158,6 @@ export function MembersWaitlistSection() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -6,43 +6,55 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
|
|||||||
const { setSelectedWaitlistEntry } = useGroupDetail()
|
const { setSelectedWaitlistEntry } = useGroupDetail()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-x-auto">
|
<table className="w-full table-fixed text-left text-sm">
|
||||||
<table className="w-full text-left text-sm">
|
<thead>
|
||||||
<thead className="border-b border-border text-xs font-semibold uppercase text-foreground/60">
|
<tr className="border-b border-border/70 text-xs font-semibold text-foreground/80">
|
||||||
<tr>
|
<th scope="col" className="w-[54%] px-3 pb-2">Nombre</th>
|
||||||
<th className="px-3 pb-3">Nombre</th>
|
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||||
<th className="px-3 pb-3">Teléfono</th>
|
<th scope="col" className="w-9 px-1 pb-2">
|
||||||
<th className="w-8 px-3 pb-3" />
|
<span className="sr-only">Detalle</span>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-border">
|
<tbody>
|
||||||
{entries.map((entry) => (
|
{entries.map((entry) => (
|
||||||
<tr
|
<tr
|
||||||
key={entry.id}
|
key={entry.id}
|
||||||
className="cursor-pointer transition-colors hover:bg-primary-soft/50"
|
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||||
onClick={() => setSelectedWaitlistEntry(entry)}
|
onClick={() => setSelectedWaitlistEntry(entry)}
|
||||||
>
|
>
|
||||||
<td className="px-3 py-3">
|
<td className="px-3 py-2.5">
|
||||||
<div className="flex items-center gap-2.5">
|
<div className="flex min-w-0 items-center gap-2.5">
|
||||||
<div className="flex size-8 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||||
{entry.fullName.charAt(0).toUpperCase()}
|
{entry.fullName.charAt(0).toUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<p className="truncate font-medium text-primary">{entry.fullName}</p>
|
<p className="truncate font-medium text-primary" title={entry.fullName}>
|
||||||
|
{entry.fullName}
|
||||||
|
</p>
|
||||||
{entry.notes ? (
|
{entry.notes ? (
|
||||||
<p className="truncate text-xs text-foreground/50">{entry.notes}</p>
|
<p className="truncate text-xs text-foreground/70" title={entry.notes}>
|
||||||
|
{entry.notes}
|
||||||
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-3 py-3 text-foreground/70">{entry.phone}</td>
|
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||||
<td className="px-1 py-3 text-foreground/30">
|
{entry.phone ? (
|
||||||
<ChevronRight className="size-4" />
|
<span className="block truncate tabular-nums" title={entry.phone}>
|
||||||
|
{entry.phone}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="text-foreground/60">—</span>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||||
|
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user