all files / button/ Button.js

85.71% Statements 6/7
50% Branches 2/4
100% Functions 1/1
100% Lines 6/6
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46                63× 63×                                                                
 
import React from 'react';
 
 
 
/**
 * Button
 */
var Button = ({disabled, children, onClick, raised, type}) => (
  <button
    className={`Button${raised ? ' Button--raised' : ''}`}
    disabled={disabled}
    onClick={onClick}
    type={type}
  >
    {children}
  </button>
);
 
 
 
/**
 * Property types
 */
Button.propTypes = {
  disabled: React.PropTypes.bool,
  onClick: React.PropTypes.func.isRequired,
  raised: React.PropTypes.bool,
  type: React.PropTypes.oneOf(['submit', 'reset', 'button'])
};
 
 
 
/**
 * Default properties
 */
Button.defaultProps = {
  disabled: false,
  raised: false,
  type: 'button'
};
 
 
 
export default Button;