From 515eec239356186b8c244a9426e70c24313ebb38 Mon Sep 17 00:00:00 2001 From: Thanakarn Klangkasame <77600906+Simulationable@users.noreply.github.com> Date: Thu, 9 Oct 2025 11:03:59 +0700 Subject: [PATCH] Fix Layout --- src/app/component/layout/AppShell.tsx | 43 ++++++++++-------------- src/app/layout.tsx | 48 ++++++++++++--------------- 2 files changed, 40 insertions(+), 51 deletions(-) diff --git a/src/app/component/layout/AppShell.tsx b/src/app/component/layout/AppShell.tsx index b2d9906..0cb253a 100644 --- a/src/app/component/layout/AppShell.tsx +++ b/src/app/component/layout/AppShell.tsx @@ -1,15 +1,14 @@ -// File: src/app/component/layout/AppShell.tsx "use client"; -import {ReactNode, useMemo, useState} from "react"; +import { ReactNode, useMemo, useState } from "react"; import Link from "next/link"; -import {usePathname} from "next/navigation"; -import type {UserSession} from "@/types/auth"; +import { usePathname } from "next/navigation"; +import type { UserSession } from "@/types/auth"; type NavItem = { label: string; href: string; icon?: React.ReactNode; match?: RegExp }; type Props = { user: UserSession; nav: NavItem[]; children: ReactNode }; -export default function AppShell({user, nav, children}: Props) { +export default function AppShell({ user, nav, children }: Props) { const [sidebarOpen, setSidebarOpen] = useState(true); const pathname = usePathname(); @@ -24,11 +23,11 @@ export default function AppShell({user, nav, children}: Props) { Boolean((item.match && item.match.test(pathname)) || pathname === item.href); return ( -
+
{/* Sidebar (desktop) */} {/* Main */} -
+
{/* Topbar */}
-
+
-
-
+
+
{initials}
@@ -145,17 +140,15 @@ export default function AppShell({user, nav, children}: Props) {
{/* Content */} -
-
+
+
{children}
{/* Footer */}
); -} +} \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7f5dcb9..07fef89 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,34 +1,30 @@ -import type { Metadata } from "next"; +import "./globals.css"; +import type { Metadata, Viewport } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; +import React from "react"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); +const geistSans = Geist({ subsets: ["latin"], variable: "--font-geist-sans" }); +const geistMono = Geist_Mono({ subsets: ["latin"], variable: "--font-geist-mono" }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "Enterprise Orchestration Platform", + description: "Enterprise Orchestration Platform", }; -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - +export const viewport: Viewport = { + width: "device-width", + initialScale: 1, + viewportFit: "cover", +}; + +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + + {/* ใช้ className ของฟอนต์จริง ไม่ใช่แค่วางเป็น variable */} + {children} - - - ); -} + + + ); +} \ No newline at end of file