Skip to content

Commit 43eb122

Browse files
committed
style(image component): added new EnlargeImage component
1 parent 5ced551 commit 43eb122

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const EnlargeImage = ({ src, alt, ariaLabel }) => {
2+
const label = ariaLabel || alt;
3+
4+
return (
5+
<div style={{ textAlign: 'center', margin: '2rem 0' }}>
6+
<a href={src} target="_blank">
7+
<img src={src} alt={label} style={{ maxWidth: '100%', cursor: 'pointer' }} />
8+
</a>
9+
</div>
10+
);
11+
};
12+
13+
export default EnlargeImage;

src/components/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export { default as JsonTable } from './formatting/JsonTable';
1313
// Image components
1414
export { default as CaptionedImage } from './images/CaptionedImage';
1515
export { default as ZoomingImage } from './images/ZoomingImage';
16+
export { default as EnlargeImage } from './images/EnlargeImage';
1617

1718
// Information components
1819
export { default as DiscoverableDisclosure } from './info/DiscoverableDisclosure';

0 commit comments

Comments
 (0)