From 91a7ee14d693a4d123d6eb3f5429661a59e26723 Mon Sep 17 00:00:00 2001 From: seoAreum <1971236@hansung.ac.kr> Date: Wed, 24 Apr 2024 23:16:09 +0900 Subject: [PATCH 01/20] =?UTF-8?q?fix:=20=EC=9D=BC=EB=9F=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EA=B9=A8=EC=A7=80=EB=8A=94=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/img/img_home_01.svg | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/assets/img/img_home_01.svg b/src/assets/img/img_home_01.svg index 90fee7d4..c693434f 100644 --- a/src/assets/img/img_home_01.svg +++ b/src/assets/img/img_home_01.svg @@ -1,15 +1,15 @@ - - + + - - + + - + @@ -38,7 +38,7 @@ - + @@ -46,58 +46,58 @@ - - - - - + + + + + - + - - + + - + - - + + - + - + - - + + - + - + - - + + From bfe58ddd74117b883fe856da7433b351c5396201 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Thu, 25 Apr 2024 01:04:49 +0900 Subject: [PATCH 02/20] =?UTF-8?q?fix:=20=EB=8B=89=EB=84=A4=EC=9E=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20=EC=8B=9C,=20=EC=B2=98=EC=9D=8C=20=EA=B8=80?= =?UTF-8?q?=EC=9E=90=20=EC=88=98=20=EC=A0=95=EC=83=81=EC=A0=81=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=98=EC=98=81=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/components/NicknameInput/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditNickname/components/NicknameInput/index.tsx b/src/EditNickname/components/NicknameInput/index.tsx index 0a9123c1..171af933 100644 --- a/src/EditNickname/components/NicknameInput/index.tsx +++ b/src/EditNickname/components/NicknameInput/index.tsx @@ -10,8 +10,8 @@ function NicknameInput({ handleSetNickname, handleSetIsValid, }: NicknameInputProps) { - const [wordCnt, setWordCnt] = useState(0); const currentNickname: string = localStorage.getItem('nickname') || ''; + const [wordCnt, setWordCnt] = useState(currentNickname.length); const handleSetWordCnt = (wordCnt: number) => { setWordCnt(wordCnt); From 39ae427234d2b375ccafd55dde0dfcfa7952828d Mon Sep 17 00:00:00 2001 From: seoAreum <1971236@hansung.ac.kr> Date: Thu, 25 Apr 2024 01:04:54 +0900 Subject: [PATCH 03/20] =?UTF-8?q?style:=20=EC=95=84=EC=9D=B4=EC=BD=98=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Home/components/HomeMainBanner/HomeMainBanner.style.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Home/components/HomeMainBanner/HomeMainBanner.style.ts b/src/Home/components/HomeMainBanner/HomeMainBanner.style.ts index 00cf085c..67596e3f 100644 --- a/src/Home/components/HomeMainBanner/HomeMainBanner.style.ts +++ b/src/Home/components/HomeMainBanner/HomeMainBanner.style.ts @@ -8,11 +8,10 @@ export const MainWrapper = styled.div` export const IconWrapper = styled.section` display: flex; - gap: 16rem; - align-items: baseline; + justify-content: space-between; + align-items: flex-end; - width: 100%; - margin: 4rem 1.8rem 3.5rem 1.6rem; + margin: 4rem 1.6rem 3.4rem; `; export const Button = styled.button` From afd838c7350671df97f3cc16693a65c25d080f3f Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Thu, 25 Apr 2024 01:22:08 +0900 Subject: [PATCH 04/20] =?UTF-8?q?fix:=20=EB=A0=88=ED=81=90=EB=B6=81=20?= =?UTF-8?q?=EC=A0=9C=EC=9E=91=20=EB=B7=B0=20=EC=B5=9C=EC=95=A0=20=EC=9B=8C?= =?UTF-8?q?=EB=94=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Target/components/NameInput/index.tsx | 2 +- src/Target/page/TargetPage/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Target/components/NameInput/index.tsx b/src/Target/components/NameInput/index.tsx index 960e9796..e69abef1 100644 --- a/src/Target/components/NameInput/index.tsx +++ b/src/Target/components/NameInput/index.tsx @@ -16,7 +16,7 @@ function NameInput({ name, changeName }: NameInputProps) { diff --git a/src/Target/page/TargetPage/index.tsx b/src/Target/page/TargetPage/index.tsx index ad0e9afa..c3bbd604 100644 --- a/src/Target/page/TargetPage/index.tsx +++ b/src/Target/page/TargetPage/index.tsx @@ -83,11 +83,11 @@ function TargetPage() { - 최애의 이름 + 이름 입력 setName(name)} /> - 최애의 사진 업로드 + 사진 업로드 setFileData(file)} /> From 8812f285b1dfcfe2163e5b4598f26036b39a7585 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Thu, 25 Apr 2024 17:27:42 +0900 Subject: [PATCH 05/20] =?UTF-8?q?refetchQueries=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EC=97=AC=20=EA=B9=9C=EB=B9=A1=EC=9E=84=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/hooks/usePatchNickname.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/EditNickname/hooks/usePatchNickname.ts b/src/EditNickname/hooks/usePatchNickname.ts index f31a1331..9098f845 100644 --- a/src/EditNickname/hooks/usePatchNickname.ts +++ b/src/EditNickname/hooks/usePatchNickname.ts @@ -1,5 +1,5 @@ import { AxiosError } from 'axios'; -import { useMutation } from 'react-query'; +import { useMutation, useQueryClient } from 'react-query'; import { useNavigate } from 'react-router-dom'; import { patchNickname } from '../api/patchNickname'; @@ -12,6 +12,7 @@ const usePatchNickname = (props: usePatchNicknameProps) => { const { handleSetIsValid, handleSetIsActive, token, nickname } = props; const navigate = useNavigate(); + const queryClient = useQueryClient(); const mutation = useMutation({ mutationFn: async ({ token, nickname }: patchNicknameProps) => { @@ -31,6 +32,10 @@ const usePatchNickname = (props: usePatchNicknameProps) => { } }, onSuccess: () => { + queryClient.refetchQueries(['useGetMyNickName'], { + exact: true, + }); + window.localStorage.setItem('token', token); window.localStorage.setItem('nickname', nickname); navigate('/'); From b9cbc4ce34a42e41655af6a8faad33a611750fcf Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Thu, 25 Apr 2024 17:30:09 +0900 Subject: [PATCH 06/20] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=20props=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20&=20props=20type=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/components/NicknameInput/index.tsx | 1 - src/EditNickname/types/editNicknameTypes.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/EditNickname/components/NicknameInput/index.tsx b/src/EditNickname/components/NicknameInput/index.tsx index 171af933..569ab48a 100644 --- a/src/EditNickname/components/NicknameInput/index.tsx +++ b/src/EditNickname/components/NicknameInput/index.tsx @@ -29,7 +29,6 @@ function NicknameInput({ handleSetNickname, handleSetWordCnt, handleSetIsValid, - currentNickname, e, }); }} diff --git a/src/EditNickname/types/editNicknameTypes.ts b/src/EditNickname/types/editNicknameTypes.ts index d54509cd..e7cf487b 100644 --- a/src/EditNickname/types/editNicknameTypes.ts +++ b/src/EditNickname/types/editNicknameTypes.ts @@ -26,7 +26,6 @@ export interface CheckNicknameProps { handleSetNickname: (nickname: string) => void; handleSetWordCnt: (wordCnt: number) => void; handleSetIsValid: (isValid: isValidState) => void; - currentNickname: string; e: React.ChangeEvent; } From 103fa14167dd7ee6513eb8826ad06fbe85b8d8ae Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 25 Apr 2024 23:48:54 +0900 Subject: [PATCH 07/20] =?UTF-8?q?chore:=20query=20key=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/hooks/useGetMyBookList.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/History/hooks/useGetMyBookList.ts b/src/History/hooks/useGetMyBookList.ts index 18b32d38..0141d8a0 100644 --- a/src/History/hooks/useGetMyBookList.ts +++ b/src/History/hooks/useGetMyBookList.ts @@ -6,7 +6,7 @@ import { getMyBookList } from '../api/getMyBookList'; export default function useGetMyBookList() { const navigate = useNavigate(); const { data: myBookList, isLoading } = useQuery( - ['useGetMyBookList'], + ['get-my-lecueBook'], () => getMyBookList(), { onError: () => { From f7e31126c24cc5e543d89f70e63aed2992cc3339 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 26 Apr 2024 00:12:50 +0900 Subject: [PATCH 08/20] =?UTF-8?q?feat:=20reload=20>=20refetch=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/hooks/useDeleteMyBook.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/History/hooks/useDeleteMyBook.ts b/src/History/hooks/useDeleteMyBook.ts index 9001b886..5557f129 100644 --- a/src/History/hooks/useDeleteMyBook.ts +++ b/src/History/hooks/useDeleteMyBook.ts @@ -1,16 +1,21 @@ -import { useMutation } from 'react-query'; +import { useMutation, useQueryClient } from 'react-query'; import { useNavigate } from 'react-router-dom'; import { deleteMyBook } from '../api/deleteMyBook'; const useDeleteMyBook = () => { const navigate = useNavigate(); + const queryClient = useQueryClient(); const mutation = useMutation({ mutationFn: (noteId: number) => { return deleteMyBook(noteId); }, onError: () => navigate('/error'), - onSuccess: () => location.reload(), + onSuccess: () => { + queryClient.refetchQueries(['get-my-lecueBook'], { + exact: true, + }); + }, }); return mutation; }; From f599b5bb3b0102b0d3c2aeaaff82fddced8f25c9 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 26 Apr 2024 00:15:18 +0900 Subject: [PATCH 09/20] =?UTF-8?q?fix:=20=EC=A6=90=EA=B2=A8=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0&=EB=A0=88=ED=81=90=EB=B6=81=20=EC=8B=B1=ED=81=AC=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=94=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/MyLecueBook/index.tsx | 11 ++++------- src/components/common/LecueBook/index.tsx | 2 +- src/libs/hooks/useDeleteFavorite.ts | 20 ++++++++++++++++---- src/libs/hooks/usePostFavorite.ts | 8 +++++++- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/History/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx index 7210fcf7..549044ec 100644 --- a/src/History/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -21,13 +21,12 @@ function MyLecueBook(props: LecueBookProps) { } = props; const [noteCount, setNoteCount] = useState(''); const [modalOn, setModalOn] = useState(false); - const [favorite, setFavorite] = useState(isFavorite); const navigate = useNavigate(); const deleteMutation = useDeleteMyBook(); const FavoritePostMutation = usePostFavorite(); - const FavoriteDeleteMutation = useDeleteFavorite('mypage'); + const FavoriteDeleteMutation = useDeleteFavorite('myLecueBook'); const convertNoteCount = (noteNum: number) => { setNoteCount(noteNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); @@ -49,12 +48,10 @@ function MyLecueBook(props: LecueBookProps) { bookId: number, ) => { event.stopPropagation(); - if (favorite) { + if (isFavorite) { FavoriteDeleteMutation.mutate(bookId); - setFavorite(false); } else { FavoritePostMutation.mutate(bookId); - setFavorite(true); } }; @@ -64,7 +61,7 @@ function MyLecueBook(props: LecueBookProps) { useEffect(() => { convertNoteCount(noteNum); - }, [favorite]); + }, []); return ( @@ -81,7 +78,7 @@ function MyLecueBook(props: LecueBookProps) { handleClickFavoriteBtn(event, bookId); }} > - {favorite ? : } + {isFavorite ? : } {title} diff --git a/src/components/common/LecueBook/index.tsx b/src/components/common/LecueBook/index.tsx index ef8d98dd..4fdd7990 100644 --- a/src/components/common/LecueBook/index.tsx +++ b/src/components/common/LecueBook/index.tsx @@ -28,7 +28,7 @@ function LecueBook(props: LecueBookProps) { const navigate = useNavigate(); - const MypageDeleteMutation = useDeleteFavorite('mypage'); + const MypageDeleteMutation = useDeleteFavorite('favoriteBook'); const HomeDeleteMutation = useDeleteFavorite('home'); const handleClickFavoriteBtn = ( diff --git a/src/libs/hooks/useDeleteFavorite.ts b/src/libs/hooks/useDeleteFavorite.ts index 086ad981..b68d4858 100644 --- a/src/libs/hooks/useDeleteFavorite.ts +++ b/src/libs/hooks/useDeleteFavorite.ts @@ -12,13 +12,25 @@ const useDeleteFavorite = (state: string) => { }, onError: () => navigate('/error'), onSuccess: () => { - state === 'home' - ? queryClient.refetchQueries(['get-favorite'], { + switch (state) { + case 'home': + queryClient.refetchQueries(['get-favorite'], { exact: true, - }) - : queryClient.refetchQueries(['get-mypage-favorite'], { + }); + break; + + case 'favoriteBook': + queryClient.refetchQueries(['get-mypage-favorite'], { + exact: true, + }); + break; + + case 'myLecueBook': + queryClient.refetchQueries(['get-my-lecueBook'], { exact: true, }); + break; + } }, }); return mutation; diff --git a/src/libs/hooks/usePostFavorite.ts b/src/libs/hooks/usePostFavorite.ts index b0f1854e..168e5f44 100644 --- a/src/libs/hooks/usePostFavorite.ts +++ b/src/libs/hooks/usePostFavorite.ts @@ -1,15 +1,21 @@ -import { useMutation } from 'react-query'; +import { useMutation, useQueryClient } from 'react-query'; import { useNavigate } from 'react-router-dom'; import postFavorite from '../api/postFavorite'; const usePostFavorite = () => { const navigate = useNavigate(); + const queryClient = useQueryClient(); const mutation = useMutation({ mutationFn: (bookId: number) => { return postFavorite(bookId); }, onError: () => navigate('/error'), + onSuccess: () => { + queryClient.refetchQueries(['get-my-lecueBook'], { + exact: true, + }); + }, }); return mutation; }; From 4805ea542bd54e8c8dac61559a3a12edaefd0c57 Mon Sep 17 00:00:00 2001 From: seoAreum <1971236@hansung.ac.kr> Date: Fri, 26 Apr 2024 21:16:02 +0900 Subject: [PATCH 10/20] =?UTF-8?q?fix:=20=EC=9C=88=EB=8F=84=EC=9A=B0=20?= =?UTF-8?q?=EC=83=81=EC=97=90=EC=84=9C=20=EB=85=B8=ED=8A=B8=20=EC=9C=84?= =?UTF-8?q?=EC=97=90=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EC=83=9D=EA=B8=B0?= =?UTF-8?q?=EB=8A=94=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Detail/components/BigLecueNote/BigLecueNote.style.ts | 2 +- src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Detail/components/BigLecueNote/BigLecueNote.style.ts b/src/Detail/components/BigLecueNote/BigLecueNote.style.ts index c9892b7a..f237aeee 100644 --- a/src/Detail/components/BigLecueNote/BigLecueNote.style.ts +++ b/src/Detail/components/BigLecueNote/BigLecueNote.style.ts @@ -30,7 +30,7 @@ export const BigLecueNoteContentWrapper = styled.div` display: flex; justify-content: center; align-items: center; - overflow: scroll; + overflow: hidden auto; width: 100%; height: 22.4rem; diff --git a/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts b/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts index 230beb81..aa3cdd40 100644 --- a/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts +++ b/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts @@ -55,7 +55,7 @@ export const LecueNoteModalContentWrapper = styled.div` display: flex; justify-content: center; align-items: center; - overflow: scroll; + overflow: hidden auto; width: 100%; height: 23.4rem; From 7ffa94a9125994fc140ea9050d512fb4a669219f Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Fri, 26 Apr 2024 22:19:13 +0900 Subject: [PATCH 11/20] =?UTF-8?q?fix:=20=EC=82=AC=EC=9A=A9=EC=9E=90?= =?UTF-8?q?=EA=B0=80=20=EC=A7=80=EC=A0=95=ED=95=9C=20=EB=B0=B0=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=A0=95=EC=83=81?= =?UTF-8?q?=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EB=B0=98=EC=98=81=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MyLetter/MyLetter.style.ts | 17 +++++++++++++++-- src/History/components/MyLetter/index.tsx | 8 +++++++- src/History/types/historyType.ts | 2 ++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/History/components/MyLetter/MyLetter.style.ts b/src/History/components/MyLetter/MyLetter.style.ts index 0a6c7d99..9bd9d1f2 100644 --- a/src/History/components/MyLetter/MyLetter.style.ts +++ b/src/History/components/MyLetter/MyLetter.style.ts @@ -1,12 +1,25 @@ import styled from '@emotion/styled'; -export const MyLetterWrapper = styled.article` +export const MyLetterWrapper = styled.article<{ + noteTextColor: string; + noteBackground: string; +}>` width: 100%; height: 16.3rem; padding: 1.3rem 1.2rem; border-radius: 0.4rem; - background-color: ${({ theme }) => theme.colors.sub_purple}; + ${({ noteBackground }) => { + if (noteBackground.substring(0, 1) === '#') { + return `background-color: ${noteBackground}`; + } else { + return `background: url(${noteBackground})`; + } + }}; + background-size: 100% 16.3rem; + color: ${({ noteTextColor }) => { + return noteTextColor; + }}; `; export const MyLetterFavorite = styled.h1` diff --git a/src/History/components/MyLetter/index.tsx b/src/History/components/MyLetter/index.tsx index 4d1a71c5..03489db4 100644 --- a/src/History/components/MyLetter/index.tsx +++ b/src/History/components/MyLetter/index.tsx @@ -9,6 +9,8 @@ function MyLetter({ title, content, noteDate, + noteTextColor, + noteBackground, }: MyLetterProps) { const navigate = useNavigate(); @@ -17,7 +19,11 @@ function MyLetter({ }; return ( - + {favoriteName} {title} {content} diff --git a/src/History/types/historyType.ts b/src/History/types/historyType.ts index ab67188d..f62bfbd4 100644 --- a/src/History/types/historyType.ts +++ b/src/History/types/historyType.ts @@ -30,6 +30,8 @@ export interface MyLetterProps { title: string; content: string; noteDate: string; + noteTextColor: string; + noteBackground: string; } export interface HistoryEmptyViewProps { From c931875ec7d0e891d9140a8d0f4e71c163791593 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 26 Apr 2024 23:54:29 +0900 Subject: [PATCH 12/20] =?UTF-8?q?fix:=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/MyLecueBook/index.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/History/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx index 549044ec..bf6ee940 100644 --- a/src/History/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -24,9 +24,9 @@ function MyLecueBook(props: LecueBookProps) { const navigate = useNavigate(); - const deleteMutation = useDeleteMyBook(); - const FavoritePostMutation = usePostFavorite(); - const FavoriteDeleteMutation = useDeleteFavorite('myLecueBook'); + const deleteBookMutation = useDeleteMyBook(); + const postFavoriteMutation = usePostFavorite(); + const deleteFavoriteMutation = useDeleteFavorite('myLecueBook'); const convertNoteCount = (noteNum: number) => { setNoteCount(noteNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); @@ -48,15 +48,13 @@ function MyLecueBook(props: LecueBookProps) { bookId: number, ) => { event.stopPropagation(); - if (isFavorite) { - FavoriteDeleteMutation.mutate(bookId); - } else { - FavoritePostMutation.mutate(bookId); - } + isFavorite + ? deleteFavoriteMutation.mutate(bookId) + : postFavoriteMutation.mutate(bookId); }; - const handleFn = () => { - deleteMutation.mutate(bookId); + const handleDeleteBookFn = () => { + deleteBookMutation.mutate(bookId); }; useEffect(() => { @@ -98,7 +96,7 @@ function MyLecueBook(props: LecueBookProps) { )} From 40006224d79def1442fadeb1325af8f1cfb64915 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 26 Apr 2024 23:56:15 +0900 Subject: [PATCH 13/20] =?UTF-8?q?fix:=20=EB=85=B8=ED=8A=B8=20=ED=91=9C?= =?UTF-8?q?=ED=98=84=20=EC=A0=95=EA=B7=9C=EC=8B=9D=20>=20toLocaleString=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/MyLecueBook/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/History/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx index bf6ee940..926b7480 100644 --- a/src/History/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -29,7 +29,7 @@ function MyLecueBook(props: LecueBookProps) { const deleteFavoriteMutation = useDeleteFavorite('myLecueBook'); const convertNoteCount = (noteNum: number) => { - setNoteCount(noteNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); + setNoteCount(noteNum.toLocaleString()); }; const handleClickBook = (bookUuid: string) => { From 61e87979d70b8298ae3cd4c4764ddc0a07e1b142 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sat, 27 Apr 2024 00:08:58 +0900 Subject: [PATCH 14/20] =?UTF-8?q?fix:=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/LecueBook/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/common/LecueBook/index.tsx b/src/components/common/LecueBook/index.tsx index 4fdd7990..235e7f67 100644 --- a/src/components/common/LecueBook/index.tsx +++ b/src/components/common/LecueBook/index.tsx @@ -28,16 +28,16 @@ function LecueBook(props: LecueBookProps) { const navigate = useNavigate(); - const MypageDeleteMutation = useDeleteFavorite('favoriteBook'); - const HomeDeleteMutation = useDeleteFavorite('home'); + const deleteMypageMutation = useDeleteFavorite('favoriteBook'); + const deleteHomeMutation = useDeleteFavorite('home'); const handleClickFavoriteBtn = ( bookId: number, deleteType: deleteType | undefined, ) => { deleteType === 'home' - ? HomeDeleteMutation.mutate(bookId) - : MypageDeleteMutation.mutate(bookId); + ? deleteHomeMutation.mutate(bookId) + : deleteMypageMutation.mutate(bookId); }; const handleClickBook = (bookUuid: string) => { From 6a2ac6c095c583b5ed5bc144edeea491bb290c10 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sat, 27 Apr 2024 00:21:37 +0900 Subject: [PATCH 15/20] =?UTF-8?q?fix:=20mutation=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EB=A6=AC=ED=84=B4=20=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/MyLecueBook/index.tsx | 6 ++---- src/History/hooks/useDeleteMyBook.ts | 2 +- src/components/common/LecueBook/index.tsx | 4 ++-- src/libs/hooks/useDeleteFavorite.ts | 3 ++- src/libs/hooks/usePostFavorite.ts | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/History/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx index 926b7480..116a45fc 100644 --- a/src/History/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -48,13 +48,11 @@ function MyLecueBook(props: LecueBookProps) { bookId: number, ) => { event.stopPropagation(); - isFavorite - ? deleteFavoriteMutation.mutate(bookId) - : postFavoriteMutation.mutate(bookId); + isFavorite ? deleteFavoriteMutation(bookId) : postFavoriteMutation(bookId); }; const handleDeleteBookFn = () => { - deleteBookMutation.mutate(bookId); + deleteBookMutation(bookId); }; useEffect(() => { diff --git a/src/History/hooks/useDeleteMyBook.ts b/src/History/hooks/useDeleteMyBook.ts index 5557f129..413bbeae 100644 --- a/src/History/hooks/useDeleteMyBook.ts +++ b/src/History/hooks/useDeleteMyBook.ts @@ -17,7 +17,7 @@ const useDeleteMyBook = () => { }); }, }); - return mutation; + return mutation.mutate; }; export default useDeleteMyBook; diff --git a/src/components/common/LecueBook/index.tsx b/src/components/common/LecueBook/index.tsx index 235e7f67..cf70620e 100644 --- a/src/components/common/LecueBook/index.tsx +++ b/src/components/common/LecueBook/index.tsx @@ -36,8 +36,8 @@ function LecueBook(props: LecueBookProps) { deleteType: deleteType | undefined, ) => { deleteType === 'home' - ? deleteHomeMutation.mutate(bookId) - : deleteMypageMutation.mutate(bookId); + ? deleteHomeMutation(bookId) + : deleteMypageMutation(bookId); }; const handleClickBook = (bookUuid: string) => { diff --git a/src/libs/hooks/useDeleteFavorite.ts b/src/libs/hooks/useDeleteFavorite.ts index b68d4858..4f6371bb 100644 --- a/src/libs/hooks/useDeleteFavorite.ts +++ b/src/libs/hooks/useDeleteFavorite.ts @@ -6,6 +6,7 @@ import deleteFavorite from '../api/deleteFavorite'; const useDeleteFavorite = (state: string) => { const navigate = useNavigate(); const queryClient = useQueryClient(); + const mutation = useMutation({ mutationFn: (bookId: number) => { return deleteFavorite(bookId); @@ -33,7 +34,7 @@ const useDeleteFavorite = (state: string) => { } }, }); - return mutation; + return mutation.mutate; }; export default useDeleteFavorite; diff --git a/src/libs/hooks/usePostFavorite.ts b/src/libs/hooks/usePostFavorite.ts index 168e5f44..935869fa 100644 --- a/src/libs/hooks/usePostFavorite.ts +++ b/src/libs/hooks/usePostFavorite.ts @@ -17,7 +17,7 @@ const usePostFavorite = () => { }); }, }); - return mutation; + return mutation.mutate; }; export default usePostFavorite; From 2e6c1c0d73545e9ac0bf5378455fce50d655da1b Mon Sep 17 00:00:00 2001 From: seoAreum <1971236@hansung.ac.kr> Date: Sat, 27 Apr 2024 12:03:35 +0900 Subject: [PATCH 16/20] =?UTF-8?q?refactor:=20y=EC=B6=95=EC=97=90=EB=A7=8C?= =?UTF-8?q?=20overflow=20=EC=86=8D=EC=84=B1=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Detail/components/BigLecueNote/BigLecueNote.style.ts | 2 +- src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Detail/components/BigLecueNote/BigLecueNote.style.ts b/src/Detail/components/BigLecueNote/BigLecueNote.style.ts index f237aeee..3d5af2b8 100644 --- a/src/Detail/components/BigLecueNote/BigLecueNote.style.ts +++ b/src/Detail/components/BigLecueNote/BigLecueNote.style.ts @@ -30,7 +30,7 @@ export const BigLecueNoteContentWrapper = styled.div` display: flex; justify-content: center; align-items: center; - overflow: hidden auto; + overflow-y: auto; width: 100%; height: 22.4rem; diff --git a/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts b/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts index aa3cdd40..51b25e2c 100644 --- a/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts +++ b/src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts @@ -55,7 +55,7 @@ export const LecueNoteModalContentWrapper = styled.div` display: flex; justify-content: center; align-items: center; - overflow: hidden auto; + overflow-y: auto; width: 100%; height: 23.4rem; From 84bd6d465bc496e216b51d966d987e92cb25f2d4 Mon Sep 17 00:00:00 2001 From: seoAreum <1971236@hansung.ac.kr> Date: Sat, 27 Apr 2024 12:06:00 +0900 Subject: [PATCH 17/20] =?UTF-8?q?style:=20=EA=B3=A0=EB=A5=BC=20=EC=88=98?= =?UTF-8?q?=20=EC=9E=88=EB=8A=94=20=EC=83=89=EC=9D=B4=20=EC=A0=81=EC=9D=84?= =?UTF-8?q?=20=EA=B2=BD=EC=9A=B0=20=EC=8A=A4=ED=81=AC=EB=A1=A4=EC=9D=B4=20?= =?UTF-8?q?=EC=83=9D=EA=B8=B0=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20ove?= =?UTF-8?q?rflow=20=EC=86=8D=EC=84=B1=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LecueNote/components/ShowColorChart/ShowColorChart.style.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LecueNote/components/ShowColorChart/ShowColorChart.style.ts b/src/LecueNote/components/ShowColorChart/ShowColorChart.style.ts index c018244b..796005f3 100644 --- a/src/LecueNote/components/ShowColorChart/ShowColorChart.style.ts +++ b/src/LecueNote/components/ShowColorChart/ShowColorChart.style.ts @@ -9,7 +9,7 @@ export const Wrapper = styled.div` padding: 0.2rem 0.1rem 1rem 0.3rem; - overflow-x: scroll; + overflow-x: auto; `; export const Input = styled.input` From a5e419dc0c710c5dde9fd93f13c4961275cd3e48 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sat, 27 Apr 2024 14:23:40 +0900 Subject: [PATCH 18/20] =?UTF-8?q?refactor:=20css=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/MyLetter/MyLetter.style.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/History/components/MyLetter/MyLetter.style.ts b/src/History/components/MyLetter/MyLetter.style.ts index 9bd9d1f2..cdcfd378 100644 --- a/src/History/components/MyLetter/MyLetter.style.ts +++ b/src/History/components/MyLetter/MyLetter.style.ts @@ -17,9 +17,7 @@ export const MyLetterWrapper = styled.article<{ } }}; background-size: 100% 16.3rem; - color: ${({ noteTextColor }) => { - return noteTextColor; - }}; + color: ${({ noteTextColor }) => noteTextColor}; `; export const MyLetterFavorite = styled.h1` From 4ca059996e1fddf89764a1468623761fcac2d52c Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sun, 28 Apr 2024 11:33:04 +0900 Subject: [PATCH 19/20] =?UTF-8?q?fix:=20handleRefetchQueries=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/hooks/useDeleteFavorite.ts | 42 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/libs/hooks/useDeleteFavorite.ts b/src/libs/hooks/useDeleteFavorite.ts index 4f6371bb..dc200741 100644 --- a/src/libs/hooks/useDeleteFavorite.ts +++ b/src/libs/hooks/useDeleteFavorite.ts @@ -7,31 +7,35 @@ const useDeleteFavorite = (state: string) => { const navigate = useNavigate(); const queryClient = useQueryClient(); + const handleRefetchQueries = (state: string) => { + switch (state) { + case 'home': + queryClient.refetchQueries(['get-favorite'], { + exact: true, + }); + break; + + case 'favoriteBook': + queryClient.refetchQueries(['get-mypage-favorite'], { + exact: true, + }); + break; + + case 'myLecueBook': + queryClient.refetchQueries(['get-my-lecueBook'], { + exact: true, + }); + break; + } + }; + const mutation = useMutation({ mutationFn: (bookId: number) => { return deleteFavorite(bookId); }, onError: () => navigate('/error'), onSuccess: () => { - switch (state) { - case 'home': - queryClient.refetchQueries(['get-favorite'], { - exact: true, - }); - break; - - case 'favoriteBook': - queryClient.refetchQueries(['get-mypage-favorite'], { - exact: true, - }); - break; - - case 'myLecueBook': - queryClient.refetchQueries(['get-my-lecueBook'], { - exact: true, - }); - break; - } + handleRefetchQueries(state); }, }); return mutation.mutate; From e2a814324f7e81eb98cfc2dc645edf8a03f1dc54 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 28 Apr 2024 23:53:58 +0900 Subject: [PATCH 20/20] =?UTF-8?q?refactor:=20css=20=EB=B6=84=EA=B8=B0?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EB=A1=9C=EC=A7=81=20=EC=82=BC=ED=95=AD?= =?UTF-8?q?=EC=97=B0=EC=82=B0=EC=9E=90=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MyLetter/MyLetter.style.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/History/components/MyLetter/MyLetter.style.ts b/src/History/components/MyLetter/MyLetter.style.ts index cdcfd378..f8b7f6c3 100644 --- a/src/History/components/MyLetter/MyLetter.style.ts +++ b/src/History/components/MyLetter/MyLetter.style.ts @@ -1,3 +1,4 @@ +import { css } from '@emotion/react'; import styled from '@emotion/styled'; export const MyLetterWrapper = styled.article<{ @@ -9,13 +10,14 @@ export const MyLetterWrapper = styled.article<{ padding: 1.3rem 1.2rem; border-radius: 0.4rem; - ${({ noteBackground }) => { - if (noteBackground.substring(0, 1) === '#') { - return `background-color: ${noteBackground}`; - } else { - return `background: url(${noteBackground})`; - } - }}; + ${({ noteBackground }) => + noteBackground.substring(0, 1) === '#' + ? css` + background-color: ${noteBackground}; + ` + : css` + background: url(${noteBackground}); + `}; background-size: 100% 16.3rem; color: ${({ noteTextColor }) => noteTextColor}; `;