Skip to content

Instantly share code, notes, and snippets.

@88atwilliams
Created January 28, 2019 02:26
Show Gist options
  • Save 88atwilliams/0490c9d4bb25600a1498ca7d57eab131 to your computer and use it in GitHub Desktop.
Save 88atwilliams/0490c9d4bb25600a1498ca7d57eab131 to your computer and use it in GitHub Desktop.
import React, {Component, Fragment} from 'react'; components/UI/Menu.js
import styled from 'styled-components';
import Toggle from '../utilities/toggle';
class Menu extends Component {
render() {
return (
<div>
<Toggle render = {({on, toggle})=>(
<div>
<Hamburger
onClick={toggle}
>
<Line>__</Line>
<Line>__</Line>
<Line>__</Line>
</Hamburger>
{on &&
<nav>
<li>Menu Item 1 </li>
<li>Menu Item 2 </li>
<li>Menu Item 3 </li>
</nav>}
</div>
)}/>
</div>
);
}
}
const Line = styled.div`
font-size: 25px;
font-weight: bold;
height: 8px;
`;
const Hamburger = styled.div`
display: flex;
flex-direction: column;
cursor: pointer;
height:40px;
margin-bottom: 10px;
`;
export default Menu;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment