Skip to content

Commit

Permalink
Merge branch 'preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan committed Mar 15, 2024
2 parents 51d01ef + 45730bf commit 358cb8e
Showing 1 changed file with 49 additions and 47 deletions.
96 changes: 49 additions & 47 deletions src/components/dataDisplay/gallery/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,66 +54,68 @@ export default function Gallery(props: Props) {

return (
<Dialog.Root open={true} onOpenChange={onClose}>
<Dialog.Overlay className="animate-fade animate-duration-200 bg-skin-overlay-muted fixed inset-0 z-50 h-screen w-screen" />
<Dialog.Content
onClick={(e) => {
e.stopPropagation();
onClose();
}}
className="z-50"
>
<Button
className="text-skin-icon-inverted bg-skin-overlay hover:bg-skin-inverted fixed left-3 top-3 z-[70] rounded-full p-3.5"
<Dialog.Portal>
<Dialog.Overlay className="animate-fade animate-duration-200 bg-skin-overlay-muted fixed inset-0 z-50 h-screen w-screen" />
<Dialog.Content
onClick={(e) => {
e.stopPropagation();
onClose();
}}
className="z-50 w-full"
>
<CgClose className="text-xl" />
</Button>
{imageCount > 1 && currentIndex > 0 && (
<Button
className="text-skin-icon-inverted bg-skin-overlay hover:bg-skin-inverted fixed left-3 top-1/2 z-[70] rounded-full p-3.5"
className="text-skin-icon-inverted bg-skin-overlay hover:bg-skin-inverted fixed left-3 top-3 z-[70] rounded-full p-3.5"
onClick={(e) => {
e.stopPropagation();
handleBackward();
onClose();
}}
>
<BiLeftArrowAlt />
<CgClose className="text-xl" />
</Button>
)}
{imageCount > 1 && currentIndex < imageCount - 1 && (
<Button
className="text-skin-icon-inverted bg-skin-overlay hover:bg-skin-inverted fixed right-3 top-1/2 z-[70] rounded-full p-3.5"
onClick={(e) => {
e.stopPropagation();
handleForward();
}}
>
<BiRightArrowAlt />
</Button>
)}
{imageCount > 1 && currentIndex > 0 && (
<Button
className="text-skin-icon-inverted bg-skin-overlay hover:bg-skin-inverted fixed left-3 top-1/2 z-[70] rounded-full p-3.5"
onClick={(e) => {
e.stopPropagation();
handleBackward();
}}
>
<BiLeftArrowAlt />
</Button>
)}
{imageCount > 1 && currentIndex < imageCount - 1 && (
<Button
className="text-skin-icon-inverted bg-skin-overlay hover:bg-skin-inverted fixed right-3 top-1/2 z-[70] rounded-full p-3.5"
onClick={(e) => {
e.stopPropagation();
handleForward();
}}
>
<BiRightArrowAlt />
</Button>
)}

{Array.isArray(images) && (
<Image
src={images[currentIndex].fullsize}
alt={images[currentIndex].alt}
width={images[currentIndex].aspectRatio?.width ?? 900}
height={images[currentIndex].aspectRatio?.height ?? 900}
className="fixed inset-0 z-[60] mx-auto h-full w-fit object-contain"
/>
)}
{Array.isArray(images) && (
<Image
src={images[currentIndex].fullsize}
alt={images[currentIndex].alt}
width={images[currentIndex].aspectRatio?.width ?? 900}
height={images[currentIndex].aspectRatio?.height ?? 900}
className="fixed inset-0 z-[60] mx-auto h-full w-fit object-contain"
/>
)}

{typeof images === "string" && (
<Image
src={images}
alt={"Image"}
width={900}
height={900}
className="fixed inset-0 z-[60] mx-auto h-full w-fit object-contain"
/>
)}
</Dialog.Content>
{typeof images === "string" && (
<Image
src={images}
alt={"Image"}
width={900}
height={900}
className="fixed inset-0 z-[60] mx-auto h-full w-fit object-contain"
/>
)}
</Dialog.Content>
</Dialog.Portal>
</Dialog.Root>
);
}

0 comments on commit 358cb8e

Please sign in to comment.