Skip to content

Commit

Permalink
fix: toggle styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjozork committed Apr 27, 2024
1 parent c767c81 commit 3b50dd8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer/components/Toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FC } from 'react';
import { twMerge } from 'tailwind-merge';

interface ToggleProps {
value: boolean;
Expand All @@ -16,12 +17,12 @@ export const Toggle: FC<ToggleProps> = ({
onColor = 'bg-cyan-medium',
}) => (
<div
className={`flex h-8 w-14 cursor-pointer items-center rounded-full text-3xl ${bgColor}`}
className={twMerge(`flex h-8 w-14 cursor-pointer items-center rounded-full text-3xl`, bgColor)}
onClick={() => onToggle(!value)}
style={{ transform: `scale(${scale})` }}
>
<div
className={`mx-1.5 size-6 rounded-full bg-gray-400 transition duration-200${value && `${onColor}`}`}
className={twMerge(`mx-1.5 size-6 rounded-full bg-gray-400 transition duration-200`, value && onColor)}
style={{ transform: `translate(${value ? '12px' : '1px'}, 0)` }}
/>
</div>
Expand Down

0 comments on commit 3b50dd8

Please sign in to comment.