2016-08-31 16:15:12 +02:00
|
|
|
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
|
|
|
|
2016-08-25 19:52:55 +02:00
|
|
|
const Button = React.createClass({
|
2016-08-31 16:15:12 +02:00
|
|
|
|
2016-08-25 19:52:55 +02:00
|
|
|
propTypes: {
|
|
|
|
text: React.PropTypes.string.isRequired,
|
2016-08-31 16:15:12 +02:00
|
|
|
onClick: React.PropTypes.func,
|
2016-08-31 22:58:10 +02:00
|
|
|
disabled: React.PropTypes.bool
|
2016-08-25 19:52:55 +02:00
|
|
|
},
|
|
|
|
|
2016-08-31 16:15:12 +02:00
|
|
|
mixins: [PureRenderMixin],
|
|
|
|
|
2016-08-25 19:52:55 +02:00
|
|
|
handleClick (e) {
|
2016-08-31 16:15:12 +02:00
|
|
|
if (!this.props.disabled) {
|
|
|
|
this.props.onClick();
|
|
|
|
}
|
2016-08-25 19:52:55 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
2016-09-01 12:13:41 +02:00
|
|
|
<button className='button' disabled={this.props.disabled} onClick={this.handleClick} style={{ fontFamily: 'Roboto', display: 'inline-block', position: 'relative', boxSizing: 'border-box', textAlign: 'center', border: '10px none', color: '#fff', fontSize: '14px', fontWeight: '500', letterSpacing: '0', textTransform: 'uppercase', padding: '0 16px', height: '36px', cursor: 'pointer', lineHeight: '36px', borderRadius: '4px', textDecoration: 'none' }}>
|
2016-08-25 19:52:55 +02:00
|
|
|
{this.props.text}
|
2016-08-31 22:58:10 +02:00
|
|
|
</button>
|
2016-08-25 19:52:55 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Button;
|