fix(mobile): Sprint S — tap targets 44px + iOS safe-area
All checks were successful
CI / test (pull_request) Successful in 2m36s
All checks were successful
CI / test (pull_request) Successful in 2m36s
Polish final mobile :
1. /panier sticky cart drawer respecte la safe-area iOS Safari (notch +
home indicator) :
- bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem))
- Fallback à 0.75rem (équivalent ancien bottom-3) sur les navigateurs
sans env().
2. AddToCart inputs et boutons remontés à min-h-44px (guideline Apple/
Material) :
- 2 date pickers + qty number : min-h-[44px] px-3 py-2 text-base
- inputMode="numeric" sur qty pour clavier optimisé
- 2 CTA buttons (Ajouter / Voir mon panier) : min-h-[44px] py-3
3. Booking form /carbets/[slug] :
- Guest count input : min-h-[44px] px-3 py-2 text-base + inputMode
- CTA Réserver : min-h-[44px] py-3
Avant : inputs/buttons ~36-40px (sous le seuil 44px iOS), text-sm
(14px). Après : 44px+ partout, text-base (16px) sur les inputs où le
user tape → meilleur contraste tactile et le clavier iOS ne zoom plus
(iOS zoome si font-size < 16px).
Pas de tests vitest dédiés (changements purement CSS), mais 89/89
restent verts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
07301ae997
commit
06b01f65e2
3 changed files with 17 additions and 8 deletions
|
|
@ -182,7 +182,8 @@ export function BookingForm({
|
|||
max={capacity}
|
||||
value={guestCount}
|
||||
onChange={(e) => setGuestCount(Math.max(1, Math.min(capacity, Number(e.target.value) || 1)))}
|
||||
className="mt-0.5 w-full rounded-md border border-zinc-300 px-2 py-1.5"
|
||||
inputMode="numeric"
|
||||
className="mt-0.5 block w-full min-h-[44px] rounded-md border border-zinc-300 px-3 py-2 text-base"
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
|
@ -215,7 +216,7 @@ export function BookingForm({
|
|||
type="button"
|
||||
onClick={submit}
|
||||
disabled={!canSubmit}
|
||||
className="w-full rounded-md bg-emerald-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-emerald-700 disabled:opacity-50"
|
||||
className="w-full min-h-[44px] rounded-md bg-emerald-600 px-4 py-3 text-sm font-semibold text-white hover:bg-emerald-700 disabled:opacity-50"
|
||||
>
|
||||
{busy
|
||||
? "Envoi…"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export function AddToCart({ itemId, pricePerDay, deposit, maxQty }: Props) {
|
|||
value={start}
|
||||
min={todayPlus(0)}
|
||||
onChange={(e) => setStart(e.target.value)}
|
||||
className="mt-0.5 w-full rounded-md border border-zinc-300 px-2 py-1.5"
|
||||
className="mt-0.5 block w-full min-h-[44px] rounded-md border border-zinc-300 px-3 py-2 text-base"
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
|
|
@ -60,7 +60,7 @@ export function AddToCart({ itemId, pricePerDay, deposit, maxQty }: Props) {
|
|||
value={end}
|
||||
min={start || todayPlus(1)}
|
||||
onChange={(e) => setEnd(e.target.value)}
|
||||
className="mt-0.5 w-full rounded-md border border-zinc-300 px-2 py-1.5"
|
||||
className="mt-0.5 block w-full min-h-[44px] rounded-md border border-zinc-300 px-3 py-2 text-base"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -73,7 +73,8 @@ export function AddToCart({ itemId, pricePerDay, deposit, maxQty }: Props) {
|
|||
min={1}
|
||||
max={maxQty}
|
||||
onChange={(e) => setQty(Math.max(1, Math.min(maxQty, Number(e.target.value) || 1)))}
|
||||
className="mt-0.5 w-full rounded-md border border-zinc-300 px-2 py-1.5"
|
||||
inputMode="numeric"
|
||||
className="mt-0.5 block w-full min-h-[44px] rounded-md border border-zinc-300 px-3 py-2 text-base"
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
|
@ -97,7 +98,7 @@ export function AddToCart({ itemId, pricePerDay, deposit, maxQty }: Props) {
|
|||
type="button"
|
||||
onClick={onAdd}
|
||||
disabled={alreadyInCart || nights === 0}
|
||||
className="w-full rounded-md bg-emerald-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-emerald-700 disabled:opacity-50"
|
||||
className="w-full min-h-[44px] rounded-md bg-emerald-600 px-4 py-3 text-sm font-semibold text-white hover:bg-emerald-700 disabled:opacity-50"
|
||||
>
|
||||
{alreadyInCart ? "Déjà dans le panier" : "Ajouter au panier"}
|
||||
</button>
|
||||
|
|
@ -108,7 +109,7 @@ export function AddToCart({ itemId, pricePerDay, deposit, maxQty }: Props) {
|
|||
</div>
|
||||
<Link
|
||||
href="/panier"
|
||||
className="block w-full rounded-md bg-emerald-600 px-4 py-2.5 text-center text-sm font-semibold text-white hover:bg-emerald-700"
|
||||
className="block w-full min-h-[44px] rounded-md bg-emerald-600 px-4 py-3 text-center text-sm font-semibold text-white hover:bg-emerald-700"
|
||||
>
|
||||
Voir mon panier
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -113,7 +113,14 @@ export function CartReview({ lines }: { lines: Line[] }) {
|
|||
</section>
|
||||
))}
|
||||
|
||||
<aside className="sticky bottom-3 z-10 rounded-lg border border-zinc-200 bg-white p-4 shadow-md">
|
||||
<aside
|
||||
className="sticky z-10 rounded-lg border border-zinc-200 bg-white p-4 shadow-md"
|
||||
style={{
|
||||
// iOS Safari : tient compte de la safe-area (home indicator).
|
||||
// Fallback à 0.75rem (= bottom-3) sur les navigateurs sans env().
|
||||
bottom: "max(0.75rem, env(safe-area-inset-bottom, 0.75rem))",
|
||||
}}
|
||||
>
|
||||
<dl className="space-y-1 text-sm">
|
||||
<div className="flex justify-between">
|
||||
<dt>Total location</dt>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue