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

Nav-bar Update 2 #1553

Merged
merged 38 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
15b68a4
split TopNav into DesktopNav and MobileNav
mertbagt May 1, 2024
34d99fa
relocate desktop nav logo
mertbagt May 1, 2024
43a5c06
placeholder for search bar
mertbagt May 1, 2024
94c2a49
basic layout for desktop nav
mertbagt May 1, 2024
76955b8
refactored to let dropdowns properly use their z:index
mertbagt May 1, 2024
ad9a058
notes to self
mertbagt May 1, 2024
b52ce6b
refactor user dropdown
mertbagt May 1, 2024
0363817
authenticate the login button
mertbagt May 1, 2024
6913051
reenable sticky on nav bar
mertbagt May 1, 2024
565f446
respaced nav items
mertbagt May 1, 2024
365ccb5
cleanup
mertbagt May 1, 2024
30d94d6
more cleanup
mertbagt May 1, 2024
a47de2b
subsumed ProfileLink into MobileNav
mertbagt May 1, 2024
0c8b674
cleanup
mertbagt May 1, 2024
fc6cafd
fixed mobile logo placement
mertbagt May 2, 2024
be3788b
fixed HeroHeader buttons
mertbagt May 2, 2024
59dff14
swapped profile icons to match Figma
mertbagt May 2, 2024
79afa99
Merge branch 'main' of https://github.com/codeforboston/maple into na…
mertbagt May 16, 2024
ad420ef
match Figma changes
mertbagt May 21, 2024
60d96a2
remove navlink-primary tags
mertbagt May 22, 2024
4a86d84
standardized handling of className
mertbagt May 22, 2024
4efbd69
removed static div widths
mertbagt May 22, 2024
3481b01
commented out dev note to prevent flashing text when rendering
mertbagt May 22, 2024
0b27a6f
alternative navbar
mertbagt May 29, 2024
4c2fe6b
updated mobile dropdown options
mertbagt May 29, 2024
837dccb
layout label
mertbagt May 29, 2024
16e9dba
shared navbarlinks
mertbagt May 29, 2024
3162d60
shared navbar profile links
mertbagt May 29, 2024
615dee1
enable alt bar
mertbagt May 29, 2024
c0668e6
merge conflicts
mertbagt Jun 5, 2024
8d6ef93
removed Unified Navbar
mertbagt Jun 5, 2024
385fc57
Merge branch 'main' of https://github.com/codeforboston/maple into na…
mertbagt Jun 5, 2024
2d1fe51
tweaked why use MAPLE
mertbagt Jun 5, 2024
9bca7fa
fixed use of closeNav on Mobile
mertbagt Jun 5, 2024
c8fc45b
moved userlink to links
mertbagt Jun 5, 2024
997d5dd
clean up translations
mertbagt Jun 5, 2024
d6dacf9
clean up
mertbagt Jun 5, 2024
d81458b
more clean up
mertbagt Jun 5, 2024
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
Next Next commit
cleanup
  • Loading branch information
mertbagt committed May 1, 2024
commit 365ccb5afd1beb2d1e2cb7b6ed7b93ddbe3d9337
40 changes: 17 additions & 23 deletions components/DesktopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import AuthModal from "./auth/AuthModal"
import { Container, Dropdown, Nav, NavDropdown, Navbar } from "./bootstrap"
import { useProfile } from "./db"
import PageFooter from "./Footer/Footer"
import { NavBarBox, NavBarBoxContainer } from "./layout"
import { NavLink } from "./Navlink"
import ProfileLink from "./ProfileLink"

Expand Down Expand Up @@ -69,7 +68,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
</Nav.Link>
</LogoBox>

<div className={`align-self-center flex-grow-1`}>
<div className={`align-self-center flex-grow-1 invisible`}>
<button className={`bg-light col my-2 w-100`}>
<div className={`text-dark`}>Placeholder Search Widget</div>
</button>
Expand All @@ -80,7 +79,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavLink
className={"navLink-primary text-white-50"}
href="/bills"
handleClick={closeNav}
// handleClick={closeNav}
>
{t("navigation.browseBills")}
</NavLink>
Expand All @@ -92,7 +91,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavLink
className={"navLink-primary text-white-50"}
href="/testimony"
handleClick={closeNav}
// handleClick={closeNav}
>
{t("navigation.browseTestimony")}
</NavLink>
Expand All @@ -108,7 +107,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/about/faq-page"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.faq")}
Expand All @@ -117,7 +116,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/about/mission-and-goals"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.missionAndGoals")}
Expand All @@ -126,7 +125,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/about/our-team"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("team")}
Expand All @@ -135,7 +134,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/about/support-maple"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.supportMaple")}
Expand All @@ -144,7 +143,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/policies"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.privacyAndConduct")}
Expand All @@ -163,7 +162,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/learn/to-write-effective-testimony"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.toWriteEffectiveTestimony")}
Expand All @@ -172,7 +171,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/learn/legislative-process"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.legislativeProcess")}
Expand All @@ -181,7 +180,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/why-use-maple/for-individuals"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.forIndividuals")}
Expand All @@ -190,7 +189,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavDropdown.Item>
<NavLink
href="/why-use-maple/for-orgs"
handleClick={closeNav}
// handleClick={closeNav}
className={"navLink-primary"}
>
{t("navigation.forOrganizations")}
Expand All @@ -200,7 +199,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavLink
className={"navLink-primary"}
href="/why-use-maple/for-legislators"
handleClick={closeNav}
// handleClick={closeNav}
>
{t("navigation.forLegislators")}
</NavLink>
Expand Down Expand Up @@ -234,7 +233,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavLink
className={"navLink-primary"}
href="/editprofile"
handleClick={closeNav}
// handleClick={closeNav}
>
Edit Profile
</NavLink>
Expand All @@ -243,7 +242,7 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<NavLink
className={"navLink-primary"}
handleClick={() => {
closeNav()
// closeNav()
void signOutAndRedirectToHome()
}}
>
Expand All @@ -258,16 +257,11 @@ export const DesktopNav: React.FC<React.PropsWithChildren<unknown>> = () => {
<SignInWithButton />
</LoginBox>
)}

{/* <NavBarBox className={`align-self-center justify-content-end`}>
<ProfileLink role={claims?.role} fullName={profile?.fullName} />
</NavBarBox> */}
{/* </NavBarBoxContainer> */}
</Container>
{/* </Navbar> */}
</>
)
}

// rework spacing amoung elements in dropbox (primarily right to left spacing)
// replace profile icon with white border/blue person?
// replace profile icon with white border/blue person per Figma?
// adjust profile icon height?
26 changes: 25 additions & 1 deletion components/MobileNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,34 @@ import AuthModal from "./auth/AuthModal"
import { Container, Nav, NavDropdown, Navbar } from "./bootstrap"
import { useProfile } from "./db"
import PageFooter from "./Footer/Footer"
import { NavBarBox, NavBarBoxContainer } from "./layout"
import { NavLink } from "./Navlink"
import ProfileLink from "./ProfileLink"

const NavBarBoxContainer: FC<
React.PropsWithChildren<{ className?: string }>
> = ({ children, className }) => {
return (
<div
className={`d-flex flex-row align-items-start justify-content-between w-100`}
>
{children}
</div>
)
}

const NavBarBox: FC<React.PropsWithChildren<{ className?: string }>> = ({
children,
className
}) => {
return (
<div
className={`col d-flex justify-content-start align-items-center ${className}`}
>
{children}
</div>
)
}

export const MobileNav: React.FC<React.PropsWithChildren<unknown>> = () => {
const { authenticated, claims } = useAuth()
const { profile } = useProfile()
Expand Down
37 changes: 6 additions & 31 deletions components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import { MobileNav } from "./MobileNav"
import { NavLink } from "./Navlink"
import ProfileLink from "./ProfileLink"

export const PageContainer: FC<React.PropsWithChildren<unknown>> = ({
children
}) => {
return <div className={`vh-100 d-flex flex-column`}>{children}</div>
}

export type LayoutProps = {
title?: string
}
Expand Down Expand Up @@ -47,34 +53,3 @@ export const Layout: React.FC<React.PropsWithChildren<LayoutProps>> = ({
</>
)
}

export const PageContainer: FC<React.PropsWithChildren<unknown>> = ({
children
}) => {
return <div className={`vh-100 d-flex flex-column`}>{children}</div>
}

export const NavBarBoxContainer: FC<
React.PropsWithChildren<{ className?: string }>
> = ({ children, className }) => {
return (
<div
className={`d-flex flex-row align-items-start justify-content-between w-100`}
>
{children}
</div>
)
}

export const NavBarBox: FC<React.PropsWithChildren<{ className?: string }>> = ({
children,
className
}) => {
return (
<div
className={`col d-flex justify-content-start align-items-center ${className}`}
>
{children}
</div>
)
}
Loading