From 6b204fce157513ead85229ab9043874ef4d0b346 Mon Sep 17 00:00:00 2001 From: truthwing Date: Mon, 21 Jul 2025 19:51:52 +0900 Subject: [PATCH] djlee product --- apps/wr/app/base.tsx | 30 ++++++++++++++---------------- apps/wr/app/layout.tsx | 12 +----------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/apps/wr/app/base.tsx b/apps/wr/app/base.tsx index 35b9b4cd6..8ffaa42fe 100644 --- a/apps/wr/app/base.tsx +++ b/apps/wr/app/base.tsx @@ -1,26 +1,24 @@ "use client" -import { BaseLayout } from "@common/components/ui"; -import { useWrStore } from "./store"; -import { MainDiv } from "@common/business_components/ui"; -import type { MenuItem } from "./store/common/type/menu"; - +import { BaseLayout } from "@common/components/ui" +import { useWrStore } from "./store" +import { MainDiv } from "@common/business_components/ui" +import type { MenuItem } from "./store/common/type/menu" +import { useRouter } from "next/navigation" export default function Base({ children, - changeMenu, }: Readonly<{ - children: React.ReactNode; - changeMenu: (path: string) => void; + children: React.ReactNode }>) { - const { getMenuAuthrts } = useWrStore((state) => state); + const { getMenuAuthrts } = useWrStore((state) => state) + const router = useRouter() + const changeMenu = (path: MenuItem) => { + getMenuAuthrts(path.menuCd) + router.push(path.urlPath) + } return ( - { - getMenuAuthrts(e.menuCd); - changeMenu(e.urlPath); - }} - > + {children} - ); + ) } diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx index 25934500b..add988817 100644 --- a/apps/wr/app/layout.tsx +++ b/apps/wr/app/layout.tsx @@ -5,7 +5,6 @@ import koBase from "../public/locales/ko/message.json"; import i18next from "i18next"; import { I18nextProvider } from "react-i18next"; import Base from "./base"; -import { useRouter } from "next/navigation"; // ✅ App Router 전용 export default function RootLayout({ children, @@ -22,21 +21,12 @@ export default function RootLayout({ }, }); - const router = useRouter(); - -const changeMenu = (path: string) => { - router.push(path); -}; - - return ( - + {children}