Skip to content

Commit

Permalink
Redesign torch button
Browse files Browse the repository at this point in the history
  • Loading branch information
GovernmentPlates committed Aug 20, 2024
1 parent 1b6009f commit 475e90c
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/Components/QrScanner/TorchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,31 @@ export function TorchButton({html5CustomScanner, canUseCamera}: TorchButtonProps
Your device's torch is unavailable
</span>
</div>
<div className="mt-4 flex justify-center">
<div className="inline-flex cursor-not-allowed rounded-full bg-gray-200 text-gray-500">
<BoltSlashIcon className="mx-2 my-2 h-16 w-16" />
</div>
</div>
</>
);
}

return (
<div className="mt-4 flex justify-center">
<>
<div
onClick={() => setTorchOn(prev => !prev)}
className="inline-flex cursor-pointer rounded-full bg-primary text-white"
className="fit-content flex justify-center gap-1 bg-primary py-3 text-center text-white"
>
{torchOn ? (
<BoltSlashIcon className="mx-2 my-2 h-16 w-16" />
) : (
<BoltIcon className="mx-2 my-2 h-16 w-16" />
)}
<span className="flex items-center">
{torchOn ? (
<>
<BoltSlashIcon className="mr-1 h-6 w-6" />
Turn torch off
</>
) : (
<>
<BoltIcon className="mr-1 h-6 w-6" />
Turn torch on
</>
)}
</span>
</div>
</div>
</>
);
}

Expand Down

0 comments on commit 475e90c

Please sign in to comment.