Skip to content

Commit 00afced

Browse files
committed
mobile view improvements
1 parent c92ac78 commit 00afced

2 files changed

Lines changed: 43 additions & 33 deletions

File tree

frontend/components/Navbar/Navbar.tsx

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ const GlobalNavbar: React.FC = () => {
5353
return (
5454
<Navbar
5555
expand="md"
56-
style={{ borderBottom: "1px solid", height: "60px" }}
56+
style={{ borderBottom: "1px solid", height: "auto", minHeight: "60px" }}
5757
className="bg-body-tertiary"
5858
>
59-
<Container className={`${navbarView.navContainer}`}>
59+
<Container className={navbarView.navContainer}>
6060
<Navbar.Brand
6161
onClick={() => router.push("/")}
6262
className={`cursor-pointer ${navbarView.navBrand}`}
@@ -70,34 +70,42 @@ const GlobalNavbar: React.FC = () => {
7070
/>
7171
FindFirst
7272
</Navbar.Brand>
73+
74+
{/* Search bar stays visible always */}
7375
{userAuth === AuthStatus.Authorized ? <Searchbar /> : null}
74-
<div className={`btn-group ${navbarView.navBtns}`}>
75-
{userAuth === AuthStatus.Authorized ? (
76-
<ImportModal
77-
file={undefined}
78-
show={false}
79-
data-testid="import-modal"
80-
/>
81-
) : null}
82-
{userAuth === AuthStatus.Authorized ? (
83-
<Export data-testid="export-component" />
84-
) : null}
85-
<LightDarkToggle />
86-
{userAuth === AuthStatus.Authorized && (
87-
<Image
88-
src={
89-
user?.profileImage && user?.profileImage.trim() !== ""
90-
? `/api/user/avatar?userId=${user.id}`
91-
: "/img_avatar.png"
92-
}
93-
alt="Profile"
94-
width={39}
95-
height={39}
96-
className=""
97-
/>
98-
)}
99-
{authButton()}
100-
</div>
76+
77+
{/* Toggle button for collapsed menu */}
78+
<Navbar.Toggle aria-controls="navbar-collapse" className="ms-auto" />
79+
80+
{/* Collapsible content */}
81+
<Navbar.Collapse id="navbar-collapse">
82+
<div className={`btn-group ms-auto ${navbarView.navBtns}`}>
83+
{userAuth === AuthStatus.Authorized ? (
84+
<ImportModal
85+
file={undefined}
86+
show={false}
87+
data-testid="import-modal"
88+
/>
89+
) : null}
90+
{userAuth === AuthStatus.Authorized ? (
91+
<Export data-testid="export-component" />
92+
) : null}
93+
<LightDarkToggle />
94+
{userAuth === AuthStatus.Authorized && (
95+
<Image
96+
src={
97+
user?.profileImage && user?.profileImage.trim() !== ""
98+
? `/api/user/avatar?userId=${user.id}`
99+
: "/img_avatar.png"
100+
}
101+
alt="Profile"
102+
width={39}
103+
height={39}
104+
/>
105+
)}
106+
{authButton()}
107+
</div>
108+
</Navbar.Collapse>
101109
</Container>
102110
</Navbar>
103111
);

frontend/styles/navbar.module.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.searchBar {
88
border: 1px solid grey;
99
align-items: center;
10-
height: 100%;
10+
min-height: 0;
1111
border-radius: 5px;
1212
width: 100%;
1313
flex-wrap: wrap;
@@ -78,7 +78,7 @@
7878
.navContainer {
7979
.navBrand {
8080
flex-grow: 1;
81-
order: 1;
81+
order: 0;
8282
margin-left: 0 !important;
8383
margin-right: 0 !important;
8484
}
@@ -89,17 +89,19 @@
8989
right: 10%;
9090
width: 80vw;
9191
z-index: 1;
92-
order: 3;
92+
order: 2;
9393
background-color: var(--bs-body-bg);
9494
box-shadow:
9595
3px 3px #29b5bf,
9696
-0.2em 0em 0.2em #29b5bf;
9797
}
9898

9999
.navBtns {
100-
order: 2;
100+
order: 3;
101101
margin-left: 0 !important;
102102
margin-right: 0 !important;
103+
padding-top: 10px;
104+
float: right;
103105
}
104106
}
105107
}

0 commit comments

Comments
 (0)