Skip to content

Instantly share code, notes, and snippets.

@CITGuru
Created June 29, 2019 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CITGuru/5f07d0173ac026c0918da13aea3520ee to your computer and use it in GitHub Desktop.
Save CITGuru/5f07d0173ac026c0918da13aea3520ee to your computer and use it in GitHub Desktop.
import React from 'react'
import PropTypes from 'prop-types'
import {
Modal,
ModalBackground,
ModalContent,
ModalClose,
Title
} from 'bloomer'
const CustomModal = ({ isActive, children, title, handleClose }) => {
return (
<Modal isActive={isActive}>
<ModalBackground onClick={handleClose} />
<ModalContent
style={{ backgroundColor: 'white', padding: '2rem', maxWidth: '100vw' }}
>
<Title isSize={6}>{title}</Title>
{children}
</ModalContent>
<ModalClose onClick={handleClose} />
</Modal>
)
}
CustomModal.propTypes = {
children: PropTypes.element.isRequired,
title: PropTypes.string.isRequired,
isActive: PropTypes.bool.isRequired,
handleClose: PropTypes.func.isRequired
}
export default CustomModal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment