Skip to content

Commit

Permalink
Added Menu Button
Browse files Browse the repository at this point in the history
  • Loading branch information
Adi-204 committed Dec 15, 2023
1 parent c56fc9e commit e06dadb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ export const App =()=>{
</BrowserRouter>
)
}

12 changes: 6 additions & 6 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ export const Header = () => {
setMobileMenuOpen(!isMobileMenuOpen);
};

const toggleLogo = () =>{
const toggleClose = () =>{
setMobileMenuOpen(false);
};

return (
<header>
<Link to="/" className={`${isMobileMenuOpen ? 'mobile-logo' : 'logo'}`}
onClick={toggleLogo}>
onClick={toggleClose}>
#VANLIFE
</Link>
<button className="menu-toggle" onClick={toggleMobileMenu}>
&#9776;
&#9776; Menu
</button>
<nav>
<ul className={isMobileMenuOpen ? 'mobile-nav nav-open mobile-nav-open' : ''}>
<li>
<Link to="/host" className="nav-item" onClick={toggleLogo}>
<Link to="/host" className="nav-item" onClick={toggleClose}>
Host
</Link>
</li>
<li>
<Link to="/about" className="nav-item" onClick={toggleLogo}>
<Link to="/about" className="nav-item" onClick={toggleClose}>
About
</Link>
</li>
<li>
<Link to="/vans" className="nav-item" onClick={toggleLogo}>
<Link to="/vans" className="nav-item" onClick={toggleClose}>
Vans
</Link>
</li>
Expand Down
1 change: 0 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ nav ul li {
}
.menu-toggle {
display: none;
cursor: pointer;
}
.logo:hover {
color: #161616;
Expand Down
2 changes: 1 addition & 1 deletion src/responsive.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

@media screen and (max-width: 480px) {
@media screen and (max-width: 760px) {
.menu-toggle {
display: block;
background-color: transparent;
Expand Down

0 comments on commit e06dadb

Please sign in to comment.