Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit fa8ee5b

Browse files
authored
Merge pull request #26 from benox3/blur
Update default blur to be false
2 parents 72b1a81 + c824c44 commit fa8ee5b

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export default class Example extends Component {
5656
| noscriptIndex | `images.length-1` | false | number | The image object to use on noscript render. |
5757
| baseStyle | `{ position: 'relative', margin: '-5px', overflow: 'hidden' }` | false | object | Override the container style object. |
5858
| imgStyle | `{ margin: '0 auto', maxWidth: '100%', width: '100%' }` | false | object | Override the image style object. |
59-
| shouldBlur | true | false | boolean | Determines if the image should be blurred before setting the optimal image. |
60-
| blurAmmount | '10px' | false | string | The ammount of blur. Expected format: '10px' or '15%'. |
59+
| shouldBlur | false | false | boolean | Determines if the image should be blurred before setting the optimal image. |
60+
| blurAmmount | '20px' | false | string | The ammount of blur. Expected format: '10px' or '15%'. |
6161
| renderOutOfView | false | false | boolean | Determines if the optimal image should be selected even if not in view |
6262

6363
## Special Thanks

lib/common/Pic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export default class Pic extends Component {
9191
Pic.defaultProps = {
9292
alt: '',
9393
defaultIndex: 0,
94-
shouldBlur: true,
95-
blurAmmount: '10px',
94+
shouldBlur: false,
95+
blurAmmount: '20px',
9696
baseStyle: {
9797
position: 'relative',
9898
margin: '-5px',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-pic",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"description": "React component for progressive and responsive image loading.",
55
"author": "Ben Budnevich",
66
"main": "dist/commonjs/react-pic.js",
@@ -62,6 +62,7 @@
6262
"nodemon": "^1.10.2",
6363
"npm-run-all": "^3.1.0",
6464
"react": "^15.3.2",
65+
"react-addons-shallow-compare": "^15.3.2",
6566
"react-addons-test-utils": "^15.3.2",
6667
"react-dom": "^15.3.2",
6768
"sinon": "^1.17.6",

test/component.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('Pic', function() {
131131
expect(Pic.prototype.setResponsiveImage).to.have.property('callCount', 1);
132132
});
133133

134-
it('should set blur by default', function() {
134+
it('should set blur to false by default', function() {
135135
const props = {
136136
images: [
137137
{
@@ -150,12 +150,12 @@ describe('Pic', function() {
150150

151151
expect(
152152
pic.find('img').last().attr('style')
153-
).to.contain('blur');
153+
).to.not.contain('blur');
154154
});
155155

156-
it('should not set blur style based if shouldBlur prop is false', function() {
156+
it('should set blur style based if shouldBlur prop is true', function() {
157157
const props = {
158-
shouldBlur: false,
158+
shouldBlur: true,
159159
blurAmmount: '10px',
160160
images: [
161161
{
@@ -174,11 +174,12 @@ describe('Pic', function() {
174174

175175
expect(
176176
pic.find('img').last().attr('style')
177-
).to.not.contain(`blur(${props.blurAmmount});`);
177+
).to.contain(`blur(${props.blurAmmount});`);
178178
});
179179

180180
it('should set blur style based on blurAmmount prop', function() {
181181
const props = {
182+
shouldBlur: true,
182183
blurAmmount: '20px',
183184
images: [
184185
{

0 commit comments

Comments
 (0)