fix(v2): hide mobile navbar hamburger when there are no links (#2624)

This commit is contained in:
Yangshun Tay 2020-04-18 12:09:28 +08:00 committed by GitHub
parent 614adca45f
commit 409f8788dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,30 +140,32 @@ function Navbar() {
})}>
<div className="navbar__inner">
<div className="navbar__items">
<div
aria-label="Navigation bar toggle"
className="navbar__toggle"
role="button"
tabIndex={0}
onClick={showSidebar}
onKeyDown={showSidebar}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="30"
height="30"
viewBox="0 0 30 30"
role="img"
focusable="false">
<title>Menu</title>
<path
stroke="currentColor"
strokeLinecap="round"
strokeMiterlimit="10"
strokeWidth="2"
d="M4 7h22M4 15h22M4 23h22"
/>
</svg>
</div>
{links != null && links.length !== 0 && (
<div
aria-label="Navigation bar toggle"
className="navbar__toggle"
role="button"
tabIndex={0}
onClick={showSidebar}
onKeyDown={showSidebar}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="30"
height="30"
viewBox="0 0 30 30"
role="img"
focusable="false">
<title>Menu</title>
<path
stroke="currentColor"
strokeLinecap="round"
strokeMiterlimit="10"
strokeWidth="2"
d="M4 7h22M4 15h22M4 23h22"
/>
</svg>
</div>
)}
<Link className="navbar__brand" to={logoLink} {...logoLinkProps}>
{logoImageUrl != null && (
<img