on 69dc015 help sign in
bridge/src/components/ProtoButton.js
40 lines 917 B history raw
1import React from 'react';
2import PropTypes from 'prop-types';
3import { getDomProps } from '../lib/base';
5const ProtoButton = props => {
6 return (
7 <button
8 {...getDomProps(props)}
9 className={`${props.className} sans`}
10 type={props.type}
11 style={props.style}
12 onClick={props.onClick}
13 disabled={props.disabled}
14 autoFocus={props.autoFocus}>
15 { props.children }
16 </button>
17 )
20ProtoButton.propTypes = {
21 disabled: PropTypes.bool,
22 onClick: PropTypes.func,
23 className: PropTypes.string,
24 children: PropTypes.node,
25 autofocus: PropTypes.bool,
26 style: PropTypes.object,
27 type: PropTypes.oneOf(['button', 'submit', 'reset'])
28};
30ProtoButton.defaultProps = {
31 className: '',
32 autoFocus: false,
33 onClick: () => {},
34 disabled: false,
35 style: {},
36 type: 'button',
37};
40export default ProtoButton;