Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FW-5924-long-image-descriptions-layout #595

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 7 additions & 22 deletions src/components/ImageWithLightbox/ImageWithLightboxPresentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ function ImageWithLightboxPresentation({
const [lightboxOpen, setLightboxOpen] = useState(false)
return (
<>
<button
type="button"
onClick={() => setLightboxOpen(true)}
className="relative group flex"
>
<button type="button" onClick={() => setLightboxOpen(true)} className="relative group flex">
<img
className={imgStyling}
src={getMediaPath({
Expand All @@ -33,17 +29,14 @@ function ImageWithLightboxPresentation({
{withIcon &&
getIcon(
'InfoCircleSolid',
'absolute bottom-2 right-2 p-1 w-6 h-6 text-white fill-current opacity-60 group-hover:opacity-100',
'absolute bottom-2 right-2 p-1 w-6 h-6 text-white fill-current opacity-60 group-hover:opacity-100'
)}
</button>
{/* Lightbox Modal */}
<Modal.Presentation
isOpen={lightboxOpen}
closeHandler={() => setLightboxOpen(false)}
>
<Modal.Presentation isOpen={lightboxOpen} closeHandler={() => setLightboxOpen(false)}>
<div
id="ImageWithLightboxPresentation"
className="inline-block text-white transform transition-all align-middle max-w-2xl lg:max-w-4xl xl:max-w-7xl"
className="inline-block text-white transform transition-all align-middle md:w-2/3 max-w-2xl lg:max-w-4xl xl:max-w-7xl"
>
<img
className="object-contain sm:h-4/5-screen shadow-xl mx-auto"
Expand All @@ -54,17 +47,9 @@ function ImageWithLightboxPresentation({
})}
alt={image?.title}
/>
<div className="mt-1 text-lg md:text-xl font-medium">
{image?.title}
</div>
{image?.description && (
<div className="text-base">{image?.description}</div>
)}
{image?.acknowledgement && (
<div className="text-sm">
Acknowledgement: {image?.acknowledgement}
</div>
)}
<div className="my-1 text-lg md:text-xl font-medium">{image?.title}</div>
{image?.description && <div className="text-base my-2">Description: {image?.description}</div>}
{image?.acknowledgement && <div className="text-sm my-2">Acknowledgement: {image?.acknowledgement}</div>}
</div>
</Modal.Presentation>
</>
Expand Down