refactor(web): rutas de la app de alumnos en inglés
/acceso → /access, /alumno/* → /student/* (welcome, classes, payments, profile, notify-absence, report-payment). El link del mail de confirmación pasa a /access/email/:token. AGENTS.md documenta que los paths van en inglés. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,7 +33,7 @@ export function FeeCard({ fees }: { fees: StudentFee[] }) {
|
||||
</div>
|
||||
{toReport.length > 0 ? (
|
||||
<Link
|
||||
to="/alumno/informar-pago"
|
||||
to="/student/report-payment"
|
||||
className="mt-4 flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"
|
||||
>
|
||||
<Receipt className="size-5" aria-hidden="true" />
|
||||
|
||||
@@ -34,7 +34,7 @@ export function NextClassCard({ item, timeZone }: NextClassCardProps) {
|
||||
</p>
|
||||
) : (
|
||||
<Link
|
||||
to="/alumno/avisar"
|
||||
to="/student/notify-absence"
|
||||
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"
|
||||
>
|
||||
|
||||
@@ -33,10 +33,10 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
|
||||
<FlowDone title={`Listo, le avisamos a ${teacher}`}>
|
||||
<p className="text-sm text-secondary">Si cambiás de idea, podés deshacerlo desde Clases mientras la clase no haya empezado.</p>
|
||||
<div className="space-y-2 pt-2">
|
||||
<Link to="/alumno" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong">
|
||||
<Link to="/student" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong">
|
||||
Volver al inicio
|
||||
</Link>
|
||||
<Link to="/alumno/clases" className="flex min-h-12 items-center justify-center rounded-xl border border-border font-medium text-primary hover:bg-primary-soft">
|
||||
<Link to="/student/classes" className="flex min-h-12 items-center justify-center rounded-xl border border-border font-medium text-primary hover:bg-primary-soft">
|
||||
Ver mis clases
|
||||
</Link>
|
||||
</div>
|
||||
@@ -61,7 +61,7 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<Link to="/alumno" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex">
|
||||
<Link to="/student" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex">
|
||||
<ArrowLeft className="size-4" aria-hidden="true" />
|
||||
Volver
|
||||
</Link>
|
||||
|
||||
@@ -34,7 +34,7 @@ export function ReportPaymentView() {
|
||||
<p className="text-sm text-secondary">
|
||||
{teacher} va a revisar el comprobante. Te avisamos acá cuando lo confirme.
|
||||
</p>
|
||||
<Link to="/alumno" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong">
|
||||
<Link to="/student" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong">
|
||||
Volver al inicio
|
||||
</Link>
|
||||
</FlowDone>
|
||||
@@ -63,7 +63,7 @@ export function ReportPaymentView() {
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<Link to="/alumno/pagos" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex">
|
||||
<Link to="/student/payments" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex">
|
||||
<ArrowLeft className="size-4" aria-hidden="true" />
|
||||
Volver
|
||||
</Link>
|
||||
|
||||
@@ -94,7 +94,7 @@ function useReportPayment(attendeeId: string | null) {
|
||||
}
|
||||
|
||||
/* State of the student app: the session ("me"), the selected attendee and its
|
||||
classes and fees. Without a session (401) it sends the student to /acceso. */
|
||||
classes and fees. Without a session (401) it sends the student to /access. */
|
||||
export function StudentAppProvider({ children }: { children: ReactNode }) {
|
||||
const navigate = useNavigate()
|
||||
const queryClient = useQueryClient()
|
||||
@@ -104,7 +104,7 @@ export function StudentAppProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (meQuery.error instanceof ApiError && meQuery.error.status === 401) {
|
||||
void navigate({ to: '/acceso', replace: true })
|
||||
void navigate({ to: '/access', replace: true })
|
||||
}
|
||||
}, [meQuery.error, navigate])
|
||||
|
||||
@@ -145,7 +145,7 @@ export function StudentAppProvider({ children }: { children: ReactNode }) {
|
||||
mutationFn: logoutStudent,
|
||||
onSettled: async () => {
|
||||
queryClient.removeQueries({ queryKey: ['student'] })
|
||||
await navigate({ to: '/acceso', replace: true })
|
||||
await navigate({ to: '/access', replace: true })
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export function StudentClassesView() {
|
||||
</div>
|
||||
|
||||
<Link
|
||||
to="/alumno/avisar"
|
||||
to="/student/notify-absence"
|
||||
className="flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"
|
||||
>
|
||||
<CalendarX2 className="size-5" aria-hidden="true" />
|
||||
|
||||
@@ -34,7 +34,7 @@ export function StudentLayout() {
|
||||
<div className="flex justify-center py-20" role="status" aria-label="Cargando">
|
||||
<Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" />
|
||||
</div>
|
||||
) : !student && !location.pathname.startsWith('/alumno/perfil') ? (
|
||||
) : !student && !location.pathname.startsWith('/student/profile') ? (
|
||||
<div className="mt-10 space-y-3 rounded-2xl border border-border bg-surface p-6 text-center">
|
||||
<UserX className="mx-auto size-8 text-foreground" aria-hidden="true" />
|
||||
<h1 className="text-lg font-bold text-primary">No tenés grupos activos</h1>
|
||||
|
||||
@@ -69,7 +69,7 @@ export function StudentPaymentsView() {
|
||||
)}
|
||||
{canReport ? (
|
||||
<Link
|
||||
to="/alumno/informar-pago"
|
||||
to="/student/report-payment"
|
||||
className="flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"
|
||||
>
|
||||
<Receipt className="size-5" aria-hidden="true" />
|
||||
|
||||
@@ -13,7 +13,7 @@ export function WelcomeView() {
|
||||
const [email, setEmail] = useState('')
|
||||
|
||||
const goHome = () =>
|
||||
finishWelcome.mutate(undefined, { onSettled: () => void navigate({ to: '/alumno', replace: true }) })
|
||||
finishWelcome.mutate(undefined, { onSettled: () => void navigate({ to: '/student', replace: true }) })
|
||||
|
||||
const handleContinue = () => {
|
||||
const value = email.trim()
|
||||
|
||||
@@ -3,17 +3,17 @@ import type { NavItem } from '../../components/layout/nav-items'
|
||||
|
||||
// Bottom nav of the student app: the single source for StudentBottomNav.
|
||||
export const STUDENT_NAV_ITEMS: NavItem[] = [
|
||||
{ label: 'Inicio', to: '/alumno', icon: Home },
|
||||
{ label: 'Clases', to: '/alumno/clases', icon: CalendarDays },
|
||||
{ label: 'Pagos', to: '/alumno/pagos', icon: Wallet },
|
||||
{ label: 'Perfil', to: '/alumno/perfil', icon: User },
|
||||
{ label: 'Inicio', to: '/student', icon: Home },
|
||||
{ label: 'Clases', to: '/student/classes', icon: CalendarDays },
|
||||
{ label: 'Pagos', to: '/student/payments', icon: Wallet },
|
||||
{ label: 'Perfil', to: '/student/profile', icon: User },
|
||||
]
|
||||
|
||||
/* Flow screens with their own fixed bottom button: no nav there. */
|
||||
export const STUDENT_FLOW_PATHS = ['/alumno/bienvenida', '/alumno/avisar', '/alumno/informar-pago']
|
||||
export const STUDENT_FLOW_PATHS = ['/student/welcome', '/student/notify-absence', '/student/report-payment']
|
||||
|
||||
export function isStudentNavItemActive(pathname: string, to: string): boolean {
|
||||
const path = pathname.replace(/\/$/, '') || '/'
|
||||
if (to === '/alumno') return path === '/alumno'
|
||||
if (to === '/student') return path === '/student'
|
||||
return path === to || path.startsWith(`${to}/`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user