Fixed message dialog

This commit is contained in:
John Lyon-Smith
2018-02-28 10:53:32 -08:00
parent 4ce0638655
commit c2eeccb66f
16 changed files with 101 additions and 52 deletions

View File

@@ -8,16 +8,23 @@ class Modal extends Component {
static propTypes = {
children: PropTypes.node,
open: PropTypes.bool,
// TODO: onCancel: PropTypes.func,
width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
// TODO: onCancel: PropTypes.func <- for handling ESC & enter key
}
static defaultProps = {
width: '60%',
}
// TODO: Capture ESC key https://stackoverflow.com/questions/3369593/how-to-detect-escape-key-press-with-pure-js-or-jquery
render() {
const { open, children, width } = this.props
return (
<Dimmer active={this.props.open}>
<div style={style.modal}>
{this.props.children}
<Dimmer active={open}>
<div style={[style.modal, { width }]}>
{children}
</div>
</Dimmer>
)