Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar mobile refactored design #1568

Merged
merged 7 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
close dropdowns when logo is clicked
  • Loading branch information
mertbagt committed Jun 7, 2024
commit 00c2132112cd906575d712d9eb61b1afcc1cce7c
26 changes: 11 additions & 15 deletions components/MobileNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,20 @@ export const MobileNav: React.FC<React.PropsWithChildren<unknown>> = () => {
)}
</Navbar.Brand>
</Col>
<Col>
<div className="d-flex justify-content-center">
<NavbarLinkLogo />
</div>
<Col className="d-flex justify-content-center">
<NavbarLinkLogo handleClick={closeNav} />
</Col>
<Col className="d-flex justify-content-end me-3 pe-2">
{authenticated ? (
<>
<Navbar.Brand onClick={toggleAvatar}>
<Nav.Link className="p-0 text-white">
{isExpanded && whichMenu == "profile" ? (
<Image src="/Union.svg" alt="x" width="35" height="35" />
) : (
<Avatar />
)}
</Nav.Link>
</Navbar.Brand>
</>
<Navbar.Brand onClick={toggleAvatar}>
<Nav.Link className="p-0 text-white">
{isExpanded && whichMenu == "profile" ? (
<Image src="/Union.svg" alt="x" width="35" height="35" />
) : (
<Avatar />
)}
</Nav.Link>
</Navbar.Brand>
) : (
<SignInWithButton />
)}
Expand Down
4 changes: 3 additions & 1 deletion components/NavbarComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,18 @@ export const NavbarLinkGoals: React.FC<

export const NavbarLinkLogo: React.FC<
React.PropsWithChildren<{
handleClick?: any
other?: any
}>
> = ({ other }) => {
> = ({ handleClick, other }) => {
const isMobile = useMediaQuery("(max-width: 768px)")
const { t } = useTranslation(["common", "auth"])
return (
<div
className={
isMobile ? "" : "align-items-center justify-content-start me-3"
}
onClick={handleClick}
>
<NavLink className={isMobile ? "" : "py-0 px-2"} href="/" {...other}>
<Image
Expand Down
Loading