From 7fdab038a2073eb014bd6e6f0a28be6a86dd5cf6 Mon Sep 17 00:00:00 2001 From: SeongMin Kim <86355699+Collection50@users.noreply.github.com> Date: Sat, 14 Sep 2024 13:19:24 +0900 Subject: [PATCH] =?UTF-8?q?fix(my-info):=20=EC=B9=B4=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20UI=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20(#91?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix * fix * remove --- .../(my-info)/components/AddInfoCardDialog.tsx | 17 ++++++++++++----- src/app/(sidebar)/(my-info)/page.tsx | 2 +- .../MemoContainer/Memo/DeleteMemoDialog.tsx | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx b/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx index b8f1b0c..acc3927 100644 --- a/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx +++ b/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx @@ -1,7 +1,7 @@ import { Icon } from '@/system/components'; import { Dialog, DialogClose, DialogContent, DialogTitle, DialogTrigger } from '@/system/components/Dialog/Dialog'; import { TagType, InfoType, INFO_TYPES } from '@/types/info'; -import { PropsWithChildren, useState } from 'react'; +import { PropsWithChildren, useEffect, useState } from 'react'; import { TagSelector } from '../../write/[id]/components/TagSelector/TagSelector'; import { If } from '@/system/utils/If'; import { cn } from '@/utils/tailwind-util'; @@ -12,11 +12,14 @@ import { TouchButton } from '@/components/TouchButton'; import { useRouter } from 'next/navigation'; import { motion } from 'framer-motion'; -export function AddInfoCardDialog({ children }: PropsWithChildren) { +export function AddInfoCardDialog({ + children, + currentCardType = '경험_정리', +}: PropsWithChildren<{ currentCardType?: InfoType }>) { const router = useRouter(); const [selectedTagList, setSelectedTagList] = useState([]); - const [selectedType, setSelectedType] = useState(null); + const [selectedType, setSelectedType] = useState(currentCardType || null); const [isOpenTagSelector, setIsOpenTagSelector] = useState(false); const [isOpenTypeSelector, setIsOpenTypeSelector] = useState(false); @@ -38,6 +41,10 @@ export function AddInfoCardDialog({ children }: PropsWithChildren) { router.push(`/write/${res.cardId}`); }; + useEffect(() => { + setSelectedType(currentCardType); + }, [currentCardType]); + return ( { @@ -102,7 +109,7 @@ export function AddInfoCardDialog({ children }: PropsWithChildren) { {abilityTagList.map((tag) => ( { if (selectedTagList.length < 3 && !selectedTagList.find(({ id }) => id === tag.id)) { setSelectedTagList((prev) => [...prev, tag]); @@ -119,7 +126,7 @@ export function AddInfoCardDialog({ children }: PropsWithChildren) { {personalityTagList.map((tag) => ( { if (selectedTagList.length < 3 && !selectedTagList.find(({ id }) => id === tag.id)) { setSelectedTagList((prev) => [...prev, tag]); diff --git a/src/app/(sidebar)/(my-info)/page.tsx b/src/app/(sidebar)/(my-info)/page.tsx index dc776a7..b890262 100644 --- a/src/app/(sidebar)/(my-info)/page.tsx +++ b/src/app/(sidebar)/(my-info)/page.tsx @@ -109,7 +109,7 @@ export default function MyInfo() { ))} - +
-
+
' -

{memo}

+

{memo}

'

메모를 정말 삭제하시겠습니까?