diff --git a/apps/cs/src/pages/menu/ui/base-bottom-menu-form.tsx b/apps/cs/src/pages/menu/ui/base-bottom-menu-form.tsx new file mode 100644 index 000000000..84527d2da --- /dev/null +++ b/apps/cs/src/pages/menu/ui/base-bottom-menu-form.tsx @@ -0,0 +1,122 @@ +import { type UseFormReturn } from "react-hook-form"; +import { + IconFinder, + Input, + Label, + RadioGroup, + RadioGroupItem, + TableCell, + TableHead, + TableRow, +} from "@common/components"; +import { + FormItem, + FormControl, + FormField, + FormMessage, +} from "@/shared/ui/form"; +import type { MenuFormData } from "../model/menu-interface"; + +export function BaseBottomMenuForm({ + form, +}: { + form: UseFormReturn; +}) { + const handleIconClick = (icon: string) => { + form.setValue("iconNm", icon); + }; + + return ( + <> + + 메뉴 서브명 + + ( + + + + + + + )} + /> + + + + 메뉴 아이콘 + +
+
+ {form.watch("iconNm")} +
+ +
+
+
+ + 출력 여부 + + ( + + + +
+
+ + +
+
+ + +
+
+
+
+ +
+ )} + /> +
+
+ + 사용 여부 + + ( + + + +
+
+ + +
+
+ + +
+
+
+
+ +
+ )} + /> +
+
+ + ); +} diff --git a/apps/cs/src/pages/menu/ui/board-menu-form.tsx b/apps/cs/src/pages/menu/ui/board-menu-form.tsx new file mode 100644 index 000000000..a63fe24ff --- /dev/null +++ b/apps/cs/src/pages/menu/ui/board-menu-form.tsx @@ -0,0 +1,144 @@ +import { type UseFormReturn } from "react-hook-form"; +import { + Label, + RadioGroup, + RadioGroupItem, + Table, + TableBody, + TableCell, + TableHead, + TableRow, +} from "@common/components"; +import { + FormItem, + FormControl, + FormField, + FormMessage, +} from "@/shared/ui/form"; +import type { MenuFormData } from "../model/menu-interface"; +import { BaseBottomMenuForm } from "./base-bottom-menu-form"; + +export function BoardMenuForm({ form }: { form: UseFormReturn }) { + return ( + + + + + + + + 게시판 + +
+ {form.watch("menuLnkgSn")} +
+
+
+ + 연결 형태 + + ( + + + +
+
+ + +
+
+ + +
+
+
+
+ +
+ )} + /> +
+
+ + 메뉴 평가 사용 여부 + + ( + + + +
+
+ + +
+
+ + +
+
+
+
+ +
+ )} + /> +
+
+ + + + + QR코드 + + ( + + + +
+
+ + +
+
+ + +
+
+
+
+ +
+ )} + /> +
+
+ + 담당자 + +
+ {form.watch("menuLnkgSn")} +
+
+
+
+
+ ); +} diff --git a/apps/cs/src/pages/menu/ui/bottom-menu-form.tsx b/apps/cs/src/pages/menu/ui/bottom-menu-form.tsx new file mode 100644 index 000000000..88199147b --- /dev/null +++ b/apps/cs/src/pages/menu/ui/bottom-menu-form.tsx @@ -0,0 +1,22 @@ +import { type UseFormReturn } from "react-hook-form"; +import { Table, TableBody } from "@common/components"; +import type { MenuFormData } from "../model/menu-interface"; +import { BaseBottomMenuForm } from "./base-bottom-menu-form"; + +export function BottomMenuForm({ + form, +}: { + form: UseFormReturn; +}) { + return ( + + + + + + + + +
+ ); +} diff --git a/apps/cs/src/pages/menu/ui/content-menu-form.tsx b/apps/cs/src/pages/menu/ui/content-menu-form.tsx index 3bea24ca7..65e806f25 100644 --- a/apps/cs/src/pages/menu/ui/content-menu-form.tsx +++ b/apps/cs/src/pages/menu/ui/content-menu-form.tsx @@ -1,6 +1,5 @@ import { type UseFormReturn } from "react-hook-form"; import { - Input, Label, RadioGroup, RadioGroupItem, @@ -17,6 +16,7 @@ import { FormMessage, } from "@/shared/ui/form"; import type { MenuFormData } from "../model/menu-interface"; +import { BaseBottomMenuForm } from "./base-bottom-menu-form"; export function ContentMenuForm({ form, @@ -38,6 +38,37 @@ export function ContentMenuForm({ + + 연결 형태 + + ( + + + +
+
+ + +
+
+ + +
+
+
+
+ +
+ )} + /> +
+
메뉴 평가 사용 여부 @@ -69,98 +100,9 @@ export function ContentMenuForm({ /> - - 메뉴 서브명 - - ( - - - - - - - )} - /> - - - - 메뉴 아이콘 - -
- {form.watch("iconNm")} -
-
-
- - 출력 여부 - - ( - - - -
-
- - -
-
- - -
-
-
-
- -
- )} - /> -
-
- - 사용 여부 - - ( - - - -
-
- - -
-
- - -
-
-
-
- -
- )} - /> -
-
+ + + QR코드 @@ -192,6 +134,14 @@ export function ContentMenuForm({ /> + + 담당자 + +
+ {form.watch("menuLnkgSn")} +
+
+
); diff --git a/apps/cs/src/pages/menu/ui/empty-menu-form.tsx b/apps/cs/src/pages/menu/ui/empty-menu-form.tsx index 92794aa10..1cdaaed97 100644 --- a/apps/cs/src/pages/menu/ui/empty-menu-form.tsx +++ b/apps/cs/src/pages/menu/ui/empty-menu-form.tsx @@ -1,22 +1,7 @@ import { type UseFormReturn } from "react-hook-form"; -import { - Input, - Label, - RadioGroup, - RadioGroupItem, - Table, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@common/components"; -import { - FormItem, - FormControl, - FormField, - FormMessage, -} from "@/shared/ui/form"; +import { Table, TableBody } from "@common/components"; import type { MenuFormData } from "../model/menu-interface"; +import { BaseBottomMenuForm } from "./base-bottom-menu-form"; export function EmptyMenuForm({ form }: { form: UseFormReturn }) { return ( @@ -26,92 +11,7 @@ export function EmptyMenuForm({ form }: { form: UseFormReturn }) { - - 메뉴 서브명 - - ( - - - - - - - )} - /> - - - - 메뉴 아이콘 - -
- {form.watch("iconNm")} -
-
-
- - 출력 여부 - - ( - - - -
-
- - -
-
- - -
-
-
-
- -
- )} - /> -
-
- - 사용 여부 - - ( - - - -
-
- - -
-
- - -
-
-
-
- -
- )} - /> -
-
+
); diff --git a/apps/cs/src/pages/menu/ui/inside-menu-form.tsx b/apps/cs/src/pages/menu/ui/inside-menu-form.tsx new file mode 100644 index 000000000..8e63a2615 --- /dev/null +++ b/apps/cs/src/pages/menu/ui/inside-menu-form.tsx @@ -0,0 +1,22 @@ +import { type UseFormReturn } from "react-hook-form"; +import { Table, TableBody } from "@common/components"; +import type { MenuFormData } from "../model/menu-interface"; +import { BaseBottomMenuForm } from "./base-bottom-menu-form"; + +export function InsideMenuForm({ + form, +}: { + form: UseFormReturn; +}) { + return ( + + + + + + + + +
+ ); +} diff --git a/apps/cs/src/pages/menu/ui/menu-form.tsx b/apps/cs/src/pages/menu/ui/menu-form.tsx index 30677c288..894927ba0 100644 --- a/apps/cs/src/pages/menu/ui/menu-form.tsx +++ b/apps/cs/src/pages/menu/ui/menu-form.tsx @@ -8,6 +8,10 @@ import { MENU_TYPE, type MenuFormData } from "../model/menu-interface"; import { BaseMenuForm } from "./base-menu-form"; import { EmptyMenuForm } from "./empty-menu-form"; import { ContentMenuForm } from "./content-menu-form"; +import { BoardMenuForm } from "./board-menu-form"; +import { InsideMenuForm } from "./inside-menu-form"; +import { OutsideMenuForm } from "./outside-menu-form"; +import { BottomMenuForm } from "./bottom-menu-form"; interface MenuFormProps { form: UseFormReturn; @@ -93,6 +97,14 @@ function renderMenuTypeComponent( return ; case MENU_TYPE.CONTENTS: return ; + case MENU_TYPE.BOARD: + return ; + case MENU_TYPE.INSIDE: + return ; + case MENU_TYPE.OUTSIDE: + return ; + case MENU_TYPE.BOTTOM: + return ; default: return null; } diff --git a/apps/cs/src/pages/menu/ui/outside-menu-form.tsx b/apps/cs/src/pages/menu/ui/outside-menu-form.tsx new file mode 100644 index 000000000..b92977a83 --- /dev/null +++ b/apps/cs/src/pages/menu/ui/outside-menu-form.tsx @@ -0,0 +1,22 @@ +import { type UseFormReturn } from "react-hook-form"; +import { Table, TableBody } from "@common/components"; +import type { MenuFormData } from "../model/menu-interface"; +import { BaseBottomMenuForm } from "./base-bottom-menu-form"; + +export function OutsideMenuForm({ + form, +}: { + form: UseFormReturn; +}) { + return ( + + + + + + + + +
+ ); +} diff --git a/packages/common/components/src/ui/icon-finder/index.tsx b/packages/common/components/src/ui/icon-finder/index.tsx index 71f6f9c18..62e6e195a 100644 --- a/packages/common/components/src/ui/icon-finder/index.tsx +++ b/packages/common/components/src/ui/icon-finder/index.tsx @@ -1,18 +1,39 @@ +import { useState } from "react"; import { Button } from "../button"; import { Dialog, DialogContent, DialogTrigger } from "../dialog"; +import { cn } from "../../lib"; import iconNames from "./data"; -const IconFinder = () => { +type IconFinderProps = { + handleClick: (icon: string) => void; +}; + +const IconFinder = ({ handleClick }: IconFinderProps) => { + const [selectedIcon, setSelectedIcon] = useState(""); + + const handleIconClick = (icon: string) => { + setSelectedIcon(icon); + handleClick(icon); + }; + return ( - +
-
+
{iconNames.map((icon) => ( - + ))}
@@ -21,9 +42,29 @@ const IconFinder = () => { ); }; -const IconItem = ({ icon }: { icon: string }) => { +const IconItem = ({ + icon, + selectedIcon, + handleClick, +}: { + icon: string; + selectedIcon: string; + handleClick: (icon: string) => void; +}) => { return ( -
+
handleClick(icon)} + > + {icon}
diff --git a/packages/common/components/src/ui/index.ts b/packages/common/components/src/ui/index.ts index 438c18dbd..650eb30e1 100644 --- a/packages/common/components/src/ui/index.ts +++ b/packages/common/components/src/ui/index.ts @@ -7,8 +7,8 @@ export * from "./data-table"; export * from "./date-picker"; export * from "./dialog"; export * from "./dropdown-menu"; -export * from "./input"; export * from "./file-search"; +export * from "./icon-finder"; export * from "./input"; export * from "./label"; export * from "./layout";