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

feat(landingpage): tweak navigation design #1045

Merged
merged 7 commits into from
Sep 7, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ const LocaleSwitcher = () => {
[router]
);

const isChecked = (locale as string) === Supported_Locales.EN;

const leadingStyle = {
color: isChecked ? '#575464' : 'black',
};

const trailingStyle = {
color: isChecked ? 'black' : '#575464',
};

useEffect(() => {
if (router.route.startsWith('/[lang]/getting-started')) {
setIsDisabled(true);
Expand All @@ -36,8 +46,12 @@ const LocaleSwitcher = () => {
checked={(locale as string) === Supported_Locales.EN}
onCheckedChange={(e) => handleLocaleChangeNew(e.detail)}
>
<p slot="leading">DE</p>
<p slot="trailing">EN</p>
<p slot="leading" style={leadingStyle}>
DE
</p>
<p slot="trailing" style={trailingStyle}>
EN
</p>
</InoSwitch>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
}

div.popover {
row-gap: 24px;
display: flex;
flex-direction: column;
padding: 24px 24px;
padding: 15px 8px;
border-radius: 5px;
min-width: 160px;
}
50 changes: 27 additions & 23 deletions packages/landingpage/components/layout/header/desktop/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,33 @@ export default function Navbar() {
isActive={isRouteActive(mainRouteUrl, key)}
/>
</div>
<InoPopover
for={key}
interactive
placement="bottom"
trigger="mouseenter"
controlled={false}
visible={false}
distance={POPOVER_OFFSET}
colorScheme="light"
>
<div className={styles.popover}>
{subRoutes.map(({ key: subRouteName, url: subRouteUrl }) => (
<LinkItem
key={subRouteUrl}
url={subRouteUrl}
name={t(
`common.navigation.${key}.subroutes.${subRouteName}.name`
)}
isDense={true}
/>
))}
</div>
</InoPopover>
{subRoutes.length > 1 && (
<InoPopover
for={key}
interactive
placement="bottom"
trigger="mouseenter"
controlled={false}
visible={false}
distance={POPOVER_OFFSET}
colorScheme="light"
arrow={true}
>
<div className={styles.popover}>
{subRoutes.map(({ key: subRouteName, url: subRouteUrl }) => (
<LinkItem
key={subRouteUrl}
url={subRouteUrl}
name={t(
`common.navigation.${key}.subroutes.${subRouteName}.name`
)}
isDense={true}
isSubItem={true}
/>
))}
</div>
</InoPopover>
)}
</div>
))}
<ContactButton />
Expand Down
24 changes: 24 additions & 0 deletions packages/landingpage/components/layout/linkItem.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ p.link {

p.linkActive {
color: var(--inovex-elements-n-10);
position: relative;

&::after {
content: '';
position: absolute;
bottom: -15px;
left: 0;
width: 100%;
height: 3px;
background-color: var(--inovex-elements-p-5);
box-shadow: 0 8px 17px 0 var(--inovex-elements-p-5);
}
}

p.noMargin {
Expand All @@ -18,7 +30,19 @@ p.noMargin {

p.linkDense {
font-weight: lighter !important;
font-size: large !important;
margin: 0;
padding: 10px 15px;
transition: color 300ms ease-in-out, background-color 300ms ease-in-out;
}

p.linkSubItem {
@extend .linkDense;

&:hover {
color: white;
background-color: var(--inovex-elements-p-7);
}
}

@media only screen and (max-width: 600px) {
Expand Down
3 changes: 3 additions & 0 deletions packages/landingpage/components/layout/linkItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Props = {
isActive?: boolean;
isDense?: boolean;
noMargin?: boolean;
isSubItem?: boolean;
};

export default function LinkItem({
Expand All @@ -17,6 +18,7 @@ export default function LinkItem({
isActive = false,
isDense = false,
noMargin = false,
isSubItem = false,
}: Props) {
const { locale } = useTranslation();

Expand All @@ -28,6 +30,7 @@ export default function LinkItem({
isActive && styles.linkActive,
noMargin && styles.noMargin,
isDense && styles.linkDense,
isSubItem && styles.linkSubItem,
isDense ? 'title-m' : 'title-l'
)}
>
Expand Down
Loading