mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 10:27:49 +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:
@@ -855,6 +855,9 @@ export default function AdminTariffCreate() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setTrafficTopupEnabled(!trafficTopupEnabled)}
|
||||
role="switch"
|
||||
aria-checked={trafficTopupEnabled}
|
||||
aria-label={t('admin.tariffs.extraTrafficTitle')}
|
||||
className={`relative h-6 w-11 rounded-full transition-colors ${
|
||||
trafficTopupEnabled ? 'bg-accent-500' : 'bg-dark-600'
|
||||
}`}
|
||||
@@ -1117,6 +1120,9 @@ export default function AdminTariffCreate() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setIsActive(!isActive)}
|
||||
role="switch"
|
||||
aria-checked={isActive}
|
||||
aria-label={t('admin.tariffs.isActiveLabel')}
|
||||
className={`relative h-6 w-11 rounded-full transition-colors ${
|
||||
isActive ? 'bg-success-500' : 'bg-dark-600'
|
||||
}`}
|
||||
@@ -1139,6 +1145,9 @@ export default function AdminTariffCreate() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowInGift(!showInGift)}
|
||||
role="switch"
|
||||
aria-checked={showInGift}
|
||||
aria-label={t('admin.tariffs.showInGiftLabel')}
|
||||
className={`relative h-6 w-11 rounded-full transition-colors ${
|
||||
showInGift ? 'bg-accent-500' : 'bg-dark-600'
|
||||
}`}
|
||||
|
||||
Reference in New Issue
Block a user