Skip to content

Commit 75a1089

Browse files
authored
Added extra Prop to add any prop directly to lighbox.
`lightBoxProps`, which is spread over `<LightBox />` component. So It will be easy to add those props to LightBox Directly which are not hardcoded in.
1 parent 22bf730 commit 75a1089

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Gallery.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ class Gallery extends Component {
305305
theme={this.props.theme}
306306
onClickThumbnail={this.getOnClickLightboxThumbnailFn()}
307307
showThumbnails={this.props.showLightboxThumbnails}
308+
...this.props.lightBoxProps
308309
/>
309310
</div>
310311
);
@@ -367,7 +368,8 @@ Gallery.propTypes = {
367368
showLightboxThumbnails: PropTypes.bool,
368369
onClickLightboxThumbnail: PropTypes.func,
369370
tagStyle: PropTypes.object,
370-
thumbnailImageComponent: PropTypes.func
371+
thumbnailImageComponent: PropTypes.func,
372+
lightBoxProps : PropTypes.object,
371373
};
372374

373375
Gallery.defaultProps = {
@@ -386,6 +388,7 @@ Gallery.defaultProps = {
386388
showImageCount: true,
387389
lightboxWidth: 1024,
388390
showLightboxThumbnails: false,
391+
lightBoxProps : {},
389392
};
390393

391394
module.exports = Gallery;

0 commit comments

Comments
 (0)