Modal dismiss working

This commit is contained in:
John Lyon-Smith
2018-02-27 15:06:20 -08:00
parent c79df7722b
commit 4ce0638655
5 changed files with 22 additions and 16 deletions

View File

@@ -10,15 +10,16 @@ class Button extends Component {
width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
visible: PropTypes.bool,
disabled: PropTypes.bool,
name: PropTypes.name,
name: PropTypes.string,
onClick: PropTypes.func,
}
render() {
const { name, children, submit, width, visible, disabled } = this.props
const { name, children, submit, width, visible, disabled, onClick } = this.props
return (
<button name={name} type={!visible ? 'hidden' : submit ? 'submit' : 'button'} disabled={disabled}
style={[style.base, { width }]}>
style={[style.base, { width }]} onClick={onClick}>
{children}
</button>
)

View File

@@ -11,7 +11,7 @@ class Checkbox extends Component {
label: PropTypes.string,
visible: PropTypes.bool,
// disabled: PropTypes.bool,
name: PropTypes.name,
name: PropTypes.string,
}
constructor(props) {

View File

@@ -7,9 +7,12 @@ import { Dimmer } from 'ui'
class Modal extends Component {
static propTypes = {
children: PropTypes.node,
open: PropTypes.bool
open: PropTypes.bool,
// TODO: onCancel: PropTypes.func,
}
// TODO: Capture ESC key https://stackoverflow.com/questions/3369593/how-to-detect-escape-key-press-with-pure-js-or-jquery
render() {
return (
<Dimmer active={this.props.open}>