From 36921be9aa6f4ef68d969ee2a1c49b63a37d4d2a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 10 Nov 2016 01:32:32 +0100 Subject: [PATCH] Fix #131 - Make active favourite buttons yellow --- .../components/components/icon_button.jsx | 10 +++++-- .../components/status_action_bar.jsx | 2 +- .../features/status/components/action_bar.jsx | 30 +++++++++++++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/components/components/icon_button.jsx b/app/assets/javascripts/components/components/icon_button.jsx index 656f3d4a3c..d8f00f5d8b 100644 --- a/app/assets/javascripts/components/components/icon_button.jsx +++ b/app/assets/javascripts/components/components/icon_button.jsx @@ -7,7 +7,9 @@ const IconButton = React.createClass({ icon: React.PropTypes.string.isRequired, onClick: React.PropTypes.func.isRequired, size: React.PropTypes.number, - active: React.PropTypes.bool + active: React.PropTypes.bool, + style: React.PropTypes.object, + activeStyle: React.PropTypes.object }, getDefaultProps () { @@ -26,7 +28,7 @@ const IconButton = React.createClass({ }, render () { - const style = { + let style = { display: 'inline-block', border: 'none', padding: '0', @@ -39,6 +41,10 @@ const IconButton = React.createClass({ ...this.props.style }; + if (this.props.active) { + style = { ...style, ...this.props.activeStyle }; + } + return (