diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-23 23:34:12 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-23 23:34:12 +0100 |
commit | cbc50016eb3d0a46e76aca9ed199b036ce20abdb (patch) | |
tree | 39930478584c1bcd73061b69e2d18be868f78d9a /app/assets/javascripts/components/components | |
parent | 7cee27f51790617859da87c7aef432373b40aad4 (diff) |
Follow/unfollow button outside of dropdown, also make favs/reblogs update indicator instantly and
then adjust to failure later if the request fails
Diffstat (limited to 'app/assets/javascripts/components/components')
-rw-r--r-- | app/assets/javascripts/components/components/button.jsx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/assets/javascripts/components/components/button.jsx b/app/assets/javascripts/components/components/button.jsx index fe36d40c5..d63129013 100644 --- a/app/assets/javascripts/components/components/button.jsx +++ b/app/assets/javascripts/components/components/button.jsx @@ -7,7 +7,14 @@ const Button = React.createClass({ onClick: React.PropTypes.func, disabled: React.PropTypes.bool, block: React.PropTypes.bool, - secondary: React.PropTypes.bool + secondary: React.PropTypes.bool, + size: React.PropTypes.number, + }, + + getDefaultProps () { + return { + size: 36 + }; }, mixins: [PureRenderMixin], @@ -32,16 +39,16 @@ const Button = React.createClass({ fontWeight: '500', letterSpacing: '0', textTransform: 'uppercase', - padding: '0 16px', - height: '36px', + padding: `0 ${this.props.size / 2.25}px`, + height: `${this.props.size}px`, cursor: 'pointer', - lineHeight: '36px', + lineHeight: `${this.props.size}px`, borderRadius: '4px', textDecoration: 'none' }; - + return ( - <button className={`button ${this.props.secondary ? 'button-secondary' : ''}`} disabled={this.props.disabled} onClick={this.handleClick} style={style}> + <button className={`button ${this.props.secondary ? 'button-secondary' : ''}`} disabled={this.props.disabled} onClick={this.handleClick} style={{ ...style, ...this.props.style }}> {this.props.text || this.props.children} </button> ); |