Skip to content

Commit

Permalink
✨ Clicking an image opens it in a new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
mglyrasis committed Jun 20, 2024
1 parent f76473f commit 705799c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/detail/ImageGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ const getInstitutionIds = () => {
return (institutionsConfig ? Object.keys(institutionsConfig) : []);
};

const handleImageClick = (event) => {
const imageUrl = event.target.src;
window.open(imageUrl, '_blank');
}

class ImageGallery extends Component {
componentDidMount() {
this.findMedia();
Expand Down Expand Up @@ -135,6 +140,7 @@ class ImageGallery extends Component {
<Gallery
disableArrowKeys
items={items}
onClick={handleImageClick)
showFullscreenButton={false}
showPlayButton={false}
showThumbnails={items.length > 1}
Expand Down

0 comments on commit 705799c

Please sign in to comment.