Last active
April 19, 2021 14:08
-
-
Save jogilvyt/627b466e8c7959a1dae21a556e25a757 to your computer and use it in GitHub Desktop.
This file contains 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
const Modal = ({ children }) => { | |
return ( | |
<div className="Modal"> | |
<div className="Modal-content">{children}</div> | |
</div> | |
); | |
}; | |
const ModalHeader = ({ children }) => { | |
return ( | |
<div className="Modal-header"> | |
<h2>{children}</h2> | |
</div> | |
); | |
}; | |
const ModalBody = ({ children }) => { | |
return <div className="Modal-body">{children}</div>; | |
}; | |
const ModalActions = ({ children }) => { | |
return <div className="Modal-actions">{children}</div>; | |
}; | |
// This is optional, but shows the explicit link between the components | |
Modal.Header = ModalHeader; | |
Modal.Body = ModalBody; | |
Modal.Actions = ModalActions; | |
export default Modal; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment