mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
fix(a11y): switch semantics for admin form toggles
Add role=switch + aria-checked + aria-label to 12 ad-hoc toggle buttons across admin create/edit forms (AdminCampaignCreate/Edit, AdminPromocodeCreate, AdminPromoGroupCreate, AdminPromoOfferTemplateEdit, AdminPaymentMethodEdit, AdminTariffCreate) so screen readers announce on/off state (WCAG 4.1.2).
This commit is contained in:
@@ -469,6 +469,9 @@ export default function AdminPromocodeCreate() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setIsActive(!isActive)}
|
||||
role="switch"
|
||||
aria-checked={isActive}
|
||||
aria-label={t('admin.promocodes.form.active')}
|
||||
className={`relative h-6 w-10 rounded-full transition-colors ${
|
||||
isActive ? 'bg-accent-500' : 'bg-dark-600'
|
||||
}`}
|
||||
@@ -486,6 +489,9 @@ export default function AdminPromocodeCreate() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setFirstPurchaseOnly(!firstPurchaseOnly)}
|
||||
role="switch"
|
||||
aria-checked={firstPurchaseOnly}
|
||||
aria-label={t('admin.promocodes.form.firstPurchaseOnly')}
|
||||
className={`relative h-6 w-10 rounded-full transition-colors ${
|
||||
firstPurchaseOnly ? 'bg-accent-500' : 'bg-dark-600'
|
||||
}`}
|
||||
|
||||
Reference in New Issue
Block a user