Skip to content

Commit

Permalink
Added support for transform-style-attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
itinance committed Dec 27, 2016
1 parent ad07113 commit f0d08bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export const iconSet = {
},
// specific icon
closeLesson: {
source: require('./src/img/icon-close.png'),
source: require('./src/img/icon-open.png'),
transform:[{rotate: '180 deg'}],
},
help: {
source: require('./src/img/icon-help.png'),
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class Ikon extends Component {
let _style = style ? StyleSheet.flatten(style) : {};
_style = {..._style, width, height};

const transform = this.traverseIconSet(name, 'transform');
if(transform) {
_style = {..._style, transform};
}

if(!!disabled) {
let disabledStyle = this.traverseIconSet(name, '$disabled')
if(!disabledStyle) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-ikon",
"version": "0.0.3",
"version": "0.0.4",
"description": "flexible IconSets for react-native",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit f0d08bf

Please sign in to comment.