Skip to content

Commit caa99dc

Browse files
committed
settings page
- restructuring profile -> settings - new sidebar
1 parent a227198 commit caa99dc

File tree

12 files changed

+165
-84
lines changed

12 files changed

+165
-84
lines changed

frontend/app/(planner)/layout.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,6 @@ export default function PlannerLayout({ children }: PlannerLayoutProps) {
3131

3232
const basePath = "/" + pathname.split("/")[1];
3333

34-
const adminNav = [
35-
{
36-
title: "Stundenplan",
37-
href: basePath,
38-
},
39-
{
40-
title: "Überblick",
41-
href: basePath + "/overview",
42-
},
43-
{
44-
title: "Veranstaltungen",
45-
href: basePath + "/events",
46-
},
47-
{
48-
title: "Anmeldungen",
49-
href: basePath + "/applications",
50-
},
51-
{
52-
title: "Einstellungen",
53-
href: basePath + "/settings",
54-
},
55-
];
56-
5734
useEffect(() => {
5835
const fetchData = async () => {
5936
const client = getClient();

frontend/app/(planner)/sidebar.tsx

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BookCheck, Calendar, GraduationCap } from "lucide-react"
1+
import { BookCheck, Calendar, GraduationCap } from "lucide-react";
22

33
import {
44
Sidebar,
@@ -9,43 +9,47 @@ import {
99
SidebarMenu,
1010
SidebarMenuButton,
1111
SidebarMenuItem,
12-
} from "@/components/ui/sidebar"
13-
import {UmbrellaPopoverSelection} from "@/components/umbrella-popover-selection"
14-
import {Event} from "@/lib/gql/generated/graphql"
15-
import {usePathname} from "next/navigation"
12+
} from "@/components/ui/sidebar";
13+
import { UmbrellaPopoverSelection } from "@/components/umbrella-popover-selection";
14+
import { Event } from "@/lib/gql/generated/graphql";
15+
import { usePathname } from "next/navigation";
1616

1717
interface AdminSidebarProps {
18-
umbrellas: Event[]
18+
umbrellas: Event[];
1919
}
2020

21-
export function AdminSidebar({umbrellas}: AdminSidebarProps) {
22-
const pathname = usePathname()
21+
export function AdminSidebar({ umbrellas }: AdminSidebarProps) {
22+
const pathname = usePathname();
2323

24-
const basePath = "/" + pathname.split("/")[1]
24+
const basePath = "/" + pathname.split("/")[1];
25+
26+
const items = [
27+
{
28+
title: "Stundenplan",
29+
url: basePath,
30+
icon: Calendar,
31+
},
32+
{
33+
title: "Tutorien",
34+
url: basePath + "/tutorials",
35+
icon: GraduationCap,
36+
},
37+
{
38+
title: "Anmeldungen",
39+
url: basePath + "/registrations",
40+
icon: BookCheck,
41+
},
42+
];
2543

26-
const items = [
27-
{
28-
title: "Stundenplan",
29-
url: basePath,
30-
icon: Calendar,
31-
},
32-
{
33-
title: "Tutorien",
34-
url: basePath + "/tutorials",
35-
icon: GraduationCap,
36-
},
37-
{
38-
title: "Anmeldungen",
39-
url: basePath + "/registrations",
40-
icon: BookCheck,
41-
},
42-
]
4344
return (
4445
<Sidebar>
4546
<SidebarHeader>
4647
<SidebarMenu>
4748
<SidebarMenuItem>
48-
<UmbrellaPopoverSelection umbrellas={umbrellas} className="w-full justify-between" />
49+
<UmbrellaPopoverSelection
50+
umbrellas={umbrellas}
51+
className="w-full justify-between"
52+
/>
4953
</SidebarMenuItem>
5054
</SidebarMenu>
5155
</SidebarHeader>
@@ -68,5 +72,5 @@ const items = [
6872
</SidebarGroup>
6973
</SidebarContent>
7074
</Sidebar>
71-
)
75+
);
7276
}

frontend/app/(profile)/profile/layout.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

frontend/app/(settings)/layout.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
2+
import { ProfileSidebar } from "./sidebar";
3+
import { Footer } from "@/components/footer";
4+
5+
interface SettingsLayoutProps {
6+
children: React.ReactNode;
7+
}
8+
9+
export default function SettingsLayout({ children }: SettingsLayoutProps) {
10+
return (
11+
<SidebarProvider>
12+
<ProfileSidebar />
13+
<main className="flex-1 mt-[80px]">
14+
<div className="p-5">
15+
<SidebarTrigger className="mb-2" />
16+
{children}
17+
</div>
18+
<Footer />
19+
</main>
20+
</SidebarProvider>
21+
);
22+
}

0 commit comments

Comments
 (0)