mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +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:
@@ -207,6 +207,9 @@ export default function AdminPaymentMethodEdit() {
|
||||
</div>
|
||||
<button
|
||||
onClick={() => setIsEnabled(!isEnabled)}
|
||||
role="switch"
|
||||
aria-checked={isEnabled}
|
||||
aria-label={t('admin.paymentMethods.methodEnabled')}
|
||||
className={`relative h-6 w-11 rounded-full transition-colors ${
|
||||
isEnabled ? 'bg-accent-500' : 'bg-dark-600'
|
||||
}`}
|
||||
@@ -234,6 +237,8 @@ export default function AdminPaymentMethodEdit() {
|
||||
</div>
|
||||
<button
|
||||
onClick={() => setOpenUrlDirect(!openUrlDirect)}
|
||||
role="switch"
|
||||
aria-checked={openUrlDirect}
|
||||
className={`relative h-6 w-11 shrink-0 rounded-full transition-colors ${
|
||||
openUrlDirect ? 'bg-accent-500' : 'bg-dark-600'
|
||||
}`}
|
||||
|
||||
Reference in New Issue
Block a user