You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
907 B

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. const Button = React.createClass({
  3. propTypes: {
  4. text: React.PropTypes.string.isRequired,
  5. onClick: React.PropTypes.func,
  6. disabled: React.PropTypes.boolean
  7. },
  8. mixins: [PureRenderMixin],
  9. handleClick (e) {
  10. e.preventDefault();
  11. if (!this.props.disabled) {
  12. this.props.onClick();
  13. }
  14. },
  15. render () {
  16. return (
  17. <a href='#' onClick={this.handleClick} style={{ display: 'inline-block', position: 'relative', boxSizing: 'border-box', textAlign: 'center', border: '10px none', backgroundColor: '#2b90d9', color: '#fff', fontSize: '14px', fontWeight: '500', letterSpacing: '0', textTransform: 'uppercase', padding: '0 16px', height: '36px', cursor: 'pointer', lineHeight: '36px', borderRadius: '4px', textDecoration: 'none' }}>
  18. {this.props.text}
  19. </a>
  20. );
  21. }
  22. });
  23. export default Button;