File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/components/common/switch Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import clsx from 'clsx'
22
33import { handleKeyDown } from '@/utils/handleKeyDown'
44
5- interface SwtichProps {
5+ interface SwitchProps {
66 isOn : boolean
77 disabled ?: boolean
88 label ?: string
@@ -17,7 +17,7 @@ export const Switch = ({
1717 disabled = false ,
1818 label,
1919 onToggle,
20- } : SwtichProps ) : JSX . Element => {
20+ } : SwitchProps ) : JSX . Element => {
2121 const buttonClass = clsx (
2222 'relative inline-flex h-30 w-50 items-center rounded-full transition-colors duration-300' ,
2323 isOn ? 'bg-primary-normal' : 'bg-gray-300' ,
@@ -33,7 +33,8 @@ export const Switch = ({
3333 < label className = { containerClass } >
3434 < div
3535 role = 'button'
36- aria-label = 'toggle button'
36+ aria-label = { `toggle button ${ isOn ? 'on' : 'off' } ` }
37+ aria-pressed = { isOn }
3738 tabIndex = { 0 }
3839 onClick = { ! disabled ? onToggle : undefined }
3940 onKeyDown = { e => handleKeyDown ( e , onToggle , disabled ) }
You can’t perform that action at this time.
0 commit comments