Created
August 13, 2015 03:42
-
-
Save geta6/07ad8ef49543dfa24ae6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 'use strict'; | |
| const React = require('react'); | |
| module.exports = React.createClass({ | |
| displayName: 'IconComponent', | |
| propTypes: { | |
| glyph: React.PropTypes.string.isRequired, | |
| active: React.PropTypes.bool | |
| }, | |
| getDefaultProps() { | |
| return {active: false}; | |
| }, | |
| render() { | |
| let glyph = `${this.props.glyph}${this.props.active ? '-active' : ''}`; | |
| return <i className={`s s-${glyph}`} />; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment