diff options
Diffstat (limited to 'app/assets/javascripts/components/components/icon_button.jsx')
-rw-r--r-- | app/assets/javascripts/components/components/icon_button.jsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/components/icon_button.jsx b/app/assets/javascripts/components/components/icon_button.jsx index c23f977e4..b41752890 100644 --- a/app/assets/javascripts/components/components/icon_button.jsx +++ b/app/assets/javascripts/components/components/icon_button.jsx @@ -6,12 +6,14 @@ const IconButton = React.createClass({ title: React.PropTypes.string.isRequired, icon: React.PropTypes.string.isRequired, onClick: React.PropTypes.func.isRequired, - size: React.PropTypes.number + size: React.PropTypes.number, + active: React.PropTypes.bool }, getDefaultProps () { return { - size: 18 + size: 18, + active: false }; }, @@ -24,7 +26,7 @@ const IconButton = React.createClass({ render () { return ( - <a href='#' title={this.props.title} className='icon-button' onClick={this.handleClick} style={{ display: 'inline-block', fontSize: `${this.props.size}px`, width: `${this.props.size}px`, height: `${this.props.size}px`, lineHeight: `${this.props.size}px`}}> + <a href='#' title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={{ display: 'inline-block', fontSize: `${this.props.size}px`, width: `${this.props.size}px`, height: `${this.props.size}px`, lineHeight: `${this.props.size}px`}}> <i className={`fa fa-fw fa-${this.props.icon}`}></i> </a> ); |