import Inferno from 'inferno'; import { Component } from 'inferno'; import PropTypes from 'prop-types'; export class Modal extends Component { constructor (props) { super(props); PropTypes.checkPropTypes({ noButton: PropTypes.bool, buttonText: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), title: PropTypes.string, children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), footerAlign: PropTypes.string, footerContent: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), }, props, 'prop', 'Modal'); this.state = { isVisible: false, } } show () { this.setState({ isVisible: true, }); } hide () { this.setState({ isVisible: false, }); } render () { const { noButton, buttonText, title, children, footerAlign = 'left', footerContent, } = this.props; return (
{ buttonText || 'Show' }

{ title || 'Modal' }

{ children }
); } }