From 081379db73eb0d5443b751d3c70bebfd13c11af9 Mon Sep 17 00:00:00 2001 From: nocheol Date: Fri, 10 May 2024 17:55:29 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20:=20popover=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit/[planId]/hooks/usePlanEditPage.tsx | 5 +- src/app/plans/edit/[planId]/page.tsx | 50 ++++++++----------- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/src/app/plans/edit/[planId]/hooks/usePlanEditPage.tsx b/src/app/plans/edit/[planId]/hooks/usePlanEditPage.tsx index a07a85a1..44cf5acd 100644 --- a/src/app/plans/edit/[planId]/hooks/usePlanEditPage.tsx +++ b/src/app/plans/edit/[planId]/hooks/usePlanEditPage.tsx @@ -3,7 +3,7 @@ import { useEditPlanMutation } from '@/hooks/apis/useEditPlanMutation'; import { useGetPlanQuery } from '@/hooks/apis/useGetPlanQuery'; import { useWritablePlan } from '@/hooks/useWritablePlan'; import { useRouter } from 'next/navigation'; -import { useEffect, useState } from 'react'; +import { useEffect } from 'react'; export default function usePlanEditPage(planId: string) { const router = useRouter(); @@ -27,7 +27,6 @@ export default function usePlanEditPage(planId: string) { handleRemoveTag, handleChangeIconNumber, } = useWritablePlan(planData); - const [isSelectIconModalOpen, setIsSelectIconModalOpen] = useState(false); const handleEditPlan = () => { editPlan( @@ -46,10 +45,8 @@ export default function usePlanEditPage(planId: string) { return { planId, nextTextAreaRef, - isSelectIconModalOpen, planContent, planData, - setIsSelectIconModalOpen, handleAddTag, handleChangeCanAjaja, handleChangeDescription, diff --git a/src/app/plans/edit/[planId]/page.tsx b/src/app/plans/edit/[planId]/page.tsx index e2772798..bd6e4b32 100644 --- a/src/app/plans/edit/[planId]/page.tsx +++ b/src/app/plans/edit/[planId]/page.tsx @@ -6,9 +6,9 @@ import { DeletableTag, HelpButton, IconSwitchButton, - Modal, ModalSelectIcon, PlanInput, + Popover, TagInput, } from '@/components'; import { planIcons } from '@/constants/planIcons'; @@ -22,10 +22,8 @@ export default function EditPage({ params }: { params: { planId: string } }) { const { planId, nextTextAreaRef, - isSelectIconModalOpen, planContent, planData, - setIsSelectIconModalOpen, handleAddTag, handleChangeCanAjaja, handleChangeDescription, @@ -48,25 +46,32 @@ export default function EditPage({ params }: { params: { planId: string } }) {
- + 아이콘을 클랙해 변경할 수 있어요
-
+
-
+
- - {isSelectIconModalOpen && ( - - { - setIsSelectIconModalOpen(false); - }} - /> - - )}
); }