251113_03_ENH : 베이스 아키텍처에 logout, main 추가
This commit is contained in:
20
src/app/(main)/layout.tsx
Normal file
20
src/app/(main)/layout.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
const MainLayout = ({ children }: { children: React.ReactNode}) => {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
{/* 공통 헤더 */}
|
||||
<header className="h-14 border-b px-4 flex items-center">
|
||||
<h1 className="font-semibold">Contact Admin</h1>
|
||||
</header>
|
||||
|
||||
{/* 메인 컨텐츠 영역 */}
|
||||
<main className="flex-1 flex">
|
||||
{/* 필요하면 사이드바 */}
|
||||
{/* <aside className="w-60 border-r">사이드바</aside> */}
|
||||
|
||||
<section className="flex-1 p-4">{children}</section>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default MainLayout;
|
||||
8
src/app/(main)/list/page.tsx
Normal file
8
src/app/(main)/list/page.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
const ListPage = () => {
|
||||
//const url = buildUrlWithParams("/login", searchParams, { ref: "root" });
|
||||
//redirect(url);
|
||||
|
||||
return (<div>This is List Page</div>)
|
||||
}
|
||||
|
||||
export default ListPage;
|
||||
8
src/app/(main)/page.tsx
Normal file
8
src/app/(main)/page.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
const MainPage = () => {
|
||||
//const url = buildUrlWithParams("/login", searchParams, { ref: "root" });
|
||||
//redirect(url);
|
||||
|
||||
return (<div>Hello, Next.JS</div>)
|
||||
}
|
||||
|
||||
export default MainPage;
|
||||
8
src/app/(main)/user/page.tsx
Normal file
8
src/app/(main)/user/page.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
const UserPage = () => {
|
||||
//const url = buildUrlWithParams("/login", searchParams, { ref: "root" });
|
||||
//redirect(url);
|
||||
|
||||
return (<div>This is User Page</div>)
|
||||
}
|
||||
|
||||
export default UserPage;
|
||||
@@ -1,34 +1,32 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import {Geist, Geist_Mono} from "next/font/google";
|
||||
import "./globals.css";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: "Contact",
|
||||
description: "Contact system",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
const RootLayout = ({ children }: { children: React.ReactNode}) => {
|
||||
return (
|
||||
<html lang="ko">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
export default RootLayout;
|
||||
7
src/app/logout/page.tsx
Normal file
7
src/app/logout/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
const LogoutPage = () => {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
export default LogoutPage;
|
||||
@@ -1,7 +0,0 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { buildUrlWithParams } from "@/lib/utils";
|
||||
|
||||
export default function Page({ searchParams }: { searchParams: Record<string, string | string[] | undefined> }) {
|
||||
const url = buildUrlWithParams("/login", searchParams, { ref: "root" });
|
||||
redirect(url);
|
||||
}
|
||||
Reference in New Issue
Block a user