From efdc4b2f6f307ce7e436312f4e506615fef39061 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 12:09:46 -0400 Subject: [PATCH] Altas #4 - Refactoring RelatedMedia to work with IIIF Collection manifest --- .../core-data/src/components/MediaGallery.js | 33 +++------- .../core-data/src/components/RelatedMedia.js | 63 ++++++++++++++----- packages/core-data/src/services/Places.js | 2 +- 3 files changed, 57 insertions(+), 41 deletions(-) diff --git a/packages/core-data/src/components/MediaGallery.js b/packages/core-data/src/components/MediaGallery.js index 2a78926f..c16e5451 100644 --- a/packages/core-data/src/components/MediaGallery.js +++ b/packages/core-data/src/components/MediaGallery.js @@ -2,25 +2,19 @@ import * as Dialog from '@radix-ui/react-dialog'; import Viewer from '@samvera/clover-iiif/viewer'; -import { Image, X } from 'lucide-react'; +import { X } from 'lucide-react'; import React from 'react'; -import type { MediaContent } from '../types/MediaContent'; type Props = { /** - * The MediaContent record contain the IIIF manifest URL. + * URL of the IIIF manifest to render. */ - defaultItem: MediaContent, + manifestUrl: string, /** * Callback fired when the dialog is closed. */ - onClose: () => void, - - /** - * Title text to display at the top of the dialog. - */ - title?: string + onClose: () => void }; /** @@ -28,9 +22,8 @@ type Props = { */ const MediaGallery = (props: Props) => ( ( - - - { props.title } -
- { Boolean(props.defaultItem) && ( + { props.manifestUrl && ( @@ -65,6 +51,7 @@ const MediaGallery = (props: Props) => ( asChild >