Skip to content

Commit fe5d45f

Browse files
Merge pull request #129 from bluethreadmade/mobileNavigationUpdate
chore: rework the header navigation in mobile view (WEB-125)
2 parents 8244929 + 2ae3162 commit fe5d45f

File tree

4 files changed

+60
-36
lines changed

4 files changed

+60
-36
lines changed

package-lock.json

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"eslint-config-next": "14.1.1",
4040
"jest": "^29.7.0",
4141
"jest-environment-jsdom": "^29.7.0",
42-
"prettier": "^3.2.5",
42+
"prettier": "^3.5.0",
4343
"typescript": "^5"
4444
}
4545
}

src/app/components/navbar/navbar.module.css

+19-2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
right: 0;
140140
z-index: 100;
141141
display: flex;
142+
flex-direction: column;
142143
justify-content: space-between;
143144
align-items: center;
144145
padding: 10px 20px;
@@ -148,6 +149,21 @@
148149
box-sizing: border-box;
149150
}
150151

152+
.mobileLogoIconContainer {
153+
display: flex;
154+
flex-direction: row;
155+
justify-content: space-between;
156+
align-items: center;
157+
width: 100%;
158+
}
159+
160+
.mobileNavBackground {
161+
height: 100vh;
162+
width: 100%;
163+
justify-content: center;
164+
padding-top: 2rem;
165+
}
166+
151167
.hamburger,
152168
.cross {
153169
display: flex;
@@ -240,11 +256,12 @@
240256

241257
.mobileNav a,
242258
.meetupLink {
243-
font-size: 12px;
259+
font-size: 1.5rem;
244260
font-weight: 700;
245261
color: hsl(var(--blue));
246262
text-decoration: none;
247-
line-height: 14.09px;
263+
text-align: center;
264+
margin: 1rem;
248265

249266
&:hover {
250267
color: hsl(var(--light-blue));

src/app/components/navbar/navbar.tsx

+35-29
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default function Navbar() {
4242
<Link href={link.link} key={link.id}>
4343
<div
4444
className={isMobile ? link.mobileClassName : link.desktopClassName}
45+
onClick={toggleNav}
4546
>
4647
{link.label}
4748
</div>
@@ -51,44 +52,49 @@ export default function Navbar() {
5152
return (
5253
<div className={styles.nav}>
5354
<nav className={styles.mobileNavBar}>
54-
<div className={styles.mobileLogo}>
55-
<Link href='/'>
56-
<div className={styles.homeLink}>
57-
<Image
58-
src='/assets/dsd-circle-logo.png'
59-
alt='Logo'
60-
width={45}
61-
height={45}
62-
/>
63-
<span className={styles.home}>{internalLinks.home.label}</span>
55+
<div className={styles.mobileLogoIconContainer}>
56+
<div className={styles.mobileLogo}>
57+
<Link href='/'>
58+
<div
59+
className={styles.homeLink}
60+
onClick={() => setIsNavVisible(false)}
61+
>
62+
<Image
63+
src='/assets/dsd-circle-logo.png'
64+
alt='Logo'
65+
width={45}
66+
height={45}
67+
/>
68+
<span className={styles.home}>{internalLinks.home.label}</span>
69+
</div>
70+
</Link>
71+
</div>
72+
{isNavVisible ? (
73+
<div className={styles.crossContainer}>
74+
<div
75+
onClick={toggleNav}
76+
className={styles.cross}
77+
data-testid='navbar-collapse'
78+
>
79+
<div className={styles.line}></div>
80+
<div className={styles.line}></div>
81+
</div>
6482
</div>
65-
</Link>
66-
</div>
67-
{isNavVisible ? (
68-
<div className={styles.crossContainer}>
83+
) : (
6984
<div
85+
className={styles.hamburger}
7086
onClick={toggleNav}
71-
className={styles.cross}
72-
data-testid='navbar-collapse'
87+
data-testid='navbar-expand'
7388
>
7489
<div className={styles.line}></div>
7590
<div className={styles.line}></div>
91+
<div className={styles.line}></div>
7692
</div>
77-
</div>
78-
) : (
79-
<div
80-
className={styles.hamburger}
81-
onClick={toggleNav}
82-
data-testid='navbar-expand'
83-
>
84-
<div className={styles.line}></div>
85-
<div className={styles.line}></div>
86-
<div className={styles.line}></div>
87-
</div>
88-
)}
93+
)}
94+
</div>
8995
<div
9096
className={styles.mobileNavBackground}
91-
style={{ display: isNavVisible ? 'block' : 'none' }}
97+
style={{ display: isNavVisible ? 'flex' : 'none' }}
9298
>
9399
<div className={styles.mobileNav}>
94100
{navLinks(true)}

0 commit comments

Comments
 (0)