mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 10:27:49 +00:00
Fix Toggle animation: use translate-x instead of left position
This commit is contained in:
@@ -13,8 +13,8 @@ export function Toggle({ checked, onChange, disabled }: ToggleProps) {
|
|||||||
checked ? 'bg-accent-500' : 'bg-dark-600'
|
checked ? 'bg-accent-500' : 'bg-dark-600'
|
||||||
} ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}
|
} ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}
|
||||||
>
|
>
|
||||||
<div className={`absolute top-1 w-4 h-4 bg-white rounded-full transition-transform ${
|
<div className={`absolute top-1 left-1 w-4 h-4 bg-white rounded-full transition-transform duration-200 ${
|
||||||
checked ? 'left-7' : 'left-1'
|
checked ? 'translate-x-6' : 'translate-x-0'
|
||||||
}`} />
|
}`} />
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user