Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
border: '1px solid #ccc',
borderRadius: 0,
top: '50%',
left: '50%',
right: 'auto',
bottom: 'auto',
marginRight: '-50%',
padding: 0,
transform: 'translate(-50%, -50%)'
}
};
@CSSModules(styles, { allowMultiple: true })
class Modal extends Component {
static propTypes = {
...ModalOverlay.propTypes,
bsSize: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
// When 'true' the modal will show itself.
show: PropTypes.bool,
// Specify 'static' for a backdrop that doesn't trigger an "onHide" when clicked.
backdrop: PropTypes.oneOf(['static', true, false]),
// Specify whether the Component should contain a close button
closeButton: PropTypes.bool,
// A callback fired when the header closeButton or non-static backdrop is clicked.
onHide: PropTypes.func
};
static defaultProps = {
overlayClassName="Modal--overlay"
className={`Modal ${className}`}
{...rest}
>
{children}
)
Modal.propTypes = {
// React Modal
...ReactModal.propTypes,
onRequestClose: PropTypes.func,
// State
children: PropTypes.node,
// Modifiers
className: PropTypes.string
}
Modal.defaultProps = {
// React Modal
onRequestClose: null,
// State
children: null,
ReactModal.setAppElement('#root')
const Modal = ({ onRequestClose, children, className, ...rest }) => (
{children}
)
Modal.propTypes = {
// React Modal
...ReactModal.propTypes,
onRequestClose: PropTypes.func,
// State
children: PropTypes.node,
// Modifiers
className: PropTypes.string
}
Modal.defaultProps = {
// React Modal
onRequestClose: null,
// State
children: null,