fix(SW-842): fixed close button positioning

This commit is contained in:
Erik Tiekstra
2024-11-14 07:51:06 +01:00
parent 692320bd61
commit cc7f4e0478
10 changed files with 37 additions and 31 deletions

View File

@@ -1,7 +1,8 @@
"use client"
import { AnimatePresence, motion } from "framer-motion"
import { useIntl } from "react-intl"
import { ChevronRightIcon } from "@/components/Icons"
import { ChevronLeftIcon } from "@/components/Icons"
import ArrowRightIcon from "@/components/Icons/ArrowRight"
import CloseIcon from "@/components/Icons/Close"
import Image from "@/components/Image"
@@ -19,6 +20,7 @@ export default function Gallery({
onImageClick,
selectedImage,
}: GalleryProps) {
const intl = useIntl()
const mainImage = selectedImage || images[0]
const mainImageIndex = images.findIndex((img) => img === mainImage)
@@ -46,16 +48,17 @@ export default function Gallery({
<Button
intent="text"
size="small"
theme="base"
variant="icon"
className={styles.desktopGalleryCloseButton}
className={styles.closeButton}
onClick={onClose}
aria-label={intl.formatMessage({ id: "Close" })}
>
<CloseIcon
<ChevronLeftIcon
color="black"
width={32}
height={32}
className={styles.desktopGalleryCloseIcon}
className={styles.mobileCloseIcon}
/>
<CloseIcon width={32} height={32} className={styles.desktopCloseIcon} />
</Button>
{/* Desktop Gallery */}
<div className={styles.desktopGallery}>
@@ -129,19 +132,6 @@ export default function Gallery({
{/* Mobile Gallery */}
<div className={styles.mobileGallery}>
<Button
intent="text"
size="small"
className={styles.mobileGalleryCloseButton}
onClick={onClose}
>
<ChevronRightIcon
color="black"
width={32}
height={32}
className={styles.leftTransformIcon}
/>
</Button>
<div className={styles.mobileGalleryContent}>
<div className={styles.thumbnailGrid}>
{images.map((image, index) => (