From 3f790f3a7c3a30cc8dae6975b1eab90ee3c8375c Mon Sep 17 00:00:00 2001 From: Collection50 Date: Sat, 14 Sep 2024 13:08:01 +0900 Subject: [PATCH 1/3] Fix --- .../components/AddInfoCardDialog.tsx | 19 ++++++++++++++----- src/app/(sidebar)/(my-info)/page.tsx | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx b/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx index b8f1b0c..f573d53 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,16 @@ 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(); + console.log('currentCardType', currentCardType); + 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 +43,10 @@ export function AddInfoCardDialog({ children }: PropsWithChildren) { router.push(`/write/${res.cardId}`); }; + useEffect(() => { + setSelectedType(currentCardType); + }, [currentCardType]); + return ( { @@ -102,7 +111,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 +128,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() { ))} - + Date: Sat, 14 Sep 2024 13:11:55 +0900 Subject: [PATCH 2/3] fix --- .../[id]/components/MemoContainer/Memo/DeleteMemoDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/(sidebar)/write/[id]/components/MemoContainer/Memo/DeleteMemoDialog.tsx b/src/app/(sidebar)/write/[id]/components/MemoContainer/Memo/DeleteMemoDialog.tsx index 2d4db98..b995acb 100644 --- a/src/app/(sidebar)/write/[id]/components/MemoContainer/Memo/DeleteMemoDialog.tsx +++ b/src/app/(sidebar)/write/[id]/components/MemoContainer/Memo/DeleteMemoDialog.tsx @@ -18,9 +18,9 @@ export function DeleteMemoDialog({
-
+
' -

{memo}

+

{memo}

'

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

From 2976f0716dd92077f9ea0589beb2d273c45c422c Mon Sep 17 00:00:00 2001 From: Collection50 Date: Sat, 14 Sep 2024 13:13:29 +0900 Subject: [PATCH 3/3] remove --- src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx b/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx index f573d53..acc3927 100644 --- a/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx +++ b/src/app/(sidebar)/(my-info)/components/AddInfoCardDialog.tsx @@ -18,8 +18,6 @@ export function AddInfoCardDialog({ }: PropsWithChildren<{ currentCardType?: InfoType }>) { const router = useRouter(); - console.log('currentCardType', currentCardType); - const [selectedTagList, setSelectedTagList] = useState([]); const [selectedType, setSelectedType] = useState(currentCardType || null);