Modal dismiss working
This commit is contained in:
@@ -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>
|
||||
)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user