From 549bd43e01aab58faddf716e7932c11edee98420 Mon Sep 17 00:00:00 2001 From: myeongheonhong Date: Tue, 9 Jan 2024 18:11:23 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[=20style=20]=20=EC=A7=80=EB=82=9C=20?= =?UTF-8?q?=EC=86=8C=EC=9B=90=EB=A7=81=ED=81=AC=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=ED=81=AC=20=EA=B0=84=EA=B2=A9=20=EC=A1=B0=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Mypage/Links/[id].tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/Mypage/Links/[id].tsx b/components/Mypage/Links/[id].tsx index 2c0ae8f8..17061293 100644 --- a/components/Mypage/Links/[id].tsx +++ b/components/Mypage/Links/[id].tsx @@ -69,6 +69,10 @@ const Styled = { display: flex; flex-direction: column; justify-content: center; + + width: 100%; + + margin-left: 4.3rem; `, BarContainer: styled.div` @@ -79,7 +83,6 @@ const Styled = { ImageContainer: styled.div` width: 100%; text-align: center; - padding: 4rem 0 0; `, About: styled.div` From 4b6ab09670af7439a497d6777797d00a009ec7ea Mon Sep 17 00:00:00 2001 From: myeongheonhong Date: Tue, 9 Jan 2024 18:12:11 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[=20fix=20]=20=ED=8E=80=EB=94=A9=EC=A7=84?= =?UTF-8?q?=ED=96=89=EC=83=81=ED=83=9C=EC=97=90=EC=84=9C=200=EC=9B=90?= =?UTF-8?q?=EC=9D=BC=EB=95=8C=200=EC=9C=BC=EB=A1=9C=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=EC=97=90=EB=9F=AC=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Common/VerticalProgressBar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Common/VerticalProgressBar.tsx b/components/Common/VerticalProgressBar.tsx index fc647f2c..1d56a60a 100644 --- a/components/Common/VerticalProgressBar.tsx +++ b/components/Common/VerticalProgressBar.tsx @@ -19,7 +19,7 @@ export default function VerticalProgressBar(props: ProgressBarProps) { {/* 리팩토링 1순위 ㅋㅋㅋ */} - {percent && percent >= 100 && ( + {percent && percent > 0 && percent >= 100 ? ( 불꽃 아이콘 + ) : ( + '' )} From 535c3c62345ce05e149fae37b64389b7832b80a4 Mon Sep 17 00:00:00 2001 From: myeongheonhong Date: Tue, 9 Jan 2024 18:16:53 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[=20feat=20]=20=EC=86=8C=EC=9B=90=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Mypage/Links/index.tsx | 22 +++++++++++++--------- hooks/queries/wishes.ts | 14 +++++++++++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/components/Mypage/Links/index.tsx b/components/Mypage/Links/index.tsx index ef676d7d..c8e9a87c 100644 --- a/components/Mypage/Links/index.tsx +++ b/components/Mypage/Links/index.tsx @@ -6,16 +6,15 @@ import DeleteModal from '@/components/Common/Modal/DeleteModal'; import { useState } from 'react'; import WishLists from './WishLists'; import NoWishLists from './NoWishLists'; -import { useQueryClient } from 'react-query'; -import { QUERY_KEY } from '@/constant/queryKey'; import { useDeleteWishes, useGetWishLinks } from '@/hooks/queries/wishes'; +import Image from 'next/image'; +import { DeleteBtnIc } from '@/public/assets/icons'; export default function LinksMainContainer() { const [selectedLinks, setSelectedLinks] = useState([]); const { isOpen, handleToggle } = useModal(); - const queryClient = useQueryClient(); - const deleteWishesMutation = useDeleteWishes(); + const { handleDeleteWishes } = useDeleteWishes(); const { wishLinks, noWishes } = useGetWishLinks(); @@ -29,11 +28,7 @@ export default function LinksMainContainer() { const handleDeleteConfirm = () => { if (selectedLinks.length > 0) { - deleteWishesMutation.mutate(selectedLinks, { - onSuccess: () => { - queryClient.invalidateQueries(QUERY_KEY.WISH_LINKS); - }, - }); + handleDeleteWishes(selectedLinks); } }; @@ -48,6 +43,9 @@ export default function LinksMainContainer() { /> )} + selectedLinks.length > 0 && handleToggle()}> + 삭제 아이콘 + 지난 소원 링크 모음 @@ -77,4 +75,10 @@ const Styled = { color: ${theme.colors.gray4}; margin: 2rem 1rem 2rem; `, + + DeleteIconButton: styled.button` + position: fixed; + top: 1.9rem; + right: 2.2rem; + `, }; diff --git a/hooks/queries/wishes.ts b/hooks/queries/wishes.ts index a9942aa2..1598829e 100644 --- a/hooks/queries/wishes.ts +++ b/hooks/queries/wishes.ts @@ -15,7 +15,7 @@ import { WishLinksType } from '@/types/links/wishLinksType'; import router from 'next/router'; import { useState } from 'react'; import { UseFormReturn } from 'react-hook-form'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery, useQueryClient } from 'react-query'; import { useSetRecoilState } from 'recoil'; /** @@ -77,9 +77,17 @@ export function usePostWishes(methods: UseFormReturn deleteWishes(wishesData)); + const queryClient = useQueryClient(); + const { data, mutate: handleDeleteWishes } = useMutation( + (wishesData: number[]) => deleteWishes(wishesData), + { + onSuccess: () => { + queryClient.invalidateQueries(QUERY_KEY.WISH_LINKS); + }, + }, + ); - return mutation; + return { data, handleDeleteWishes }; } /** From 3b2a5bf75ea273527bfce062ea0c34537708aac1 Mon Sep 17 00:00:00 2001 From: myeongheonhong Date: Tue, 9 Jan 2024 18:17:15 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[=20chore=20]=20=ED=97=A4=EB=8D=94=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Mypage/Links/[id].tsx | 3 ++- pages/mypage/links/[id].tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/Mypage/Links/[id].tsx b/components/Mypage/Links/[id].tsx index 17061293..447a5597 100644 --- a/components/Mypage/Links/[id].tsx +++ b/components/Mypage/Links/[id].tsx @@ -7,6 +7,7 @@ import { useEffect, useState } from 'react'; import { convertDateFormat } from '@/hooks/common/useDate'; import VerticalProgressBar from '@/components/Common/VerticalProgressBar'; import { useGetSingleWishInfo } from '@/hooks/queries/wishes'; +import { convertMoneyText } from '@/utils/common/convertMoneyText'; export default function LinksContainer() { const [wishId, setWishId] = useState(''); @@ -36,7 +37,7 @@ export default function LinksContainer() { 케이크 모인 케이크 보러가기 {'>'} - 총 {wishData?.price}원 + 총 {convertMoneyText(String(wishData?.price))}원 diff --git a/pages/mypage/links/[id].tsx b/pages/mypage/links/[id].tsx index 2f5b3214..fbef8626 100644 --- a/pages/mypage/links/[id].tsx +++ b/pages/mypage/links/[id].tsx @@ -3,7 +3,7 @@ import LinksContainer from '@/components/Mypage/Links/[id]'; export default function LinksPage() { return ( - + );