diff options
| author | Haishan <[email protected]> | 2018-10-20 20:32:02 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2018-10-20 20:32:02 +0800 |
| commit | 133b29c9dac2209a3c88c3289f84ff709d404392 (patch) | |
| tree | e023785cc82db732c64328a5d99938992eceecfd /src/components/Button.js | |
first commit
Diffstat (limited to 'src/components/Button.js')
| -rw-r--r-- | src/components/Button.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/Button.js b/src/components/Button.js new file mode 100644 index 0000000..34fe5fe --- /dev/null +++ b/src/components/Button.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; + +import s0 from 'c/Button.module.scss'; + +class Button extends Component { + static propTypes = { + label: PropTypes.string.isRequired, + onClick: PropTypes.func + }; + + static defaultProps = { + onClick: () => {} + }; + + render() { + return ( + <button className={s0.btn} onClick={this.props.onClick}> + {this.props.label} + </button> + ); + } +} + +export default Button; |
