From 85c1a7a5e39b62196479302f04d8fa45b9558c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A7=80=EC=B2=A0?= Date: Fri, 14 Nov 2025 14:17:59 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=84=EC=9B=80=EB=A7=90=ED=85=9C=ED=94=8C?= =?UTF-8?q?=EB=A6=BF=EB=A6=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cs/src/pages/menu/ui/type-menu-form.tsx | 93 +++++++++++++++++++ .../common/components/src/ui/lnb/index.tsx | 23 ++++- 2 files changed, 111 insertions(+), 5 deletions(-) diff --git a/apps/cs/src/pages/menu/ui/type-menu-form.tsx b/apps/cs/src/pages/menu/ui/type-menu-form.tsx index 9f2864c3b..650ddcb96 100644 --- a/apps/cs/src/pages/menu/ui/type-menu-form.tsx +++ b/apps/cs/src/pages/menu/ui/type-menu-form.tsx @@ -1,5 +1,6 @@ import dynamic from "next/dynamic"; import dayjs from "dayjs"; +import { useEffect, useRef } from "react"; import type { UseFormReturn } from "react-hook-form"; import { DatePicker, @@ -30,12 +31,91 @@ const Editor = dynamic( { ssr: false }, ); +const DEFAULT_HELP_CONTENT = ` + +
+ +

πŸ“Œ κΈ°λŠ₯λͺ…: 예) μžλ™ λ°±μ—…

+ +

이 κΈ°λŠ₯은 데이터λ₯Ό μžλ™μœΌλ‘œ λ°±μ—…ν•˜μ—¬ μ•ˆμ „ν•˜κ²Œ λ³΄κ΄€ν•©λ‹ˆλ‹€.

+ +
+ +
+ +
+ +

κΈ°λŠ₯ κ°œμš”

+ +

μžλ™ λ°±μ—… κΈ°λŠ₯은 μ‚¬μš©μžμ˜ 데이터λ₯Ό μ„€μ •λœ 주기와 쑰건에 따라 μžλ™μœΌλ‘œ μ €μž₯μ†Œμ— λ°±μ—…ν•©λ‹ˆλ‹€.

+ +
+ +
+ +

μ‚¬μš© 방법

+ +
    + +
  1. μ„€μ • λ©”λ‰΄μ—μ„œ μžλ™ 백업을 ν™œμ„±ν™”ν•©λ‹ˆλ‹€.
  2. + +
  3. λ°±μ—… μ£ΌκΈ°(예: 맀일, λ§€μ£Ό)λ₯Ό μ„ νƒν•©λ‹ˆλ‹€.
  4. + +
  5. λ°±μ—… λŒ€μƒ 폴더 및 μ €μž₯ μœ„μΉ˜λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€.
  6. + +
  7. 섀정을 μ €μž₯ν•˜λ©΄ μžλ™μœΌλ‘œ 백업이 μ‹œμž‘λ©λ‹ˆλ‹€.
  8. + +
+ +
+ +
+ +

μ£Όμš” κΈ°λŠ₯

+ +
    + +
  • λ°±μ—… μ£ΌκΈ° μ„€μ •
  • + +
  • ν΄λΌμš°λ“œ λ˜λŠ” 둜컬 μ €μž₯μ†Œ 선택
  • + +
  • λ°±μ—… 둜그 확인
  • + +
  • 였λ₯˜ λ°œμƒ μ‹œ μ•Œλ¦Ό κΈ°λŠ₯
  • + +
+ +
+ +
+ +

주의 사항

+ +
+ + λ°±μ—… μ €μž₯μ†Œμ˜ μš©λŸ‰μ„ λ°˜λ“œμ‹œ ν™•μΈν•˜μ„Έμš”. μ €μž₯ 곡간이 λΆ€μ‘±ν•˜λ©΄ 백업이 μ‹€νŒ¨ν•  수 μžˆμŠ΅λ‹ˆλ‹€. + +
+ +
+ +
+ + © 2025 νšŒμ‚¬λͺ… | κΈ°λŠ₯ 메뉴얼 v1.0 + +
+ +
+ +`; + type TypeMenuFormProps = { form: UseFormReturn; menuType: MenuType; }; function TypeMenuForm({ form, menuType }: TypeMenuFormProps) { + const hasSetDefaultHelpContent = useRef(false); const handleIconClick = (icon: string) => { form.setValue("iconNm", icon); }; @@ -65,6 +145,19 @@ function TypeMenuForm({ form, menuType }: TypeMenuFormProps) { form.setValue("menuPicDsgnYmd", dayjs(date).format("YYYYMMDD")); }; + useEffect(() => { + if (menuType === "INSIDE") { + const currentValue = form.getValues("menuHlpCn"); + if ((!currentValue || currentValue.trim() === "") && !hasSetDefaultHelpContent.current) { + form.setValue("menuHlpCn", DEFAULT_HELP_CONTENT); + hasSetDefaultHelpContent.current = true; + } + } else { + // menuType이 "INSIDE"κ°€ 아닐 λ•Œ ref 리셋 + hasSetDefaultHelpContent.current = false; + } + }, [menuType, form]); + const getUrlPathPlaceholder = () => { if (menuType === "CONTENTS") return "μ½˜ν…μΈ  선택 μ‹œ μžλ™μœΌλ‘œ μž…λ ₯λ©λ‹ˆλ‹€."; if (menuType === "BOARD") return "κ²Œμ‹œνŒ 선택 μ‹œ μžλ™μœΌλ‘œ μž…λ ₯λ©λ‹ˆλ‹€."; diff --git a/packages/common/components/src/ui/lnb/index.tsx b/packages/common/components/src/ui/lnb/index.tsx index b90868ef2..12b50e324 100644 --- a/packages/common/components/src/ui/lnb/index.tsx +++ b/packages/common/components/src/ui/lnb/index.tsx @@ -299,16 +299,29 @@ export function LNB({ - + 도움말 -
+
{helpContent ? (
+ style={{ + fontSize: '16px', + lineHeight: '1.5', + }} + > +
]*>/gi, '
') + .replace(/<\/body>/gi, '
') + }} + style={{ + fontSize: 'inherit', + }} + /> +
) : (

ν˜„μž¬ νŽ˜μ΄μ§€μ— λŒ€ν•œ 도움말이 μ—†μŠ΅λ‹ˆλ‹€.