diff --git a/apps/dm/app/base.tsx b/apps/dm/app/base.tsx index 3905c9952..bae02acb2 100644 --- a/apps/dm/app/base.tsx +++ b/apps/dm/app/base.tsx @@ -3,7 +3,7 @@ import { BaseLayout } from "@common/components"; import type { MenuItem } from "./store/common"; import { useDmStore } from "./store"; -import { useRouter } from "next/navigation"; +import { usePathname, useRouter } from "next/navigation"; export default function Base({ children, @@ -13,10 +13,16 @@ export default function Base({ const { getMenuAuth } = useDmStore((state) => state); const router = useRouter(); - const handleClick = (id:MenuItem) =>{ + const pathname = usePathname(); + + const handleClick = (id: MenuItem) => { getMenuAuth(id.menuCd); router.push(id.urlPath); - } + }; - return {children}; + return ( + + {children} + + ); } diff --git a/apps/fo/app/base.tsx b/apps/fo/app/base.tsx index 7bdf4f3e0..a01ce8643 100644 --- a/apps/fo/app/base.tsx +++ b/apps/fo/app/base.tsx @@ -3,7 +3,7 @@ import { BaseLayout } from "@common/components"; import type { MenuItem } from "./store/common"; import { useFoStore } from "./store"; -import { useRouter } from "next/navigation"; +import { usePathname, useRouter } from "next/navigation"; export default function Base({ children, @@ -11,12 +11,17 @@ export default function Base({ children: React.ReactNode; }>) { const { getMenuAuth } = useFoStore((state) => state); - + const pathname = usePathname(); const router = useRouter(); - const handleClick = (id:MenuItem) =>{ + + const handleClick = (id: MenuItem) => { getMenuAuth(id.menuCd); router.push(id.urlPath); - } + }; - return {children}; + return ( + + {children} + + ); } diff --git a/apps/wr/app/base.tsx b/apps/wr/app/base.tsx index 8ffaa42fe..34452e20b 100644 --- a/apps/wr/app/base.tsx +++ b/apps/wr/app/base.tsx @@ -1,24 +1,25 @@ -"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 { useRouter } from "next/navigation" +"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 { usePathname, useRouter } from "next/navigation"; export default function Base({ children, }: Readonly<{ - children: React.ReactNode + children: React.ReactNode; }>) { - const { getMenuAuthrts } = useWrStore((state) => state) - const router = useRouter() + const { getMenuAuthrts } = useWrStore((state) => state); + const router = useRouter(); + const pathname = usePathname(); const changeMenu = (path: MenuItem) => { - getMenuAuthrts(path.menuCd) - router.push(path.urlPath) - } + getMenuAuthrts(path.menuCd); + router.push(path.urlPath); + }; return ( - + {children} - ) + ); }