wr: fo: sn: 지도화면 session confirm

This commit is contained in:
2026-07-21 17:59:15 +09:00
parent 559e4ee352
commit b41a317788
3 changed files with 22 additions and 3 deletions
+11 -2
View File
@@ -1,9 +1,10 @@
'use client'
import { NoFooterLayout } from "@common/components";
import { useQueryClient } from "@tanstack/react-query";
import type { MenuItem } from "../../store/common";
import { useFoStore } from "../../store";
import { usePathname, useRouter } from "next/navigation";
// import { authService } from "@/src/entities/auth";
import { authService } from "@/src/entities/auth";
export default function RootLayout({
children,
@@ -14,12 +15,20 @@ export default function RootLayout({
const { getMenuAuth } = useFoStore((state) => state);
const pathname = usePathname();
const router = useRouter();
const queryClient = useQueryClient();
const handleClick = (id: MenuItem) => {
getMenuAuth(id.menuCd);
router.push(id.urlPath);
};
return (
<NoFooterLayout currentPath={pathname ?? ""} handleMenuClick={handleClick}>{children}</NoFooterLayout>
<NoFooterLayout
queryClient={queryClient}
authService={authService}
currentPath={pathname ?? ""}
handleMenuClick={handleClick}
>
{children}
</NoFooterLayout>
);
}
+2
View File
@@ -20,6 +20,7 @@ import { NoFooterLayout } from "@common/components";
import type { MenuItem } from "@/entities/menu";
import { useMenuStore } from "@/shared/lib";
import useStore from '../store/useStore';
import { authService } from "@/entities/auth";
export default function MapLayout({
children,
@@ -57,6 +58,7 @@ export default function MapLayout({
return (
<NoFooterLayout
queryClient={queryClient}
authService={authService}
currentPath={pathname ?? ""}
handleMenuClick={handleMenuClick}
>
+9 -1
View File
@@ -1,9 +1,11 @@
"use client";
import type { MenuItem } from "@common/components/api";
import { NoFooterLayout } from "@common/components/ui";
import { useQueryClient } from "@tanstack/react-query";
import { usePathname,useRouter } from "next/navigation";
import { useMenuStore } from "@/src/shared/lib";
import { useWrStore } from "../store";
import { authService } from "@/src/entities/auth";
export default function MapLayout({
children,
@@ -14,6 +16,7 @@ export default function MapLayout({
const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo);
const router = useRouter();
const pathname = usePathname();
const queryClient = useQueryClient();
const changeMenu = (path: MenuItem) => {
setCurrentMenuInfo(path);
@@ -21,7 +24,12 @@ export default function MapLayout({
router.push(path.urlPath);
};
return (
<NoFooterLayout currentPath={pathname ?? ""} handleMenuClick={changeMenu}>
<NoFooterLayout
queryClient={queryClient}
authService={authService}
currentPath={pathname ?? ""}
handleMenuClick={changeMenu}
>
{children}
</NoFooterLayout>
);