refactor: cleanup

This commit is contained in:
trafficlunar 2025-04-08 22:51:43 +01:00
parent a0ea8c2646
commit 4a65994d35
2 changed files with 71 additions and 71 deletions

View file

@ -25,7 +25,7 @@ export default function Carousel({ images, className }: Props) {
const scrollNext = useCallback(() => emblaApi && emblaApi.scrollNext(), [emblaApi]);
return (
<div className="relative max-w-lg h-fit">
<div className="relative w-full h-fit">
<div className={`overflow-hidden rounded-xl bg-zinc-300 border-2 border-zinc-300 ${className}`} ref={emblaRef}>
<div className="flex">
{images.map((src, index) => (

View file

@ -104,7 +104,8 @@ export default function QrScanner({ isOpen, setIsOpen, setQrBytesRaw }: Props) {
requestRef.current = requestAnimationFrame(scanQRCode);
}, [permissionGranted]);
if (isOpen)
if (!isOpen) return null;
return (
<div className="fixed inset-0 flex items-center justify-center z-40 backdrop-brightness-75 backdrop-blur-xs">
<div className="bg-orange-50 border-2 border-amber-500 rounded-2xl shadow-lg p-6 w-full max-w-md">
@ -181,5 +182,4 @@ export default function QrScanner({ isOpen, setIsOpen, setQrBytesRaw }: Props) {
</div>
</div>
);
else return null;
}