Skip to content

Commit 0e97ec7

Browse files
feat: refactor ProjectHeader to ProjectInfo, update layout to include ProjectInfo component, and remove projectTitle prop
Co-authored-by: Drobinson1999 <Drobinson1999@users.noreply.github.com>
1 parent 9253138 commit 0e97ec7

4 files changed

Lines changed: 39 additions & 12 deletions

File tree

app/(Components)/Header.tsx

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
11
"use client";
22

3-
import { HStack, Heading, Container } from "@chakra-ui/react";
3+
import {
4+
HStack,
5+
Heading,
6+
Container,
7+
useBreakpointValue,
8+
} from "@chakra-ui/react";
49
import { ColorModeButton, useColorMode } from "@/components/ui/color-mode";
510

6-
export default function ProjectHeader({
7-
projectTitle,
8-
}: {
9-
projectTitle: string;
10-
}) {
11+
export default function ProjectInfo() {
12+
const ProjectInfo = {
13+
title: "OpenSignal",
14+
navLinks: [
15+
{ name: "login", href: "/" },
16+
{ name: "Dashboard", href: "/dashboard" },
17+
],
18+
};
19+
const current = useBreakpointValue({
20+
base: "base",
21+
sm: "sm",
22+
md: "md",
23+
lg: "lg",
24+
xl: "xl",
25+
"2xl": "2xl",
26+
});
27+
const Title = "OpenSignal";
1128
const { colorMode } = useColorMode();
1229

1330
return (
14-
<Container h={"10vh"} position={"fixed"}>
31+
<Container
32+
h={"10vh"}
33+
position={"fixed"}
34+
zIndex={1}
35+
_dark={{ bg: "black" }}
36+
_light={{ bg: "white" }}
37+
>
1538
<HStack alignItems={"center"} justifyContent={"space-between"} h={"100%"}>
16-
<Heading size={"5xl"}>{projectTitle}</Heading>
39+
<Heading size={"5xl"}>{Title}</Heading>
40+
1741
<ColorModeButton
1842
size="sm"
1943
variant="subtle"

app/(User Dashboard)/dashboard/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export default async function Home() {
4040

4141
return (
4242
<Stack>
43-
<ProjectHeader projectTitle="OpenSignal" />
4443
<Container maxW="container.md" py={8}>
4544
<Card.Root position="relative" p={8} mt={8}>
4645
{session ? (

app/layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { Geist, Geist_Mono } from "next/font/google";
33
import "./globals.css";
44
import { Provider } from "@/components/ui/provider";
55
import { SessionProvider } from "next-auth/react";
6+
7+
import ProjectInfo from "@/app/(Components)/Header";
8+
69
const geistSans = Geist({
710
variable: "--font-geist-sans",
811
subsets: ["latin"],
@@ -29,7 +32,10 @@ export default function RootLayout({
2932
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
3033
>
3134
<SessionProvider>
32-
<Provider>{children}</Provider>
35+
<Provider>
36+
<ProjectInfo />
37+
{children}
38+
</Provider>
3339
</SessionProvider>
3440
</body>
3541
</html>

app/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default async function Home() {
1212
if (session?.user) {
1313
return (
1414
<>
15-
<ProjectHeader projectTitle={"OpenSignal"} />
1615
<Container h={"80vh"} bg={"blue.100"}>
1716
<AbsoluteCenter>
1817
<Card.Root>
@@ -45,7 +44,6 @@ export default async function Home() {
4544
}
4645
return (
4746
<>
48-
<ProjectHeader projectTitle={"OpenSignal"} />
4947
<Container h={"80vh"} bg={"blue.100"}>
5048
<AbsoluteCenter>
5149
<Card.Root>

0 commit comments

Comments
 (0)