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. + +
+ +
+ +
+ +

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

+ + + +
+ +
+ +

주의 사항

+ +
+ + λ°±μ—… μ €μž₯μ†Œμ˜ μš©λŸ‰μ„ λ°˜λ“œμ‹œ ν™•μΈν•˜μ„Έμš”. μ €μž₯ 곡간이 λΆ€μ‘±ν•˜λ©΄ 백업이 μ‹€νŒ¨ν•  수 μžˆμŠ΅λ‹ˆλ‹€. + +
+ +
+ + + +
+ +`; + 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', + }} + /> +
) : (

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