From 70ee60e51f09d8ca57872a7f9a066d3c6c49f857 Mon Sep 17 00:00:00 2001 From: Tom Hutman Date: Mon, 22 Mar 2021 15:02:07 +0100 Subject: [PATCH 1/2] use source instead of src inside ModalImage because that's what's defined in react-images ViewType --- src/components/Gallery/Gallery.tsx | 1 - src/components/Gallery/ModalImage.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Gallery/Gallery.tsx b/src/components/Gallery/Gallery.tsx index 42170a7253..bcfca8a481 100644 --- a/src/components/Gallery/Gallery.tsx +++ b/src/components/Gallery/Gallery.tsx @@ -39,7 +39,6 @@ const UnMemoizedGallery = < () => images.map((image) => ({ source: image.image_url || image.thumb_url || '', - src: image.image_url || image.thumb_url || '', })), [images], ); diff --git a/src/components/Gallery/ModalImage.tsx b/src/components/Gallery/ModalImage.tsx index 7a5696ed9d..a6fa9a3bc8 100644 --- a/src/components/Gallery/ModalImage.tsx +++ b/src/components/Gallery/ModalImage.tsx @@ -5,14 +5,14 @@ import React from 'react'; */ export type ModalImageProps = { /** The src attribute for the image element */ - data: { src: string }; + data: { source: string }; }; export const ModalImage: React.FC = (props) => { const { data } = props; return (
- +
); }; From d9d10bda3c11b060a5d60a24b031c15d6584f307 Mon Sep 17 00:00:00 2001 From: Tom Hutman Date: Mon, 22 Mar 2021 15:05:37 +0100 Subject: [PATCH 2/2] fix broken close button for gallery --- src/components/Gallery/Gallery.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Gallery/Gallery.tsx b/src/components/Gallery/Gallery.tsx index bcfca8a481..6c56520034 100644 --- a/src/components/Gallery/Gallery.tsx +++ b/src/components/Gallery/Gallery.tsx @@ -80,7 +80,7 @@ const UnMemoizedGallery = < images={formattedArray} index={index} modalIsOpen={modalOpen} - toggleModal={() => toggleModal} + toggleModal={() => setModalOpen(!modalOpen)} /> );