Created
May 10, 2021 10:23
-
-
Save nazifbara/88b725be833921b2c3490c6a4ec4ad6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // src/modal.js | |
| function ModalContent({ children, title, imageSrc }) { | |
| const [isOpen, setIsOpen] = React.useContext(ModalContext); | |
| return isOpen ? ( | |
| <Overlay onClick={() => setIsOpen(false)}> | |
| <div | |
| css={{...}} | |
| onClick={(e) => e.stopPropagation()} | |
| > | |
| <div css={{...}}> | |
| <h2 css={{..}}> | |
| {title} | |
| </h2> | |
| <ModalCloseButton /> | |
| </div> | |
| <div css={{...}}>{children}</div> | |
| </div> | |
| </Overlay> | |
| ) : null; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment