Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 4f4e8e6

Browse files
author
Manuel Proß
committed
refactor(web): build nav and main content with css grid, adjust navbar and main section according to styleguide
1 parent 06bf2fb commit 4f4e8e6

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

web/src/components/Layout/Layout.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ type LayoutProps = {
88

99
export default function Layout({ children, pages }: PropsWithChildren<LayoutProps>) {
1010
return (
11-
<div className="py-4 pr-4">
12-
<Navigation menu={pages} />
13-
<div className="rounded-3xl ml-[15rem] bg-gray-5">
14-
{children}
15-
<Footer />
11+
<div className="relative grid grid-cols-[1fr,3fr] gap-x-5 px-5 xl:grid-cols-[300px,auto]">
12+
<div className="sticky top-0 h-screen py-4">
13+
<Navigation menu={pages} />
14+
</div>
15+
<div className="pt-4">
16+
<div className="rounded-[35px] p-12 bg-gray-5">
17+
{children}
18+
<Footer />
19+
</div>
1620
</div>
1721
</div>
1822
);

web/src/components/Layout/Navigation/Navigation.tsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use client";
22
import { IconUserCircle } from "@tabler/icons-react";
3+
import Image from "next/image";
4+
import Link from "next/link";
35

46
type NavigationProps = {
57
menu: Page[];
@@ -16,12 +18,19 @@ export type Page = {
1618

1719
export default function Navigation({ menu }: NavigationProps) {
1820
return (
19-
<header className="sidebar">
20-
<nav className="flex flex-col items-center justify-between h-full">
21-
<a className="w-3/4" href="/">
22-
<img src="/vim.svg" alt="Vim Logo" />
23-
</a>
24-
<ul className="w-full flex flex-col gap-2">
21+
<header className="h-full rounded-[35px] pt-8 bg-gray-5">
22+
<nav className="flex flex-col items-center h-full">
23+
<Link className="mb-8" href="/">
24+
<Image src="/vim.svg" width={64} height={64} alt="Vim Logo" />
25+
</Link>
26+
<ul className="w-full flex flex-col gap-2 px-8">
27+
<li className="block rounded-xl py-2 px-4 text-white hover:bg-gray-4 hover:cursor-pointer">
28+
<Link href="#">Downloads</Link>
29+
</li>
30+
<li className="block rounded-xl py-2 px-4 text-white hover:bg-gray-4 hover:cursor-pointer">
31+
<Link href="#">Downloads</Link>
32+
</li>
33+
2534
{menu.map(menuItem => {
2635
return (
2736
<li className="nav-link" key={menuItem.id}>
@@ -31,11 +40,11 @@ export default function Navigation({ menu }: NavigationProps) {
3140
})}
3241
</ul>
3342

34-
<div>
35-
<a className="flex flex-row gap-2" href="/my-account">
36-
<IconUserCircle size={24} />
43+
<div className="group mt-auto mb-8 hover:text-gray-2">
44+
<Link className="flex items-center gap-2 text-white group-hover:text-gray-2" href="/my-account">
45+
<IconUserCircle className="text-white group-hover:text-gray-2" size={40} />
3746
My Account
38-
</a>
47+
</Link>
3948
</div>
4049
</nav>
4150
</header>

0 commit comments

Comments
 (0)