From bde2c8cd374de597124d5c0bbf3702a97e41efdf Mon Sep 17 00:00:00 2001 From: druzzt Date: Mon, 26 Feb 2018 11:23:07 +0100 Subject: [PATCH 1/3] ResizeModes from props --- index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index dd1b6e8..f94f3e2 100644 --- a/index.js +++ b/index.js @@ -27,22 +27,23 @@ export default class ProgressiveImage extends Component { } render() { + const { placeholderResizeMode, thumbnailResizeMode, imageResizeMode } = this.props; return ( this.onLoadThumbnail()} blurRadius={this.props.thumbnailBlurRadius} /> this.onLoadImage()} @@ -72,6 +73,9 @@ ProgressiveImage.propTypes = { thumbnailSource: PropTypes.object.isRequired, thumbnailFadeDuration: PropTypes.number.isRequired, thumbnailBlurRadius: PropTypes.number, + placeholderResizeMode: PropTypes.string, + thumbnailResizeMode: PropTypes.string, + imageResizeMode: PropTypes.string, } ProgressiveImage.defaultProps = { @@ -80,4 +84,7 @@ ProgressiveImage.defaultProps = { thumbnailBlurRadius: 5, onLoadThumbnail: Function.prototype, onLoadImage: Function.prototype, + placeholderResizeMode: 'cover', + thumbnailResizeMode: 'cover', + imageResizeMode: 'cover', } From c35b2c86b4c5ae5935f75b5897201229e2a8324e Mon Sep 17 00:00:00 2001 From: druzzt Date: Sun, 20 May 2018 21:03:48 +0200 Subject: [PATCH 2/3] Update index.js --- index.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index f94f3e2..d37280c 100644 --- a/index.js +++ b/index.js @@ -64,18 +64,19 @@ export default class ProgressiveImage extends Component { }) ProgressiveImage.propTypes = { - placeHolderColor: PropTypes.string, - placeHolderSource: PropTypes.number, - imageSource: PropTypes.object.isRequired, - imageFadeDuration: PropTypes.number.isRequired, - onLoadThumbnail: PropTypes.func.isRequired, - onLoadImage: PropTypes.func.isRequired, - thumbnailSource: PropTypes.object.isRequired, - thumbnailFadeDuration: PropTypes.number.isRequired, - thumbnailBlurRadius: PropTypes.number, - placeholderResizeMode: PropTypes.string, - thumbnailResizeMode: PropTypes.string, - imageResizeMode: PropTypes.string, +// Due to errors of PropTypes between RN versions +// placeHolderColor: PropTypes.string, +// placeHolderSource: PropTypes.number, +// imageSource: PropTypes.object.isRequired, +// imageFadeDuration: PropTypes.number.isRequired, +// onLoadThumbnail: PropTypes.func.isRequired, +// onLoadImage: PropTypes.func.isRequired, +// thumbnailSource: PropTypes.object.isRequired, +// thumbnailFadeDuration: PropTypes.number.isRequired, +// thumbnailBlurRadius: PropTypes.number, +// placeholderResizeMode: PropTypes.string, +// thumbnailResizeMode: PropTypes.string, +// imageResizeMode: PropTypes.string, } ProgressiveImage.defaultProps = { From 140fb72978a3f18b6062b4e1020df8c401b00428 Mon Sep 17 00:00:00 2001 From: druzzt Date: Mon, 9 Jul 2018 10:24:57 +0200 Subject: [PATCH 3/3] Update index.js --- index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d37280c..0c39ebe 100644 --- a/index.js +++ b/index.js @@ -28,8 +28,11 @@ export default class ProgressiveImage extends Component { render() { const { placeholderResizeMode, thumbnailResizeMode, imageResizeMode } = this.props; + const { children, style, imageStyle, imageRef, ...props } = this.props; return ( - + this.onLoadThumbnail()} blurRadius={this.props.thumbnailBlurRadius} /> this.onLoadImage()} />