Skip to content

Instantly share code, notes, and snippets.

@Danetag
Last active June 25, 2018 21:42
Show Gist options
  • Select an option

  • Save Danetag/9e8997bddbf367cab82a0c109c5f81af to your computer and use it in GitHub Desktop.

Select an option

Save Danetag/9e8997bddbf367cab82a0c109c5f81af to your computer and use it in GitHub Desktop.
...
render() {
const { items, openedMenu, onClose } = this.props;
return (
<Transition in={openedMenu} timeout={openedMenu ? 0 : 300}>
{(status) => (
<nav
id="menu-mobile"
aria-labelledby="menu-hamburger"
role="menu"
className={`
${styles.container}
${(status === 'entered') ? styles.showContainer : ''}
`}
>
<button
className={`${styles.closeButton}`}
onClick={onClose}
>
Close menu
</button>
<ul className={styles.list}>
{items.map((item, i) =>
<li
className={`
${styles.item}
${(status === 'entered') ? styles.showItem : ''}
`}
key={item.title}
>
<Link
to={item.path}
className={`
${typography.display2}
${styles.link}
`}
>
{ item.title }
</Link>
</li>
)}
</ul>
</nav>
)}
</Transition>
);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment