Replace inline styles with stylesheet (#3115)
This commit is contained in:
parent
550863198c
commit
b8b7b506a2
13 changed files with 122 additions and 55 deletions
|
@ -26,15 +26,19 @@ class Button extends React.PureComponent {
|
|||
|
||||
render () {
|
||||
const style = {
|
||||
display: this.props.block ? 'block' : 'inline-block',
|
||||
width: this.props.block ? '100%' : 'auto',
|
||||
padding: `0 ${this.props.size / 2.25}px`,
|
||||
height: `${this.props.size}px`,
|
||||
lineHeight: `${this.props.size}px`
|
||||
lineHeight: `${this.props.size}px`,
|
||||
...this.props.style
|
||||
};
|
||||
|
||||
return (
|
||||
<button className={`button ${this.props.secondary ? 'button-secondary' : ''}`} disabled={this.props.disabled} onClick={this.handleClick} style={{ ...style, ...this.props.style }}>
|
||||
<button
|
||||
className={`button ${this.props.secondary ? 'button-secondary' : ''} ${this.props.block ? 'button--block' : ''}`}
|
||||
disabled={this.props.disabled}
|
||||
onClick={this.handleClick}
|
||||
style={style}
|
||||
>
|
||||
{this.props.text || this.props.children}
|
||||
</button>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue