Skip to content

Instantly share code, notes, and snippets.

@jogilvyt
Last active April 19, 2021 14:08
Show Gist options
  • Save jogilvyt/627b466e8c7959a1dae21a556e25a757 to your computer and use it in GitHub Desktop.
Save jogilvyt/627b466e8c7959a1dae21a556e25a757 to your computer and use it in GitHub Desktop.
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