From 75a10894779df9974b01897380c8bd4e65035666 Mon Sep 17 00:00:00 2001 From: Jimish Fotariya Date: Mon, 20 May 2019 23:15:56 +0530 Subject: [PATCH 1/2] Added extra Prop to add any prop directly to lighbox. `lightBoxProps`, which is spread over `` component. So It will be easy to add those props to LightBox Directly which are not hardcoded in. --- src/Gallery.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Gallery.js b/src/Gallery.js index 00131ce..e9e6c73 100755 --- a/src/Gallery.js +++ b/src/Gallery.js @@ -305,6 +305,7 @@ class Gallery extends Component { theme={this.props.theme} onClickThumbnail={this.getOnClickLightboxThumbnailFn()} showThumbnails={this.props.showLightboxThumbnails} + ...this.props.lightBoxProps /> ); @@ -367,7 +368,8 @@ Gallery.propTypes = { showLightboxThumbnails: PropTypes.bool, onClickLightboxThumbnail: PropTypes.func, tagStyle: PropTypes.object, - thumbnailImageComponent: PropTypes.func + thumbnailImageComponent: PropTypes.func, + lightBoxProps : PropTypes.object, }; Gallery.defaultProps = { @@ -386,6 +388,7 @@ Gallery.defaultProps = { showImageCount: true, lightboxWidth: 1024, showLightboxThumbnails: false, + lightBoxProps : {}, }; module.exports = Gallery; From d2b36ba27956bc3e86aa47db0111ecdf9e34ea84 Mon Sep 17 00:00:00 2001 From: Jimish Fotariya Date: Sun, 26 May 2019 13:27:31 +0530 Subject: [PATCH 2/2] Jsx Syntax error removed, added brackets --- src/Gallery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gallery.js b/src/Gallery.js index e9e6c73..840ec6c 100755 --- a/src/Gallery.js +++ b/src/Gallery.js @@ -305,7 +305,7 @@ class Gallery extends Component { theme={this.props.theme} onClickThumbnail={this.getOnClickLightboxThumbnailFn()} showThumbnails={this.props.showLightboxThumbnails} - ...this.props.lightBoxProps + {...this.props.lightBoxProps} /> );