Created
December 30, 2018 19:08
-
-
Save Kornil/cbec1b9535e8a07e6f7a73d025fa81aa 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 Header = () => ( | |
<StyledHeader> | |
<nav> | |
<ModalContext.Consumer> | |
{(modalProps) => ( | |
<Button onClick={modalProps.showModal}>login</Button> | |
{/* | |
we pass modalProps so the Modal can use them to render if show is true | |
and to provide the hideModal method for our close functionality | |
*/} | |
<Modal title="hello" modalProps={modalProps}> | |
<p>helloooo</p> | |
</Modal> | |
)} | |
</ModalContext.Consumer> | |
</nav> | |
</StyledHeader> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment