Skip to content

Commit

Permalink
fix: NavBar styling
Browse files Browse the repository at this point in the history
  • Loading branch information
flozia committed Dec 20, 2024
1 parent 0f4404a commit 1439816
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 106 deletions.
55 changes: 28 additions & 27 deletions src/app/(proper_react)/(redesign)/(public)/LandingView.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,57 @@
flex-direction: column;
height: 100%;
}

.waitlistSection {
display: flex;
flex-direction: column;
align-items: center;
gap: $spacing-lg;
padding: $layout-md $spacing-md;

.waitlistTitle {
text-align: center;
font: $text-title-2xs;
font-weight: 600;
line-height: 1.4;
font-family: var(--font-inter);
color: $color-purple-70;
}

a {
align-self: center;
}
}

.navbar {
font: $text-body-xl;
padding: $layout-xs;
display: flex;
flex-direction: row;
justify-content: flex-start;
background-color: $color-grey-05;
.navbarLinksContainer {
ul {
display: flex;
flex-direction: column;
.navbarLinks {
a {
text-decoration: none;
color: $color-grey-50;
}
}
@media screen and (min-width: $screen-sm) {
justify-content: flex-end;
.navbarLinksContainer {
ul {
flex-direction: row;
justify-content: flex-end;
.navbarLinks {
a {
margin-left: $spacing-lg;
}
}
}
@media screen and (min-width: $screen-md) {
padding: $layout-xs $layout-xl;
.navbarLinksContainer {
.navbarLinks {
ul {
a {
margin-left: $spacing-xl;
}
}
Expand Down Expand Up @@ -396,24 +418,3 @@
align-self: center;
}
}

.waitlistSection {
display: flex;
flex-direction: column;
align-items: center;
gap: $spacing-lg;
padding: $layout-md $spacing-md;

.waitlistTitle {
text-align: center;
font: $text-title-2xs;
font-weight: 600;
line-height: 1.4;
font-family: var(--font-inter);
color: $color-purple-70;
}

a {
align-self: center;
}
}
6 changes: 5 additions & 1 deletion src/app/(proper_react)/(redesign)/(public)/LandingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export const View = (props: Props) => {
<>
<AccountDeletionNotification />
<main className={styles.wrapper}>
{props.eligibleForPremium && <TopNavBar styles={styles} />}
{props.eligibleForPremium && (
<div className={styles.navbar}>
<TopNavBar />
</div>
)}
<header className={styles.hero}>
<div className={styles.heroContent}>
<h1>{props.l10n.getString("landing-all-hero-title")}</h1>
Expand Down
34 changes: 16 additions & 18 deletions src/app/(proper_react)/(redesign)/(public)/PublicShell.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@
}

&.navDesktop {
ul {
display: flex;

a {
color: $color-black;
text-decoration: none;
font-weight: 600;
padding: $spacing-sm $spacing-md;

&:hover {
color: $color-purple-70;
text-decoration: underline;
}
}
}

@media screen and (max-width: $screen-xl) {
display: none;
}
Expand All @@ -54,21 +70,3 @@
.content {
flex: 1 0 auto;
}

.navbar {
display: flex;
flex-direction: row;
font-weight: 600;
justify-content: flex-start;

.navbarLinksContainer {
display: flex;
gap: $spacing-md;
}

.navbarLinks {
color: $color-black;
padding: $spacing-sm;
text-decoration: none;
}
}
2 changes: 1 addition & 1 deletion src/app/(proper_react)/(redesign)/(public)/PublicShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const PublicShell = (props: Props) => {
/>
</Link>
</h1>
{hasLandingPageRedesign && <TopNavBar styles={styles} />}
{hasLandingPageRedesign && <TopNavBar />}
<SignInButton variant="secondary" />
</nav>
<div className={styles.content}>{props.children}</div>
Expand Down
98 changes: 44 additions & 54 deletions src/app/(proper_react)/(redesign)/(public)/TopNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,51 @@
import { TelemetryLink } from "../../../components/client/TelemetryLink";
import { useL10n } from "../../../hooks/l10n";

export const TopNavBar = (props: {
styles: {
readonly [key: string]: string;
};
}) => {
export const TopNavBar = () => {
const l10n = useL10n();
return (
<div className={props.styles.navbar}>
<ul className={`${props.styles.navbarLinksContainer} noList`}>
<li>
<TelemetryLink
className={props.styles.navbarLinks}
href="/how-it-works"
eventData={{
link_id: "navbar_how_it_works",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-how-it-works")}
</TelemetryLink>
</li>
<li>
<TelemetryLink
className={props.styles.navbarLinks}
href="#pricing"
eventData={{
link_id: "navbar_pricing",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-pricing")}
</TelemetryLink>
</li>
<li>
<TelemetryLink
data-testid="navbar_faqs"
className={props.styles.navbarLinks}
href="#faq"
eventData={{
link_id: "navbar_faqs",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-faqs")}
</TelemetryLink>
</li>
<li>
<TelemetryLink
className={props.styles.navbarLinks}
href="/breaches"
eventData={{
link_id: "navbar_recent_breaches",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-recent-breaches")}
</TelemetryLink>
</li>
</ul>
</div>
<ul className="noList">
<li>
<TelemetryLink
href="/how-it-works"
eventData={{
link_id: "navbar_how_it_works",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-how-it-works")}
</TelemetryLink>
</li>
<li>
<TelemetryLink
href="#pricing"
eventData={{
link_id: "navbar_pricing",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-pricing")}
</TelemetryLink>
</li>
<li>
<TelemetryLink
data-testid="navbar_faqs"
href="#faq"
eventData={{
link_id: "navbar_faqs",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-faqs")}
</TelemetryLink>
</li>
<li>
<TelemetryLink
href="/breaches"
eventData={{
link_id: "navbar_recent_breaches",
}}
>
{l10n.getString("landing-premium-hero-navbar-link-recent-breaches")}
</TelemetryLink>
</li>
</ul>
);
};
4 changes: 0 additions & 4 deletions src/app/(proper_react)/(redesign)/MobileShell.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@
display: none;
}

.navbar {
width: 100%;
}

@media screen and (max-width: $screen-xl) {
.hasOpenMenu & .mainMenuLayer {
display: block;
Expand Down
2 changes: 1 addition & 1 deletion src/app/(proper_react)/(redesign)/MobileShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const MobileShell = (props: Props) => {
</div>
</>
) : (
<TopNavBar styles={styles} />
<TopNavBar />
)}
</div>
</nav>
Expand Down

0 comments on commit 1439816

Please sign in to comment.