about summary refs log tree commit diff
path: root/app/assets/javascripts/components/components/button.jsx
blob: 1a55dd87979d0d4da2e9e4ae82036f0118e65254 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import PureRenderMixin from 'react-addons-pure-render-mixin';

const Button = React.createClass({

  propTypes: {
    text: React.PropTypes.string.isRequired,
    onClick: React.PropTypes.func,
    disabled: React.PropTypes.bool
  },

  mixins: [PureRenderMixin],

  handleClick (e) {
    if (!this.props.disabled) {
      this.props.onClick();
    }
  },

  render () {
    return (
      <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' }}>
        {this.props.text}
      </button>
    );
  }

});

export default Button;