chore: getCurrentMenu 수정

This commit is contained in:
2025-04-10 18:18:35 +09:00
parent 93e066ebe5
commit 694cd4893e
7 changed files with 17 additions and 13 deletions
+5 -1
View File
@@ -5,7 +5,11 @@ export const getCurrentMenu = (
pathname: string,
): MenuItem | null => {
for (const menu of menus) {
if (menu.urlPath === pathname) return menu;
if (
menu.urlPath !== "" &&
(menu.urlPath === pathname || pathname.startsWith(menu.urlPath))
)
return menu;
if (menu.children) {
const children = getCurrentMenu(menu.children, pathname);
+2 -2
View File
@@ -77,8 +77,8 @@ function BannerForm({ form, bnrSn, ...props }: BannerFormProps) {
<div className="card">
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
<col width="15%" />
<col width="85%" />
</colgroup>
<TableBody>
<TableRow>
+2 -2
View File
@@ -83,8 +83,8 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
<div className="card">
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
<col width="15%" />
<col width="85%" />
</colgroup>
<TableBody>
<TableRow>
+2 -2
View File
@@ -22,8 +22,8 @@ function BaseMenuForm({ form, menuCd }: BaseMenuFormProps) {
return (
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
<col width="15%" />
<col width="85%" />
</colgroup>
<TableBody>
{menuCd && (
+2 -2
View File
@@ -55,8 +55,8 @@ function TypeMenuForm({ form, menuType }: TypeMenuFormProps) {
return (
<Table variant="secondary" className="-mt-[0.1rem]">
<colgroup>
<col width="20%" />
<col width="80%" />
<col width="15%" />
<col width="85%" />
</colgroup>
<TableBody>
{menuType === "CONTENTS" && (
+2 -2
View File
@@ -44,8 +44,8 @@ function SiteForm({ form, siteId, ...props }: SiteFormProps) {
<div className="card">
<Table variant="secondary">
<colgroup>
<col width="20%" />
<col width="80%" />
<col width="15%" />
<col width="85%" />
</colgroup>
<TableBody>
<TableRow>
@@ -34,8 +34,8 @@ function TemplateForm({ form, tmpltSn, ...props }: TemplateFormProps) {
<div className="card">
<Table variant="secondary">
<colgroup>
<col width="10%" />
<col width="90%" />
<col width="15%" />
<col width="85%" />
</colgroup>
<TableBody>
<TableRow>