How to use the react-modal.propTypes function in react-modal

To help you get started, we’ve selected a few react-modal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cncjs / cncjs / src / web / components / Modal / Modal.jsx View on Github external
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 = {
github kleros / doges-on-trial / src / components / modal / index.js View on Github external
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,
github kleros / tokens-on-trial / src / components / modal / index.js View on Github external
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,