Skip to content

Commit

Permalink
feat(props): add props to img
Browse files Browse the repository at this point in the history
  • Loading branch information
pitipatdop committed Feb 20, 2017
1 parent dbd0733 commit 9a4770d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ cache:
notifications:
email: false
node_js:
- '7'
- '6'
- '4'
before_script:
- npm prune
script:
- npm run test
- npm run build
after_success:
- npm run semantic-release
branches:
Expand Down
Binary file added better-img-0.0.0-development.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"commit": "git-cz",
"dev": "cross-env NODE_ENV=development node server.js",
"test": "cross-env NODE_ENV=test mocha src/index.spec.js --compilers js:babel-register",
"prebuild": "rimraf dist",
"build": "cross-env NODE_ENV=production babel --copy-files --out-dir dist --ignore *.spec.js src",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ class BetterImg extends Component {
transform: `translate3d(${x}px, ${y}px, 0) scaleX(${scaleX}) scaleY(${scaleY})`,
}

const imgProps = _.omit(this.props, ['width', 'height']);
return (
<div className="better-img" style={wrapperStyles} ref={container => this.container = container}>
<img
{...imgProps}
src={src}
style={imgStyle}
onLoad={this.handleOnLoad}
Expand Down

0 comments on commit 9a4770d

Please sign in to comment.