feat: app de alumnos sin contraseña (invitación de un solo uso, avisos de falta y pagos informados)
- Acceso del alumno o tutor con link de un solo uso (hash SHA-256, consumo atómico, el GET no consume), sesión propia de 90 días deslizante, passkeys opcionales (SimpleWebAuthn) y mail de recuperación con rate limit. - Lado alumno (/i/:token, /acceso, /alumno/*): inicio, clases, avisar falta, pagos, informar pago con comprobante (S3 privado, magic bytes) y perfil. - Lado profe: acceso a la app en la ficha del alumno (invitar/reinvitar), "Pagos para verificar" en Cobros con badge, faltas avisadas en la ficha de grupo y datos para transferir en Ajustes. - "Requiere atención" y el recordatorio de WhatsApp excluyen cuotas informadas. - Zona horaria por defecto: Buenos Aires. - Migración add_student_access, tests contra Postgres real (test:db) y docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
47
apps/web/src/features/student-app/NextClassCard.tsx
Normal file
47
apps/web/src/features/student-app/NextClassCard.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import type { StudentClass } from '@gruperly/shared'
|
||||
import { CalendarX2, Check } from 'lucide-react'
|
||||
import { dateParts, formatLongDate, formatRelativeDay, formatTime } from './format'
|
||||
|
||||
type NextClassCardProps = { item: StudentClass; timeZone: string }
|
||||
|
||||
/* "Próxima clase": the dark brand card is the one strong surface of the home.
|
||||
White on brand-night scores 15:1 in both themes. */
|
||||
export function NextClassCard({ item, timeZone }: NextClassCardProps) {
|
||||
const { day, month } = dateParts(item.startsAt, timeZone)
|
||||
|
||||
return (
|
||||
<article className="rounded-2xl bg-brand-night p-5 text-white shadow-sm">
|
||||
<p className="text-xs font-semibold uppercase tracking-wide text-brand-celeste">
|
||||
Próxima clase · {formatRelativeDay(item.startsAt, timeZone)}
|
||||
</p>
|
||||
<div className="mt-3 flex items-center gap-4">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h2 className="truncate text-xl font-bold">{item.groupName}</h2>
|
||||
<p className="mt-1 text-sm text-white/85">
|
||||
{formatLongDate(item.startsAt, timeZone)} · {formatTime(item.startsAt, timeZone)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex size-16 shrink-0 flex-col items-center justify-center rounded-xl bg-white/10" aria-hidden="true">
|
||||
<span className="text-2xl font-bold leading-none">{day}</span>
|
||||
<span className="mt-1 text-xs uppercase text-white/85">{month}</span>
|
||||
</div>
|
||||
</div>
|
||||
{item.notice ? (
|
||||
<p className="mt-4 flex min-h-11 items-center gap-2 rounded-xl bg-white/10 px-4 text-sm font-medium">
|
||||
<Check className="size-4" aria-hidden="true" />
|
||||
Avisaste que no vas
|
||||
</p>
|
||||
) : (
|
||||
<Link
|
||||
to="/alumno/avisar"
|
||||
search={{ clase: item.startsAt }}
|
||||
className="mt-4 flex min-h-12 items-center justify-center gap-2 rounded-xl bg-white font-semibold text-brand-night hover:bg-brand-cloud"
|
||||
>
|
||||
<CalendarX2 className="size-5" aria-hidden="true" />
|
||||
No voy a ir
|
||||
</Link>
|
||||
)}
|
||||
</article>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user