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