From ae7d67b6cef043eb16e106bb9e35aebd889be490 Mon Sep 17 00:00:00 2001 From: Youkyoung Park Date: Fri, 6 Jul 2018 01:35:14 +0900 Subject: [PATCH 1/6] add PropTypes, defautProps to LazyLoadImage.jsx --- src/components/LazyLoadImage.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/LazyLoadImage.jsx b/src/components/LazyLoadImage.jsx index 2e492bc..98ce1ae 100644 --- a/src/components/LazyLoadImage.jsx +++ b/src/components/LazyLoadImage.jsx @@ -102,11 +102,14 @@ class LazyLoadImage extends React.Component { LazyLoadImage.propTypes = { afterLoad: PropTypes.func, effect: PropTypes.string, - placeholderSrc: PropTypes.string + placeholderSrc: PropTypes.string, + wrapperClassName: PropTypes.string }; LazyLoadImage.defaultProps = { afterLoad: () => ({}), + wrapperClassName: '', + placeholderSrc: '', effect: '' }; From 8111ef67a8a56fe045a3a5e954ad2bb461d7da56 Mon Sep 17 00:00:00 2001 From: Youkyoung Park Date: Sat, 28 Jul 2018 14:57:59 +0900 Subject: [PATCH 2/6] add PropTypes, defautProps to LazyLoadImage.jsx --- src/components/LazyLoadImage.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/LazyLoadImage.jsx b/src/components/LazyLoadImage.jsx index 98ce1ae..89c0103 100644 --- a/src/components/LazyLoadImage.jsx +++ b/src/components/LazyLoadImage.jsx @@ -101,16 +101,26 @@ class LazyLoadImage extends React.Component { LazyLoadImage.propTypes = { afterLoad: PropTypes.func, + beforeLoad: PropTypes.func, + delayMethod: PropTypes.string, + delayTime: PropTypes.number, effect: PropTypes.string, placeholderSrc: PropTypes.string, + threshold: PropTypes.number, + visibleByDefault: PropTypes.bool, wrapperClassName: PropTypes.string }; LazyLoadImage.defaultProps = { afterLoad: () => ({}), - wrapperClassName: '', + beforeLoad: () => ({}), + delayMethod: 'throttle', + delayTime: 300, + effect: '', placeholderSrc: '', - effect: '' + threshold: 100, + visibleByDefault: false, + wrapperClassName: '' }; export default LazyLoadImage; From c32c8389fccba2b7e6bcfb28a179b0351c6e6862 Mon Sep 17 00:00:00 2001 From: Youkyoung Park Date: Sat, 28 Jul 2018 22:41:24 +0900 Subject: [PATCH 3/6] add jest configuration in package.json --- package.json | 6 +++++- src/components/LazyLoadImage.spec.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7f4543a..4c5b6c3 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,10 @@ "start": "webpack --watch", "build": "webpack" }, + "jest": { + "verbose": true, + "testURL": "http://localhost/" + }, "repository": { "type": "git", "url": "git+https://github.com/Aljullu/react-lazy-load-image-component.git" @@ -61,4 +65,4 @@ "url": "https://github.com/Aljullu/react-lazy-load-image-component/issues" }, "homepage": "https://github.com/Aljullu/react-lazy-load-image-component#readme" -} +} \ No newline at end of file diff --git a/src/components/LazyLoadImage.spec.js b/src/components/LazyLoadImage.spec.js index 1768f32..d7106db 100644 --- a/src/components/LazyLoadImage.spec.js +++ b/src/components/LazyLoadImage.spec.js @@ -25,7 +25,7 @@ describe('LazyLoadImage', function() { placeholder: null, scrollPosition: {x: 0, y: 0}, style: {}, - src: 'lorem-ipsum.jpg', + src: 'http://localhost/lorem-ipsum.jpg', visibleByDefault: false }; const lazyLoadImage = mount( From e3349e092af7545e80ca9a85cda6ef8660acca09 Mon Sep 17 00:00:00 2001 From: Youkyoung Park Date: Sun, 29 Jul 2018 23:10:58 +0900 Subject: [PATCH 4/6] Rollback to previous state - package.json - LazyLoadImage.spec.js --- package.json | 4 ---- src/components/LazyLoadImage.spec.js | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/package.json b/package.json index 4c5b6c3..7b10c08 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,6 @@ "start": "webpack --watch", "build": "webpack" }, - "jest": { - "verbose": true, - "testURL": "http://localhost/" - }, "repository": { "type": "git", "url": "git+https://github.com/Aljullu/react-lazy-load-image-component.git" diff --git a/src/components/LazyLoadImage.spec.js b/src/components/LazyLoadImage.spec.js index d7106db..1768f32 100644 --- a/src/components/LazyLoadImage.spec.js +++ b/src/components/LazyLoadImage.spec.js @@ -25,7 +25,7 @@ describe('LazyLoadImage', function() { placeholder: null, scrollPosition: {x: 0, y: 0}, style: {}, - src: 'http://localhost/lorem-ipsum.jpg', + src: 'lorem-ipsum.jpg', visibleByDefault: false }; const lazyLoadImage = mount( From f62f132394fedc624dfd57920d14203c44b66abf Mon Sep 17 00:00:00 2001 From: Youkyoung Park Date: Sun, 29 Jul 2018 23:18:19 +0900 Subject: [PATCH 5/6] add jest configuration in package.json --- package.json | 4 ++++ src/components/LazyLoadImage.spec.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b10c08..4c5b6c3 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,10 @@ "start": "webpack --watch", "build": "webpack" }, + "jest": { + "verbose": true, + "testURL": "http://localhost/" + }, "repository": { "type": "git", "url": "git+https://github.com/Aljullu/react-lazy-load-image-component.git" diff --git a/src/components/LazyLoadImage.spec.js b/src/components/LazyLoadImage.spec.js index 1768f32..d7106db 100644 --- a/src/components/LazyLoadImage.spec.js +++ b/src/components/LazyLoadImage.spec.js @@ -25,7 +25,7 @@ describe('LazyLoadImage', function() { placeholder: null, scrollPosition: {x: 0, y: 0}, style: {}, - src: 'lorem-ipsum.jpg', + src: 'http://localhost/lorem-ipsum.jpg', visibleByDefault: false }; const lazyLoadImage = mount( From 399642d0eac9829c1229089e23d893fb66523298 Mon Sep 17 00:00:00 2001 From: Youkyoung Park Date: Mon, 30 Jul 2018 13:04:53 +0900 Subject: [PATCH 6/6] Rollback to previous state - LazyLoadImage.jsx --- src/components/LazyLoadImage.jsx | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/components/LazyLoadImage.jsx b/src/components/LazyLoadImage.jsx index 89c0103..d61417c 100644 --- a/src/components/LazyLoadImage.jsx +++ b/src/components/LazyLoadImage.jsx @@ -101,26 +101,13 @@ class LazyLoadImage extends React.Component { LazyLoadImage.propTypes = { afterLoad: PropTypes.func, - beforeLoad: PropTypes.func, - delayMethod: PropTypes.string, - delayTime: PropTypes.number, - effect: PropTypes.string, - placeholderSrc: PropTypes.string, - threshold: PropTypes.number, - visibleByDefault: PropTypes.bool, - wrapperClassName: PropTypes.string + effect: PropTypes.string }; LazyLoadImage.defaultProps = { afterLoad: () => ({}), - beforeLoad: () => ({}), - delayMethod: 'throttle', - delayTime: 300, - effect: '', - placeholderSrc: '', - threshold: 100, - visibleByDefault: false, - wrapperClassName: '' + effect: '' }; export default LazyLoadImage; +