feat(web): redesign onboarding and home after design critique

Onboarding:
- Keep the current step in ?step= so the device back gesture moves one
  step back; effectiveStep guards skipping the plan and re-opening the
  group form after the group exists. Show Back on mobile.
- Format prices with the chosen country's currency (form prefix and
  confirmation).
- Welcome describes the real flow and previews the WhatsApp payment
  reminder; the last step shares the group's invite link instead of
  listing settings chores.
- Accessibility: named stepper steps with aria-current, focus moves to
  the new step heading, alerts on errors, reduced-motion and
  direction-aware step animation, 48px primary actions.
- Group form split into "classes" and "billing", due day hidden for
  per-class billing; Stripe skips the empty Pro confirmation; Free
  features read "in Pro" instead of struck through.

Home:
- Payments section follows the plan: Free gets a locked preview with
  an upgrade link and is never asked to link Mercado Pago.
- Secondary text meets 4.5:1 contrast; accent-fg for links in dark.
- Class times use a 24h clock in Spanish and Portuguese.
- Drop the summary tiles; one hero for the current or next class, the
  rest of the day as compact rows; two columns on desktop.
- "Para atender" reads the shared ['attention'] query, so resolved
  alerts match "Requiere atención", with WhatsApp shortcuts and a link
  to the full list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-11-06 09:58:08 -03:00
parent 70ef049f34
commit 2d80af082f
48 changed files with 1507 additions and 784 deletions

View File

@@ -1,45 +1,37 @@
import { useNavigate } from '@tanstack/react-router'
import { Link } from '@tanstack/react-router'
import type { NextClassDto } from '@gruperly/shared'
import { CalendarClock } from 'lucide-react'
import { ChevronRight } from 'lucide-react'
import { useTranslation } from 'react-i18next'
import { Badge, Button } from '../../components/ui'
import { Badge } from '../../components/ui'
import { formatRelativeDateTime, formatSchedule } from '../../lib/format'
/** El hero cuando hoy ya no queda ninguna clase por dar: la próxima, sea cuando sea. */
export function NextClassHero({ nextClass }: { nextClass: NextClassDto }) {
const navigate = useNavigate()
const { t } = useTranslation('home')
const hasSchedule = (nextClass.days?.length ?? 0) > 0
return (
<article className="relative overflow-hidden rounded-xl border border-accent/30 bg-surface p-5">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4">
<div className="min-w-0">
<p className="text-xs font-medium uppercase tracking-wide text-foreground/50">
{nextClass.isNow ? t('nextClass.now') : t('nextClass.next')}
</p>
<h2 className="mt-1 truncate text-xl font-bold text-primary">{nextClass.name}</h2>
{hasSchedule ? (
<div className="mt-2 flex items-center gap-2 text-sm text-foreground/70">
<CalendarClock className="size-4 shrink-0 text-accent" />
<span>{formatSchedule(nextClass.days ?? [], nextClass.time)}</span>
</div>
) : null}
</div>
<div className="flex shrink-0 items-center gap-2">
<Badge variant={nextClass.isNow ? 'success' : 'neutral'}>
{nextClass.isNow ? t('nextClass.nowBadge') : formatRelativeDateTime(nextClass.occurrenceAt)}
</Badge>
</div>
<Link
to="/groups/$groupId"
params={{ groupId: nextClass.groupId }}
className="group block rounded-2xl border border-border bg-surface p-5 transition-colors hover:border-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"
>
<div className="flex items-start justify-between gap-3">
<h2 className="min-w-0 truncate text-xl font-bold text-primary">{nextClass.name}</h2>
<ChevronRight
className="mt-1 size-5 shrink-0 text-foreground transition-transform group-hover:translate-x-0.5 motion-reduce:transition-none"
aria-hidden="true"
/>
</div>
<div className="mt-4 flex justify-end border-t border-border pt-3">
<Button
variant="outline"
size="sm"
onClick={() => void navigate({ to: `/groups/${nextClass.groupId}` })}
>
{t('nextClass.seeGroup')}
</Button>
</div>
</article>
<p className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[0.9375rem] font-medium text-primary">
<span>{nextClass.isNow ? t('nextClass.now') : t('nextClass.next')}</span>
<Badge variant={nextClass.isNow ? 'success' : 'neutral'}>
{nextClass.isNow ? t('nextClass.nowBadge') : formatRelativeDateTime(nextClass.occurrenceAt)}
</Badge>
</p>
{hasSchedule ? (
<p className="mt-1 text-sm text-foreground">{formatSchedule(nextClass.days ?? [], nextClass.time)}</p>
) : null}
</Link>
)
}
}