diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index a39d9d23..6cb4fa2a 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -128,6 +128,7 @@ export default function Image({ {finalAlt} { - const slides = images.map(({ url, alt }) => ({ - src: url, - alt: alt || url + const slides = images.map(({ url, alt }) => ({ + src: url, + alt: alt || url, + title: alt || undefined })) logger.debug('[ImageGallery] Lightbox slides:', { index, slidesCount: slides.length, slides }) return slides })()} - plugins={[Zoom]} + plugins={[Zoom, Captions]} open={index >= 0} close={() => setIndex(-1)} controller={{ diff --git a/src/components/ImageWithLightbox/index.tsx b/src/components/ImageWithLightbox/index.tsx index 1fc787ab..7d512a8d 100644 --- a/src/components/ImageWithLightbox/index.tsx +++ b/src/components/ImageWithLightbox/index.tsx @@ -7,7 +7,9 @@ import { useEffect, useMemo, useState } from 'react' import { createPortal } from 'react-dom' import { useTranslation } from 'react-i18next' import Lightbox from 'yet-another-react-lightbox' +import Captions from 'yet-another-react-lightbox/plugins/captions' import Zoom from 'yet-another-react-lightbox/plugins/zoom' +import 'yet-another-react-lightbox/plugins/captions.css' import Image from '../Image' export default function ImageWithLightbox({ @@ -73,11 +75,12 @@ export default function ImageWithLightbox({
e.stopPropagation()}> = 0} close={() => setIndex(-1)} controller={{