From 6535bf37eccbcc99d5fd93ded11e46f7c3c270eb Mon Sep 17 00:00:00 2001
From: Thatsaphorn Atchariyaphap
Date: Tue, 8 Apr 2025 22:57:58 +0200
Subject: [PATCH] Added "Services" page & refactor layout structure
- Introduced a new Services component with basic setup.
- Updated layout files to ensure consistent global styling references.
- Enhanced Navbar with pathname detection for active link styling.
- Fixed navigation link URL for "Leistungen" in constants.
---
app/(root)/layout.tsx | 2 +-
app/contact/layout.tsx | 2 +-
app/{(root) => }/globals.css | 0
app/legal/layout.tsx | 2 +-
app/services/layout.tsx | 35 ++++++++++++++++++++++++++++++++
app/services/page.tsx | 12 +++++++++++
components/Navbar/DesktopNav.tsx | 9 ++++++--
constant/Constant.ts | 2 +-
8 files changed, 58 insertions(+), 6 deletions(-)
rename app/{(root) => }/globals.css (100%)
create mode 100644 app/services/layout.tsx
create mode 100644 app/services/page.tsx
diff --git a/app/(root)/layout.tsx b/app/(root)/layout.tsx
index 76a8669..99a74fe 100644
--- a/app/(root)/layout.tsx
+++ b/app/(root)/layout.tsx
@@ -1,5 +1,5 @@
import type {Metadata} from "next";
-import "./globals.css";
+import "../globals.css";
import Nav from "@/components/Navbar/Nav";
import Footer from "@/components/Home/Footer/Footer";
diff --git a/app/contact/layout.tsx b/app/contact/layout.tsx
index b274b97..99a74fe 100644
--- a/app/contact/layout.tsx
+++ b/app/contact/layout.tsx
@@ -1,5 +1,5 @@
import type {Metadata} from "next";
-import "../(root)/globals.css";
+import "../globals.css";
import Nav from "@/components/Navbar/Nav";
import Footer from "@/components/Home/Footer/Footer";
diff --git a/app/(root)/globals.css b/app/globals.css
similarity index 100%
rename from app/(root)/globals.css
rename to app/globals.css
diff --git a/app/legal/layout.tsx b/app/legal/layout.tsx
index b274b97..99a74fe 100644
--- a/app/legal/layout.tsx
+++ b/app/legal/layout.tsx
@@ -1,5 +1,5 @@
import type {Metadata} from "next";
-import "../(root)/globals.css";
+import "../globals.css";
import Nav from "@/components/Navbar/Nav";
import Footer from "@/components/Home/Footer/Footer";
diff --git a/app/services/layout.tsx b/app/services/layout.tsx
new file mode 100644
index 0000000..99a74fe
--- /dev/null
+++ b/app/services/layout.tsx
@@ -0,0 +1,35 @@
+import type {Metadata} from "next";
+import "../globals.css";
+
+import Nav from "@/components/Navbar/Nav";
+import Footer from "@/components/Home/Footer/Footer";
+import {ThemeProvider} from "@/components/provider/ThemeProvider";
+import React from "react";
+import {cookies} from "next/headers";
+
+export const metadata: Metadata = {
+ title: "Rhein Software",
+ description: "Rhein Software Development",
+};
+
+export default async function RootLayout({
+ children,
+ }: Readonly<{
+ children: React.ReactNode;
+}>) {
+ const cookieStore = await cookies();
+ const theme = cookieStore.get("theme")?.value === "dark" ? "dark" : "light";
+
+ return (
+
+
+
+
+
+ {children}
+
+
+
+
+ );
+}
diff --git a/app/services/page.tsx b/app/services/page.tsx
new file mode 100644
index 0000000..ed96214
--- /dev/null
+++ b/app/services/page.tsx
@@ -0,0 +1,12 @@
+import React from 'react';
+import Contact from "@/components/Contact/Contact";
+
+const ContactPage = () => {
+ return (
+
+
+
+ );
+};
+
+export default ContactPage;
\ No newline at end of file
diff --git a/components/Navbar/DesktopNav.tsx b/components/Navbar/DesktopNav.tsx
index 15c43a7..9ed9f06 100644
--- a/components/Navbar/DesktopNav.tsx
+++ b/components/Navbar/DesktopNav.tsx
@@ -1,5 +1,6 @@
"use client";
+import {usePathname} from "next/navigation";
import {navLinks} from "@/constant/Constant";
import Link from "next/link";
import React, {useContext, useEffect, useState} from "react";
@@ -18,6 +19,7 @@ const Nav = ({openNav}: Props) => {
const [buttonSize, setButtonSize] = useState("md:px-6 md:py-2 px-4 py-1 text-sm");
const {theme, toggleTheme} = useContext(ThemeContext);
const colors = themeColors[theme];
+ const pathname = usePathname();
const navColorClass = theme === "dark" || !navBg ? "text-white" : "text-black";
@@ -61,8 +63,11 @@ const Nav = ({openNav}: Props) => {
{navLinks.map((link) => (
+ className={`nav_link ${contentSize} uppercase transition-all duration-300 ease-in-out ${
+ pathname === link.url
+ ? "text-white font-bold"
+ : "text-gray-300 font-medium"
+ }`}>
{link.label}
diff --git a/constant/Constant.ts b/constant/Constant.ts
index 5901cb7..64dd8e4 100644
--- a/constant/Constant.ts
+++ b/constant/Constant.ts
@@ -11,7 +11,7 @@ export const navLinks = [
},
{
id: 3,
- url: '#',
+ url: '/services',
label: 'Leistungen',
}
];
\ No newline at end of file