-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from onefinestay/replaceable_icon
Replaceable icon
- Loading branch information
Showing
4 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
|
||
var React = require('react/addons'); | ||
var cx = React.addons.classSet; | ||
|
||
var Icon = React.createClass({displayName: 'Icon', | ||
propTypes: { | ||
focused: React.PropTypes.bool.isRequired | ||
}, | ||
|
||
render: function() { | ||
var arrowClasses = cx({ | ||
'react-choice-icon__arrow': true, | ||
'react-choice-icon__arrow--up': this.props.focused, | ||
'react-choice-icon__arrow--down': !this.props.focused | ||
}); | ||
|
||
return ( | ||
React.createElement("div", {className: arrowClasses}) | ||
); | ||
} | ||
}); | ||
|
||
module.exports = Icon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
|
||
var React = require('react/addons'); | ||
var cx = React.addons.classSet; | ||
|
||
var Icon = React.createClass({ | ||
propTypes: { | ||
focused: React.PropTypes.bool.isRequired | ||
}, | ||
|
||
render: function() { | ||
var arrowClasses = cx({ | ||
'react-choice-icon__arrow': true, | ||
'react-choice-icon__arrow--up': this.props.focused, | ||
'react-choice-icon__arrow--down': !this.props.focused | ||
}); | ||
|
||
return ( | ||
<div className={arrowClasses}></div> | ||
); | ||
} | ||
}); | ||
|
||
module.exports = Icon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters