From cc11c0e016b748ee912073954fea46cb14353e4d Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 12 Mar 2024 09:25:28 +0900 Subject: [PATCH 01/99] =?UTF-8?q?feat:=20Header=EB=A5=BC=20=ED=8F=AC?= =?UTF-8?q?=ED=95=A8=ED=95=9C=20Mypage=20=EA=B8=B0=EB=B3=B8=20=ED=94=84?= =?UTF-8?q?=EB=A0=88=EC=9E=84=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/page/Mypage.style.ts | 10 +--------- src/Mypage/page/index.tsx | 11 ++--------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Mypage/page/Mypage.style.ts b/src/Mypage/page/Mypage.style.ts index 49423177..ebe0012d 100644 --- a/src/Mypage/page/Mypage.style.ts +++ b/src/Mypage/page/Mypage.style.ts @@ -11,14 +11,6 @@ export const Wrapper = styled.article` background-color: ${({ theme }) => theme.colors.background}; `; -export const InfoWrapper = styled.div` - width: 100%; - padding: 0 0.95rem 1rem; +export const MyPageBodyWrapper = styled.div` margin-top: 5.4rem; `; - -export const ListWrapper = styled.div` - width: 100%; - height: calc(100dvh - 14.6rem); - padding: 0 1rem 1rem; -`; diff --git a/src/Mypage/page/index.tsx b/src/Mypage/page/index.tsx index 6c9d66ef..4e039140 100644 --- a/src/Mypage/page/index.tsx +++ b/src/Mypage/page/index.tsx @@ -1,7 +1,5 @@ import Header from '../../components/common/Header'; import LoadingPage from '../../components/common/LoadingPage'; -import LecueList from '../components/LecueList'; -import Nickname from '../components/Nickname'; import useDeleteMyBook from '../hooks/useDeleteMyBook'; import useGetMyBookList from '../hooks/useGetMyBookList'; import useGetMyNickName from '../hooks/useGetMyNickname'; @@ -17,13 +15,8 @@ function Mypage() { ) : ( -
- - - - - - +
+ ); } From 5a3f9a14cb60e5d1c36183d9479607f5de31352e Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Wed, 13 Mar 2024 00:41:36 +0900 Subject: [PATCH 02/99] =?UTF-8?q?style:=20PageBodyWrapper=20=EC=A2=8C?= =?UTF-8?q?=EC=9A=B0=20padding=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/page/Mypage.style.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mypage/page/Mypage.style.ts b/src/Mypage/page/Mypage.style.ts index ebe0012d..744074ec 100644 --- a/src/Mypage/page/Mypage.style.ts +++ b/src/Mypage/page/Mypage.style.ts @@ -12,5 +12,6 @@ export const Wrapper = styled.article` `; export const MyPageBodyWrapper = styled.div` + padding: 0 1.6rem; margin-top: 5.4rem; `; From 6f674e2e37f0b9ed58b2914df8b84538ebc4c050 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Wed, 13 Mar 2024 00:44:47 +0900 Subject: [PATCH 03/99] =?UTF-8?q?style:=20PageBodyWrapper=20width=20100%?= =?UTF-8?q?=20=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/page/Mypage.style.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mypage/page/Mypage.style.ts b/src/Mypage/page/Mypage.style.ts index 744074ec..8c7b52c7 100644 --- a/src/Mypage/page/Mypage.style.ts +++ b/src/Mypage/page/Mypage.style.ts @@ -12,6 +12,7 @@ export const Wrapper = styled.article` `; export const MyPageBodyWrapper = styled.div` + width: 100%; padding: 0 1.6rem; margin-top: 5.4rem; `; From 82405f132e843256a322c53625c00ef40dea2d4f Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 13 Mar 2024 01:26:46 +0900 Subject: [PATCH 04/99] =?UTF-8?q?chore:=20svg=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icon/ic_arrow_left.svg | 3 +++ src/assets/icon/ic_home_favorite_empty.svg | 11 ++++++++++ src/assets/icon/ic_home_favorite_filled.svg | 23 +++++++++++++++++++++ src/assets/icon/ic_star.svg | 3 +++ src/assets/icon/ic_star_default.svg | 3 +++ src/assets/index.ts | 10 +++++++++ 6 files changed, 53 insertions(+) create mode 100644 src/assets/icon/ic_arrow_left.svg create mode 100644 src/assets/icon/ic_home_favorite_empty.svg create mode 100644 src/assets/icon/ic_home_favorite_filled.svg create mode 100644 src/assets/icon/ic_star.svg create mode 100644 src/assets/icon/ic_star_default.svg diff --git a/src/assets/icon/ic_arrow_left.svg b/src/assets/icon/ic_arrow_left.svg new file mode 100644 index 00000000..3bdf199c --- /dev/null +++ b/src/assets/icon/ic_arrow_left.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icon/ic_home_favorite_empty.svg b/src/assets/icon/ic_home_favorite_empty.svg new file mode 100644 index 00000000..c0da1244 --- /dev/null +++ b/src/assets/icon/ic_home_favorite_empty.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/icon/ic_home_favorite_filled.svg b/src/assets/icon/ic_home_favorite_filled.svg new file mode 100644 index 00000000..04976ee7 --- /dev/null +++ b/src/assets/icon/ic_home_favorite_filled.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icon/ic_star.svg b/src/assets/icon/ic_star.svg new file mode 100644 index 00000000..4dd61c3c --- /dev/null +++ b/src/assets/icon/ic_star.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icon/ic_star_default.svg b/src/assets/icon/ic_star_default.svg new file mode 100644 index 00000000..6612c715 --- /dev/null +++ b/src/assets/icon/ic_star_default.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/index.ts b/src/assets/index.ts index 48d600dd..8f88309e 100644 --- a/src/assets/index.ts +++ b/src/assets/index.ts @@ -6,6 +6,7 @@ import BtnFloatingStickerOrange from './button/btn_floating_sticker_orange.svg?r import BtnFloatingWrite from './button/btn_floating_write.svg?react'; import BtnFloatingWriteOrange from './button/btn_floating_write_orange.svg?react'; import BtnKakaologin from './button/btn_kakaologin.svg?react'; +import IcArrowLeft from './icon/ic_arrow_left.svg?react'; import IcArrowLeftBlack from './icon/ic_arrow_left_black.svg?react'; import IcArrowLeftWhite from './icon/ic_arrow_left_white.svg?react'; import IcCamera from './icon/ic_camera.svg?react'; @@ -15,8 +16,12 @@ import IcCheck from './icon/ic_check.svg?react'; import IcCrown from './icon/ic_crown.svg?react'; import IcDate from './icon/ic_date.svg?react'; import IcHome from './icon/ic_home.svg?react'; +import IcHomeFavoriteEmpty from './icon/ic_home_favorite_empty.svg?react'; +import IcHomeFavoriteFilled from './icon/ic_home_favorite_filled.svg?react'; import IcNotice from './icon/ic_notice.svg?react'; import IcSharing from './icon/ic_sharing.svg?react'; +import IcStar from './icon/ic_star.svg?react'; +import IcStarDefault from './icon/ic_star_default.svg?react'; import IcWaste from './icon/ic_waste.svg?react'; import IcX from './icon/ic_x.svg?react'; import ImgBook from './img/img_book.svg?react'; @@ -56,6 +61,7 @@ export { BtnFloatingWrite, BtnFloatingWriteOrange, BtnKakaologin, + IcArrowLeft, IcArrowLeftBlack, IcArrowLeftWhite, IcCamera, @@ -65,8 +71,12 @@ export { IcCrown, IcDate, IcHome, + IcHomeFavoriteEmpty, + IcHomeFavoriteFilled, IcNotice, IcSharing, + IcStar, + IcStarDefault, IcWaste, IcX, ImgBook, From b438f75cc55b28269b9a27f22dcec2cdd3b2931c Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 13 Mar 2024 21:54:17 +0900 Subject: [PATCH 05/99] =?UTF-8?q?feat:=20=EC=A7=84=EC=9E=85=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=ED=8D=BC=EB=B8=94=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EnterView/EnterView.style.ts | 50 +++++++++++++++++++ src/Mypage/components/EnterView/index.tsx | 48 ++++++++++++++++++ src/Mypage/page/index.tsx | 5 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 src/Mypage/components/EnterView/EnterView.style.ts create mode 100644 src/Mypage/components/EnterView/index.tsx diff --git a/src/Mypage/components/EnterView/EnterView.style.ts b/src/Mypage/components/EnterView/EnterView.style.ts new file mode 100644 index 00000000..6639d23f --- /dev/null +++ b/src/Mypage/components/EnterView/EnterView.style.ts @@ -0,0 +1,50 @@ +import styled from '@emotion/styled'; + +export const Wrapper = styled.section` + display: flex; + flex-direction: column; + + padding: 0 1.6rem; +`; + +export const ProfileWrapper = styled(Wrapper)` + padding-top: 3rem; + padding-bottom: 1rem; + + border-bottom: 0.1rem solid ${({ theme }) => theme.colors.LG}; +`; + +export const ServiceWrapper = styled(Wrapper)` + padding-top: 2rem; + padding-bottom: 1rem; + + border-bottom: 0.1rem solid ${({ theme }) => theme.colors.LG}; +`; + +export const OtherWrapper = styled(Wrapper)` + padding-top: 2rem; +`; + +export const Tab = styled.li` + display: flex; + justify-content: space-between; + align-items: center; + + width: 100%; + height: 3.2rem; + margin: 0.525rem 0; + + cursor: pointer; +`; + +export const SubTitle = styled.span` + padding-bottom: 1em; + + ${({ theme }) => theme.fonts.Caption2_SB_12}; + color: ${({ theme }) => theme.colors.WG}; +`; + +export const Text = styled.span` + ${({ theme }) => theme.fonts.Title2_M_16}; + color: ${({ theme }) => theme.colors.BG}; +`; diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx new file mode 100644 index 00000000..4a46633a --- /dev/null +++ b/src/Mypage/components/EnterView/index.tsx @@ -0,0 +1,48 @@ +import { IcArrowLeft } from '../../../assets'; +import * as S from './EnterView.style'; +function EnterView() { + return ( +
+ + 프로필 + + 닉네임 수정 + + + + 내 기록보기 + + + + + 서비스 이용 방침 + + 팀 설명 보기 + + + + 공지사항 + + + + 문의하기 + + + + + 기타 + + 로그아웃 + + + + + 탈퇴하기 + + + +
+ ); +} + +export default EnterView; diff --git a/src/Mypage/page/index.tsx b/src/Mypage/page/index.tsx index 4e039140..0cf9bd78 100644 --- a/src/Mypage/page/index.tsx +++ b/src/Mypage/page/index.tsx @@ -1,5 +1,6 @@ import Header from '../../components/common/Header'; import LoadingPage from '../../components/common/LoadingPage'; +import EnterView from '../components/EnterView'; import useDeleteMyBook from '../hooks/useDeleteMyBook'; import useGetMyBookList from '../hooks/useGetMyBookList'; import useGetMyNickName from '../hooks/useGetMyNickname'; @@ -16,7 +17,9 @@ function Mypage() { ) : (
- + + + ); } From 64a72ebaacc1f86d7a510f7a8a5b731936a6c08b Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 14 Mar 2024 15:24:40 +0900 Subject: [PATCH 06/99] =?UTF-8?q?feat:=20=EC=99=B8=EB=B6=80=20=EB=A7=81?= =?UTF-8?q?=ED=81=AC=EB=A1=9C=20=EC=9D=B4=EB=8F=99=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EB=A9=94=EB=89=B4=20=ED=83=9C=EA=B7=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EnterView/EnterView.style.ts | 5 +++ src/Mypage/components/EnterView/index.tsx | 45 ++++++++++++++++--- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/Mypage/components/EnterView/EnterView.style.ts b/src/Mypage/components/EnterView/EnterView.style.ts index 6639d23f..279ad8fb 100644 --- a/src/Mypage/components/EnterView/EnterView.style.ts +++ b/src/Mypage/components/EnterView/EnterView.style.ts @@ -48,3 +48,8 @@ export const Text = styled.span` ${({ theme }) => theme.fonts.Title2_M_16}; color: ${({ theme }) => theme.colors.BG}; `; + +export const Link = styled.a` + ${({ theme }) => theme.fonts.Title2_M_16}; + color: ${({ theme }) => theme.colors.BG}; +`; diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx index 4a46633a..425ddf35 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/EnterView/index.tsx @@ -1,15 +1,36 @@ +import { useNavigate } from 'react-router-dom'; + import { IcArrowLeft } from '../../../assets'; import * as S from './EnterView.style'; function EnterView() { + const navigate = useNavigate(); + + const handleClickNickname = () => { + navigate('/nickname'); + }; + + const handleClickHistory = () => { + navigate('/history'); + }; + + const handleClickLogout = () => { + //모달 띄우기(2차 스프린트) + alert('로그아웃'); + }; + + const handleClickUnsubscribe = () => { + alert('탈퇴하기'); + }; + return (
프로필 - + 닉네임 수정 - + 내 기록보기 @@ -17,26 +38,36 @@ function EnterView() { 서비스 이용 방침 - 팀 설명 보기 + + 팀 설명 보기 + - 공지사항 + + 공지사항 + - 문의하기 + + 문의하기 + 기타 - 로그아웃 + 로그아웃 - + 탈퇴하기 From a8d87208616a96fba7c0b7a9db4fa446b9e20195 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 14 Mar 2024 16:23:37 +0900 Subject: [PATCH 07/99] =?UTF-8?q?feat:=20=EC=A4=91=EC=B2=A9=20=EB=9D=BC?= =?UTF-8?q?=EC=9A=B0=ED=84=B0=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/components/EnterView/index.tsx | 17 ++++------------- src/Mypage/page/index.tsx | 5 +++-- src/Router.tsx | 7 ++++++- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx index 425ddf35..b45bdfc2 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/EnterView/index.tsx @@ -6,20 +6,11 @@ function EnterView() { const navigate = useNavigate(); const handleClickNickname = () => { - navigate('/nickname'); + navigate('nickname'); }; const handleClickHistory = () => { - navigate('/history'); - }; - - const handleClickLogout = () => { - //모달 띄우기(2차 스프린트) - alert('로그아웃'); - }; - - const handleClickUnsubscribe = () => { - alert('탈퇴하기'); + navigate('history'); }; return ( @@ -63,11 +54,11 @@ function EnterView() { 기타 - 로그아웃 + 로그아웃 - + 탈퇴하기 diff --git a/src/Mypage/page/index.tsx b/src/Mypage/page/index.tsx index 0cf9bd78..541920fc 100644 --- a/src/Mypage/page/index.tsx +++ b/src/Mypage/page/index.tsx @@ -1,6 +1,7 @@ +import { Outlet } from 'react-router-dom'; + import Header from '../../components/common/Header'; import LoadingPage from '../../components/common/LoadingPage'; -import EnterView from '../components/EnterView'; import useDeleteMyBook from '../hooks/useDeleteMyBook'; import useGetMyBookList from '../hooks/useGetMyBookList'; import useGetMyNickName from '../hooks/useGetMyNickname'; @@ -18,7 +19,7 @@ function Mypage() {
- + ); diff --git a/src/Router.tsx b/src/Router.tsx index b23ae087..3f50dc2e 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -14,6 +14,7 @@ import HealthTest from './HealthTest'; import LecueNotePage from './LecueNote/page/LeceuNotePage'; import LoginCallback from './Login/components/LoginCallback/LoginCallback'; import Login from './Login/page'; +import EnterView from './Mypage/components/EnterView'; import Mypage from './Mypage/page'; import Register from './Register/page'; import SelectBookPage from './SelectBook/page/SelectBookPage'; @@ -35,7 +36,11 @@ function Router() { } /> } /> } /> - } /> + }> + } /> + {/* } /> */} + {/* } /> */} + } /> } /> } /> From 88f12ef47e8668be88a97fbee3c1524516cd848f Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 14 Mar 2024 16:43:26 +0900 Subject: [PATCH 08/99] =?UTF-8?q?feat:=20=EC=99=B8=EB=B6=80=20=EB=A7=81?= =?UTF-8?q?=ED=81=AC=20=EC=9D=B4=EB=8F=99=20=ED=83=9C=EA=B7=B8=20=EB=B2=94?= =?UTF-8?q?=EC=9C=84=20=EB=B3=80=EA=B2=BD(text=20->=20=EC=A0=84=EC=B2=B4?= =?UTF-8?q?=20=EB=B8=94=EB=A1=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EnterView/EnterView.style.ts | 17 +++++++--- src/Mypage/components/EnterView/index.tsx | 32 ++++++++----------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/Mypage/components/EnterView/EnterView.style.ts b/src/Mypage/components/EnterView/EnterView.style.ts index 279ad8fb..5d1d0d06 100644 --- a/src/Mypage/components/EnterView/EnterView.style.ts +++ b/src/Mypage/components/EnterView/EnterView.style.ts @@ -37,6 +37,18 @@ export const Tab = styled.li` cursor: pointer; `; +export const Link = styled.a` + display: flex; + justify-content: space-between; + align-items: center; + + width: 100%; + height: 3.2rem; + margin: 0.525rem 0; + + cursor: pointer; +`; + export const SubTitle = styled.span` padding-bottom: 1em; @@ -48,8 +60,3 @@ export const Text = styled.span` ${({ theme }) => theme.fonts.Title2_M_16}; color: ${({ theme }) => theme.colors.BG}; `; - -export const Link = styled.a` - ${({ theme }) => theme.fonts.Title2_M_16}; - color: ${({ theme }) => theme.colors.BG}; -`; diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx index b45bdfc2..440d513d 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/EnterView/index.tsx @@ -28,28 +28,22 @@ function EnterView() { 서비스 이용 방침 - - - 팀 설명 보기 - + + 팀 설명 보기 - - - - 공지사항 - + + + 공지사항 - - - - 문의하기 - + + + 문의하기 - + 기타 From e6c11114406659e3c19ea0b02817ed6f62c84aba Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 14 Mar 2024 18:01:48 +0900 Subject: [PATCH 09/99] =?UTF-8?q?feat:=20=EB=82=B4=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EC=A7=84=EC=9E=85=EB=B7=B0=20=ED=8D=BC?= =?UTF-8?q?=EB=B8=94=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HistoryEnterView.style.ts | 24 +++++++++++++++++++ .../components/HistoryEnterView/index.tsx | 13 ++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/Mypage/components/HistoryEnterView/HistoryEnterView.style.ts create mode 100644 src/Mypage/components/HistoryEnterView/index.tsx diff --git a/src/Mypage/components/HistoryEnterView/HistoryEnterView.style.ts b/src/Mypage/components/HistoryEnterView/HistoryEnterView.style.ts new file mode 100644 index 00000000..c477bb27 --- /dev/null +++ b/src/Mypage/components/HistoryEnterView/HistoryEnterView.style.ts @@ -0,0 +1,24 @@ +import styled from '@emotion/styled'; + +export const Wrapper = styled.section` + display: flex; + flex-direction: column; + padding: 2.9rem 1.6rem; + gap: 1.2rem; +`; + +export const Tab = styled.li` + display: flex; + align-items: center; + width: 100%; + height: 13rem; + + padding: 0 3rem; + border-radius: 0.2rem; + + background-color: ${({ theme }) => theme.colors.LG}; + cursor: pointer; + + ${({ theme }) => theme.fonts.Title1_SB_16} + color: ${({ theme }) => theme.colors.BG} +`; diff --git a/src/Mypage/components/HistoryEnterView/index.tsx b/src/Mypage/components/HistoryEnterView/index.tsx new file mode 100644 index 00000000..b8c3d9b0 --- /dev/null +++ b/src/Mypage/components/HistoryEnterView/index.tsx @@ -0,0 +1,13 @@ +import * as S from './HistoryEnterView.style'; + +function HistoryEnterView() { + return ( + + 즐겨찾기 한 레큐북 + 내가 만든 레큐북 + 내가 남긴 레큐노트 + + ); +} + +export default HistoryEnterView; From 78f390c3a0fd125d5899a757ff1f584e57f8b104 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 15 Mar 2024 00:45:37 +0900 Subject: [PATCH 10/99] =?UTF-8?q?chore:=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EA=B0=80=EC=9D=B4=EB=93=9C=20=EC=B6=94=EA=B0=80(LG=5F2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/emotion.d.ts | 1 + src/styles/theme.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/styles/emotion.d.ts b/src/styles/emotion.d.ts index c1451bf5..dbbc2908 100644 --- a/src/styles/emotion.d.ts +++ b/src/styles/emotion.d.ts @@ -5,6 +5,7 @@ type colors = | 'white' | 'background' | 'LG' + | 'LG_2' | 'WG' | 'MG' | 'DG' diff --git a/src/styles/theme.ts b/src/styles/theme.ts index 801f7a21..1cfe2542 100644 --- a/src/styles/theme.ts +++ b/src/styles/theme.ts @@ -5,6 +5,7 @@ const colors = { white: '#FFFFFF', background: '#F5F5F5', LG: '#DDDDDD', + LG_2: 'E7E7E7', WG: '#BCBCBC', MG: '#9E9E9E', DG: '#494949', From 81b2391517bb3f339059234103b215b5f5be42cc Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 15 Mar 2024 01:22:03 +0900 Subject: [PATCH 11/99] =?UTF-8?q?chore:=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/theme.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/theme.ts b/src/styles/theme.ts index 1cfe2542..d2455f27 100644 --- a/src/styles/theme.ts +++ b/src/styles/theme.ts @@ -5,7 +5,7 @@ const colors = { white: '#FFFFFF', background: '#F5F5F5', LG: '#DDDDDD', - LG_2: 'E7E7E7', + LG_2: '#E7E7E7', WG: '#BCBCBC', MG: '#9E9E9E', DG: '#494949', From da35d11f738f1571577aad6cfbad334f3abbf939 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 15 Mar 2024 02:43:16 +0900 Subject: [PATCH 12/99] =?UTF-8?q?feat:=20=EB=B7=B0=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EnterView/EnterView.style.ts | 49 +++++++------ src/Mypage/components/EnterView/index.tsx | 73 ++++++++++++------- 2 files changed, 76 insertions(+), 46 deletions(-) diff --git a/src/Mypage/components/EnterView/EnterView.style.ts b/src/Mypage/components/EnterView/EnterView.style.ts index 5d1d0d06..742f2dfc 100644 --- a/src/Mypage/components/EnterView/EnterView.style.ts +++ b/src/Mypage/components/EnterView/EnterView.style.ts @@ -1,28 +1,35 @@ import styled from '@emotion/styled'; -export const Wrapper = styled.section` +export const NicknameWrapper = styled.div<{ variant?: string }>` display: flex; - flex-direction: column; + justify-content: space-between; + align-items: center; - padding: 0 1.6rem; -`; + height: 8.9rem; + padding: 3.2rem 1.6rem 2.9rem 1.6rem; -export const ProfileWrapper = styled(Wrapper)` - padding-top: 3rem; - padding-bottom: 1rem; + border-bottom: 0.6rem solid ${({ theme }) => theme.colors.LG_2}; - border-bottom: 0.1rem solid ${({ theme }) => theme.colors.LG}; + cursor: ${({ variant }) => variant === 'login' && 'pointer'}; `; -export const ServiceWrapper = styled(Wrapper)` - padding-top: 2rem; - padding-bottom: 1rem; +export const NicknameText = styled.span` + color: ${({ theme }) => theme.colors.BG}; + ${({ theme }) => theme.fonts.Head1_B_20}; +`; - border-bottom: 0.1rem solid ${({ theme }) => theme.colors.LG}; +export const MenuWrapper = styled.div` + display: flex; + flex-direction: column; + + padding: 2rem 1.6rem 1rem 1.6rem; `; -export const OtherWrapper = styled(Wrapper)` - padding-top: 2rem; +export const Line = styled.div` + width: 100%; + height: 0.1rem; + + background-color: ${({ theme }) => theme.colors.LG}; `; export const Tab = styled.li` @@ -37,6 +44,13 @@ export const Tab = styled.li` cursor: pointer; `; +export const SubTitle = styled.span` + padding-bottom: 1em; + + color: ${({ theme }) => theme.colors.WG}; + ${({ theme }) => theme.fonts.Caption2_SB_12}; +`; + export const Link = styled.a` display: flex; justify-content: space-between; @@ -49,13 +63,6 @@ export const Link = styled.a` cursor: pointer; `; -export const SubTitle = styled.span` - padding-bottom: 1em; - - ${({ theme }) => theme.fonts.Caption2_SB_12}; - color: ${({ theme }) => theme.colors.WG}; -`; - export const Text = styled.span` ${({ theme }) => theme.fonts.Title2_M_16}; color: ${({ theme }) => theme.colors.BG}; diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx index 440d513d..0ae6453b 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/EnterView/index.tsx @@ -1,9 +1,11 @@ +import React from 'react'; import { useNavigate } from 'react-router-dom'; import { IcArrowLeft } from '../../../assets'; import * as S from './EnterView.style'; function EnterView() { const navigate = useNavigate(); + const token = window.localStorage.getItem('token'); const handleClickNickname = () => { navigate('nickname'); @@ -14,19 +16,38 @@ function EnterView() { }; return ( -
- - 프로필 - - 닉네임 수정 + + {token ? ( + <> + + 님, 안녕하세요 + + + ) : ( + + 로그인하세요 - - - 내 기록보기 - - - - + + )} + + {token && ( + <> + + 프로필 + + 닉네임 수정 + + + + 내 기록보기 + + + + + + )} + + 서비스 이용 방침 팀 설명 보기 @@ -44,20 +65,22 @@ function EnterView() { 문의하기 - - - 기타 - - 로그아웃 + - - - - 탈퇴하기 - - - -
+ {token && ( + <> + + + 기타 + + 로그아웃 + + + + + + )} + ); } From f6e7ae1970137815d4cae26c16ec7f276139139b Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 15 Mar 2024 02:43:58 +0900 Subject: [PATCH 13/99] =?UTF-8?q?feat:=20api=20=EC=97=B0=EA=B2=B0=20&=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=8C=85=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/components/EnterView/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx index 0ae6453b..a005f50e 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/EnterView/index.tsx @@ -2,9 +2,11 @@ import React from 'react'; import { useNavigate } from 'react-router-dom'; import { IcArrowLeft } from '../../../assets'; +import useGetMyNickName from '../../hooks/useGetMyNickname'; import * as S from './EnterView.style'; function EnterView() { const navigate = useNavigate(); + const { myNickName } = useGetMyNickName(); const token = window.localStorage.getItem('token'); const handleClickNickname = () => { @@ -15,16 +17,20 @@ function EnterView() { navigate('history'); }; + const handleClickLogin = () => { + navigate('/login'); + }; + return ( {token ? ( <> - 님, 안녕하세요 + {myNickName}님, 안녕하세요 ) : ( - + 로그인하세요 From 5c94d4132398b9d50c2b21285168db69438c11e6 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sat, 16 Mar 2024 18:41:16 +0900 Subject: [PATCH 14/99] =?UTF-8?q?feat:=20=EB=B7=B0=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EA=B5=AC=ED=98=84=20=EB=B0=8F=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8/=EB=B9=84=EB=A1=9C=EA=B7=B8=EC=9D=B8=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 --- src/Mypage/components/EnterView/index.tsx | 100 +++++++++++++--------- 1 file changed, 60 insertions(+), 40 deletions(-) diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/EnterView/index.tsx index a005f50e..1fcac7fa 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/EnterView/index.tsx @@ -1,13 +1,19 @@ -import React from 'react'; -import { useNavigate } from 'react-router-dom'; +import React, { useState } from 'react'; +import { useLocation, useNavigate } from 'react-router-dom'; import { IcArrowLeft } from '../../../assets'; import useGetMyNickName from '../../hooks/useGetMyNickname'; import * as S from './EnterView.style'; + function EnterView() { + const [nickname, setNickname] = useState(''); const navigate = useNavigate(); - const { myNickName } = useGetMyNickName(); - const token = window.localStorage.getItem('token'); + const { state } = useLocation(); + + if (state) { + const { myNickName } = useGetMyNickName(); + if (nickname === '' || nickname !== myNickName) setNickname(myNickName); + } const handleClickNickname = () => { navigate('nickname'); @@ -23,21 +29,12 @@ function EnterView() { return ( - {token ? ( - <> + {state ? ( + - {myNickName}님, 안녕하세요 + {nickname}님, 안녕하세요 - - ) : ( - - 로그인하세요 - - - )} - {token && ( - <> 프로필 @@ -50,31 +47,27 @@ function EnterView() { - - )} - - 서비스 이용 방침 - - 팀 설명 보기 - - - - 공지사항 - - - - 문의하기 - - - + + 서비스 이용 방침 + + 팀 설명 보기 + + + + 공지사항 + + + + 문의하기 + + + - {token && ( - <> 기타 @@ -84,7 +77,34 @@ function EnterView() { - + + ) : ( + + + 로그인하세요 + + + + + 서비스 이용 방침 + + 팀 설명 보기 + + + + 공지사항 + + + + 문의하기 + + + + )} ); From 532e2c2e9ae253019659a915db468a2e8c167517 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sat, 16 Mar 2024 19:09:24 +0900 Subject: [PATCH 15/99] =?UTF-8?q?chore:=20=ED=8F=B4=EB=8D=94=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/components/Nickname/Nickname.style.ts | 14 -------------- src/Mypage/components/Nickname/index.tsx | 15 --------------- .../{ => PageLayout}/EnterView/EnterView.style.ts | 0 .../{ => PageLayout}/EnterView/index.tsx | 4 ++-- .../components/PageLayout/PageLayout.style.tsx | 6 ++++++ src/Mypage/components/PageLayout/index.tsx | 13 +++++++++++++ src/Router.tsx | 2 +- 7 files changed, 22 insertions(+), 32 deletions(-) delete mode 100644 src/Mypage/components/Nickname/Nickname.style.ts delete mode 100644 src/Mypage/components/Nickname/index.tsx rename src/Mypage/components/{ => PageLayout}/EnterView/EnterView.style.ts (100%) rename src/Mypage/components/{ => PageLayout}/EnterView/index.tsx (96%) create mode 100644 src/Mypage/components/PageLayout/PageLayout.style.tsx create mode 100644 src/Mypage/components/PageLayout/index.tsx diff --git a/src/Mypage/components/Nickname/Nickname.style.ts b/src/Mypage/components/Nickname/Nickname.style.ts deleted file mode 100644 index 7d7d7823..00000000 --- a/src/Mypage/components/Nickname/Nickname.style.ts +++ /dev/null @@ -1,14 +0,0 @@ -import styled from '@emotion/styled'; - -export const NicknameWrapper = styled.section` - display: flex; - gap: 0.5rem; - align-items: center; - - width: 100%; - padding: 2.7rem 0.6rem; -`; - -export const Nickname = styled.p` - ${({ theme }) => theme.fonts.Head1_B_20}; -`; diff --git a/src/Mypage/components/Nickname/index.tsx b/src/Mypage/components/Nickname/index.tsx deleted file mode 100644 index cd6ba1e6..00000000 --- a/src/Mypage/components/Nickname/index.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { ImgStarPosit } from '../../../assets'; -import useGetMyNickName from '../../hooks/useGetMyNickname'; -import * as S from './Nickname.style'; - -function Nickname() { - const { myNickName } = useGetMyNickName(); - return ( - - - {myNickName} 님 - - ); -} - -export default Nickname; diff --git a/src/Mypage/components/EnterView/EnterView.style.ts b/src/Mypage/components/PageLayout/EnterView/EnterView.style.ts similarity index 100% rename from src/Mypage/components/EnterView/EnterView.style.ts rename to src/Mypage/components/PageLayout/EnterView/EnterView.style.ts diff --git a/src/Mypage/components/EnterView/index.tsx b/src/Mypage/components/PageLayout/EnterView/index.tsx similarity index 96% rename from src/Mypage/components/EnterView/index.tsx rename to src/Mypage/components/PageLayout/EnterView/index.tsx index 1fcac7fa..fce5f545 100644 --- a/src/Mypage/components/EnterView/index.tsx +++ b/src/Mypage/components/PageLayout/EnterView/index.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { IcArrowLeft } from '../../../assets'; -import useGetMyNickName from '../../hooks/useGetMyNickname'; +import { IcArrowLeft } from '../../../../assets'; +import useGetMyNickName from '../../../hooks/useGetMyNickname'; import * as S from './EnterView.style'; function EnterView() { diff --git a/src/Mypage/components/PageLayout/PageLayout.style.tsx b/src/Mypage/components/PageLayout/PageLayout.style.tsx new file mode 100644 index 00000000..8535e20f --- /dev/null +++ b/src/Mypage/components/PageLayout/PageLayout.style.tsx @@ -0,0 +1,6 @@ +import styled from '@emotion/styled'; + +export const MyPageBodyWrapper = styled.div` + width: 100%; + margin-top: 5.4rem; +`; diff --git a/src/Mypage/components/PageLayout/index.tsx b/src/Mypage/components/PageLayout/index.tsx new file mode 100644 index 00000000..130ddf99 --- /dev/null +++ b/src/Mypage/components/PageLayout/index.tsx @@ -0,0 +1,13 @@ +import { Outlet } from 'react-router-dom'; + +import * as S from './PageLayout.style'; + +function PageLayout() { + return ( + + + + ); +} + +export default PageLayout; diff --git a/src/Router.tsx b/src/Router.tsx index 3f50dc2e..1f93dae6 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -14,7 +14,7 @@ import HealthTest from './HealthTest'; import LecueNotePage from './LecueNote/page/LeceuNotePage'; import LoginCallback from './Login/components/LoginCallback/LoginCallback'; import Login from './Login/page'; -import EnterView from './Mypage/components/EnterView'; +import EnterView from './Mypage/components/PageLayout/EnterView'; import Mypage from './Mypage/page'; import Register from './Register/page'; import SelectBookPage from './SelectBook/page/SelectBookPage'; From de5bb4217ef2366b8aa1ca3debe3651c70f93228 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sat, 16 Mar 2024 19:18:47 +0900 Subject: [PATCH 16/99] =?UTF-8?q?feat:=20=EB=9D=BC=EC=9A=B0=ED=84=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/components/PageLayout/EnterView/index.tsx | 4 ++-- src/Router.tsx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mypage/components/PageLayout/EnterView/index.tsx b/src/Mypage/components/PageLayout/EnterView/index.tsx index fce5f545..829bd471 100644 --- a/src/Mypage/components/PageLayout/EnterView/index.tsx +++ b/src/Mypage/components/PageLayout/EnterView/index.tsx @@ -16,11 +16,11 @@ function EnterView() { } const handleClickNickname = () => { - navigate('nickname'); + navigate('edit-nickname'); }; const handleClickHistory = () => { - navigate('history'); + navigate('select-history'); }; const handleClickLogin = () => { diff --git a/src/Router.tsx b/src/Router.tsx index 1f93dae6..189bea9b 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -38,8 +38,9 @@ function Router() { } /> }> } /> - {/* } /> */} - {/* } /> */} + {/* } /> */} + {/* } /> */} + {/* } /> */} } /> } /> From c04baf8dd1fb6a9ce5eeb5223158c26427d06b75 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sun, 17 Mar 2024 01:28:13 +0900 Subject: [PATCH 17/99] =?UTF-8?q?chore:=20asset=20=EC=9D=B4=EB=A6=84=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 --- .../components/PageLayout/EnterView/index.tsx | 22 +++++++++---------- ...arrow_left.svg => ic_arrow_right_gray.svg} | 0 src/assets/index.ts | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) rename src/assets/icon/{ic_arrow_left.svg => ic_arrow_right_gray.svg} (100%) diff --git a/src/Mypage/components/PageLayout/EnterView/index.tsx b/src/Mypage/components/PageLayout/EnterView/index.tsx index 829bd471..084017d0 100644 --- a/src/Mypage/components/PageLayout/EnterView/index.tsx +++ b/src/Mypage/components/PageLayout/EnterView/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { IcArrowLeft } from '../../../../assets'; +import { IcArrowRightGray } from '../../../../assets'; import useGetMyNickName from '../../../hooks/useGetMyNickname'; import * as S from './EnterView.style'; @@ -39,11 +39,11 @@ function EnterView() { 프로필 닉네임 수정 - + 내 기록보기 - + @@ -52,7 +52,7 @@ function EnterView() { 서비스 이용 방침 팀 설명 보기 - + 공지사항 - + 문의하기 - + @@ -74,7 +74,7 @@ function EnterView() { 로그아웃 - + @@ -82,14 +82,14 @@ function EnterView() { 로그인하세요 - + 서비스 이용 방침 팀 설명 보기 - + 공지사항 - + 문의하기 - + diff --git a/src/assets/icon/ic_arrow_left.svg b/src/assets/icon/ic_arrow_right_gray.svg similarity index 100% rename from src/assets/icon/ic_arrow_left.svg rename to src/assets/icon/ic_arrow_right_gray.svg diff --git a/src/assets/index.ts b/src/assets/index.ts index 8f88309e..031514f2 100644 --- a/src/assets/index.ts +++ b/src/assets/index.ts @@ -6,9 +6,9 @@ import BtnFloatingStickerOrange from './button/btn_floating_sticker_orange.svg?r import BtnFloatingWrite from './button/btn_floating_write.svg?react'; import BtnFloatingWriteOrange from './button/btn_floating_write_orange.svg?react'; import BtnKakaologin from './button/btn_kakaologin.svg?react'; -import IcArrowLeft from './icon/ic_arrow_left.svg?react'; import IcArrowLeftBlack from './icon/ic_arrow_left_black.svg?react'; import IcArrowLeftWhite from './icon/ic_arrow_left_white.svg?react'; +import IcArrowRightGray from './icon/ic_arrow_right_gray.svg?react'; import IcCamera from './icon/ic_camera.svg?react'; import IcCameraSmall from './icon/ic_camera_small.svg?react'; import IcCaution from './icon/ic_caution.svg?react'; @@ -61,9 +61,9 @@ export { BtnFloatingWrite, BtnFloatingWriteOrange, BtnKakaologin, - IcArrowLeft, IcArrowLeftBlack, IcArrowLeftWhite, + IcArrowRightGray, IcCamera, IcCameraSmall, IcCaution, From d9a1233ff794863afd48c574050b9a6a0d5f73f1 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sun, 17 Mar 2024 01:28:41 +0900 Subject: [PATCH 18/99] =?UTF-8?q?chore:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EB=B6=84=EB=A6=AC=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/page/Mypage.style.ts | 6 ------ src/Mypage/page/index.tsx | 20 +++----------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/Mypage/page/Mypage.style.ts b/src/Mypage/page/Mypage.style.ts index 8c7b52c7..db704f77 100644 --- a/src/Mypage/page/Mypage.style.ts +++ b/src/Mypage/page/Mypage.style.ts @@ -10,9 +10,3 @@ export const Wrapper = styled.article` background-color: ${({ theme }) => theme.colors.background}; `; - -export const MyPageBodyWrapper = styled.div` - width: 100%; - padding: 0 1.6rem; - margin-top: 5.4rem; -`; diff --git a/src/Mypage/page/index.tsx b/src/Mypage/page/index.tsx index 541920fc..52430909 100644 --- a/src/Mypage/page/index.tsx +++ b/src/Mypage/page/index.tsx @@ -1,26 +1,12 @@ -import { Outlet } from 'react-router-dom'; - import Header from '../../components/common/Header'; -import LoadingPage from '../../components/common/LoadingPage'; -import useDeleteMyBook from '../hooks/useDeleteMyBook'; -import useGetMyBookList from '../hooks/useGetMyBookList'; -import useGetMyNickName from '../hooks/useGetMyNickname'; -import useGetNoteList from '../hooks/useGetMyNoteList'; +import PageLayout from '../components/PageLayout'; import * as S from './Mypage.style'; function Mypage() { - const { isLoading } = - useGetMyBookList() || useGetMyNickName() || useGetNoteList(); - const deleteMutation = useDeleteMyBook(); - - return isLoading || deleteMutation.isLoading ? ( - - ) : ( + return (
- - - + ); } From ec2099762e38def062c7414e3c620a581991455f Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 17 Mar 2024 12:12:31 +0900 Subject: [PATCH 19/99] =?UTF-8?q?chore:=20icon=20asset=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icon/ic_arrow_down_black.svg | 5 +++++ src/assets/icon/ic_mypage_arrow_right.svg | 3 +++ src/assets/icon/ic_mypage_touchbar.svg | 3 +++ src/assets/index.ts | 6 ++++++ 4 files changed, 17 insertions(+) create mode 100644 src/assets/icon/ic_arrow_down_black.svg create mode 100644 src/assets/icon/ic_mypage_arrow_right.svg create mode 100644 src/assets/icon/ic_mypage_touchbar.svg diff --git a/src/assets/icon/ic_arrow_down_black.svg b/src/assets/icon/ic_arrow_down_black.svg new file mode 100644 index 00000000..da4bc6cb --- /dev/null +++ b/src/assets/icon/ic_arrow_down_black.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/icon/ic_mypage_arrow_right.svg b/src/assets/icon/ic_mypage_arrow_right.svg new file mode 100644 index 00000000..e8bae633 --- /dev/null +++ b/src/assets/icon/ic_mypage_arrow_right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icon/ic_mypage_touchbar.svg b/src/assets/icon/ic_mypage_touchbar.svg new file mode 100644 index 00000000..94d83e90 --- /dev/null +++ b/src/assets/icon/ic_mypage_touchbar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/index.ts b/src/assets/index.ts index 48d600dd..1ef696f8 100644 --- a/src/assets/index.ts +++ b/src/assets/index.ts @@ -6,6 +6,7 @@ import BtnFloatingStickerOrange from './button/btn_floating_sticker_orange.svg?r import BtnFloatingWrite from './button/btn_floating_write.svg?react'; import BtnFloatingWriteOrange from './button/btn_floating_write_orange.svg?react'; import BtnKakaologin from './button/btn_kakaologin.svg?react'; +import IcArrowDownBlack from './icon/ic_arrow_down_black.svg?react'; import IcArrowLeftBlack from './icon/ic_arrow_left_black.svg?react'; import IcArrowLeftWhite from './icon/ic_arrow_left_white.svg?react'; import IcCamera from './icon/ic_camera.svg?react'; @@ -15,6 +16,8 @@ import IcCheck from './icon/ic_check.svg?react'; import IcCrown from './icon/ic_crown.svg?react'; import IcDate from './icon/ic_date.svg?react'; import IcHome from './icon/ic_home.svg?react'; +import IcMypageArrowRight from './icon/ic_mypage_arrow_right.svg?react'; +import IcMypageTouchbar from './icon/ic_mypage_touchbar.svg?react'; import IcNotice from './icon/ic_notice.svg?react'; import IcSharing from './icon/ic_sharing.svg?react'; import IcWaste from './icon/ic_waste.svg?react'; @@ -56,6 +59,7 @@ export { BtnFloatingWrite, BtnFloatingWriteOrange, BtnKakaologin, + IcArrowDownBlack, IcArrowLeftBlack, IcArrowLeftWhite, IcCamera, @@ -65,6 +69,8 @@ export { IcCrown, IcDate, IcHome, + IcMypageArrowRight, + IcMypageTouchbar, IcNotice, IcSharing, IcWaste, From 4dbcc3904d571223740ccf0990465347b739cde7 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 17 Mar 2024 12:13:12 +0900 Subject: [PATCH 20/99] =?UTF-8?q?chore:=20=EB=82=B4=20=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=ED=8E=98=EC=9D=B4=EC=A7=80=20Router=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Router.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Router.tsx b/src/Router.tsx index b23ae087..7b292cde 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -11,6 +11,7 @@ import LoadingPage from './components/common/LoadingPage'; import CreateBook from './CreateBook/page'; import DetailPage from './Detail/page/DetailPage'; import HealthTest from './HealthTest'; +import History from './History/page'; import LecueNotePage from './LecueNote/page/LeceuNotePage'; import LoginCallback from './Login/components/LoginCallback/LoginCallback'; import Login from './Login/page'; @@ -50,6 +51,7 @@ function Router() { } /> } /> } /> + } /> From af1ed48d7bba09d1077a5763b500e95de14026c9 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 17 Mar 2024 12:18:33 +0900 Subject: [PATCH 21/99] =?UTF-8?q?chore:=20=ED=8F=B4=EB=8D=94=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EC=9C=A0=EC=A7=80=EC=9A=A9=20=EB=AF=B8=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20=ED=8F=B4=EB=8D=94=20gitkeep=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/api/.gitkeep | 0 src/History/hooks/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/History/api/.gitkeep create mode 100644 src/History/hooks/.gitkeep diff --git a/src/History/api/.gitkeep b/src/History/api/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/History/hooks/.gitkeep b/src/History/hooks/.gitkeep new file mode 100644 index 00000000..e69de29b From d8ac8365a981a03dbceed5d0fcd00f2289374b8d Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Sun, 17 Mar 2024 12:23:24 +0900 Subject: [PATCH 22/99] =?UTF-8?q?chore:=20HistoryEnterView=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Home/components/NavigateLecueBook/index.tsx | 12 +++++++----- .../HistoryEnterView/HistoryEnterView.style.ts | 0 .../{ => PageLayout}/HistoryEnterView/index.tsx | 0 3 files changed, 7 insertions(+), 5 deletions(-) rename src/Mypage/components/{ => PageLayout}/HistoryEnterView/HistoryEnterView.style.ts (100%) rename src/Mypage/components/{ => PageLayout}/HistoryEnterView/index.tsx (100%) diff --git a/src/Home/components/NavigateLecueBook/index.tsx b/src/Home/components/NavigateLecueBook/index.tsx index 29b9e660..dbe256d4 100644 --- a/src/Home/components/NavigateLecueBook/index.tsx +++ b/src/Home/components/NavigateLecueBook/index.tsx @@ -10,12 +10,14 @@ function NavigateLecueBook() { const navigate = useNavigate(); const [modalOn, setModalOn] = useState(false); + const handleClickIcProfile = () => { + const token = localStorage.getItem('token'); + + navigate('/mypage', { state: token }); + }; + const handleClickNavBtn = (idx: number) => { - if (localStorage.getItem('token')) { - idx === 0 ? navigate('/target') : navigate('/mypage'); - } else { - setModalOn(true); - } + idx === 0 ? navigate('/target') : handleClickIcProfile(); }; return ( diff --git a/src/Mypage/components/HistoryEnterView/HistoryEnterView.style.ts b/src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts similarity index 100% rename from src/Mypage/components/HistoryEnterView/HistoryEnterView.style.ts rename to src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts diff --git a/src/Mypage/components/HistoryEnterView/index.tsx b/src/Mypage/components/PageLayout/HistoryEnterView/index.tsx similarity index 100% rename from src/Mypage/components/HistoryEnterView/index.tsx rename to src/Mypage/components/PageLayout/HistoryEnterView/index.tsx From b1a26404557e74de11dbca637c4e6d011e7d75fe Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 17 Mar 2024 12:25:53 +0900 Subject: [PATCH 23/99] =?UTF-8?q?feat:=20=EB=82=B4=20=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EC=98=B5=EC=85=98=20Object=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/constants/optionList.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/History/constants/optionList.ts diff --git a/src/History/constants/optionList.ts b/src/History/constants/optionList.ts new file mode 100644 index 00000000..2fc23767 --- /dev/null +++ b/src/History/constants/optionList.ts @@ -0,0 +1,5 @@ +export const optionList: Record = { + 0: '내가 만든 레큐북', + 1: '즐겨찾기한 레큐북', + 2: '내가 남긴 레큐노트', +}; From 5a852cdb2c3ca05450861a46579abcb22752d867 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 17 Mar 2024 12:27:08 +0900 Subject: [PATCH 24/99] =?UTF-8?q?feat:=20=EB=82=B4=20=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EC=A0=84=ED=99=98=20=EB=AA=A8=EB=8B=AC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 110 +++++++++++------- .../SelectModal/SelectModal.style.ts | 84 +++++++++++++ src/History/components/SelectModal/index.tsx | 62 ++++++++++ .../components/SelectModalPortal/index.tsx | 12 ++ src/History/page/History.style.ts | 29 +++++ src/History/page/index.tsx | 45 +++++++ 6 files changed, 297 insertions(+), 45 deletions(-) create mode 100644 src/History/components/SelectModal/SelectModal.style.ts create mode 100644 src/History/components/SelectModal/index.tsx create mode 100644 src/History/components/SelectModalPortal/index.tsx create mode 100644 src/History/page/History.style.ts create mode 100644 src/History/page/index.tsx diff --git a/index.html b/index.html index c950b882..d296974a 100644 --- a/index.html +++ b/index.html @@ -1,53 +1,73 @@ + + + + + + + - - - - - - - + + + + - - - - + + + - - - + Lecue + - Lecue - + + + - - - + +
+
+
+ + - -
-
- - - - - - - - \ No newline at end of file + + + + diff --git a/src/History/components/SelectModal/SelectModal.style.ts b/src/History/components/SelectModal/SelectModal.style.ts new file mode 100644 index 00000000..bee05901 --- /dev/null +++ b/src/History/components/SelectModal/SelectModal.style.ts @@ -0,0 +1,84 @@ +import { keyframes } from '@emotion/react'; +import styled from '@emotion/styled'; + +const slideUp = keyframes` + from { + transform: translateY(100%); + } + to { + transform: translateY(0); + } +`; + +const slideDown = keyframes` + from { + transform: translateY(0); + } + to { + transform: translateY(100%); + } +`; + +export const SelectModalWrapper = styled.div` + display: flex; + justify-content: center; + align-items: flex-end; + position: fixed; + top: 0; + z-index: 9; + + width: 100%; + height: 100dvh; + + background: ${({ theme }) => theme.colors.Modal}; +`; + +export const SelectModalContainer = styled.div<{ + modalOn: boolean; + animationDirection: string; +}>` + position: relative; + z-index: 10; + + width: 100%; + height: 18rem; + + border-radius: 1rem 1rem 0 0; + background: ${({ theme }) => theme.colors.white}; + + animation: ${({ animationDirection }) => + animationDirection === 'slideUp' ? slideUp : slideDown} + 0.1s linear forwards; +`; + +export const OptionList = styled.li` + width: 100%; + + & > :not(:last-child) { + border-bottom: 0.1rem solid ${({ theme }) => theme.colors.background}; + } +`; + +export const OptionListItem = styled.button` + display: flex; + justify-content: space-between; + align-items: center; + + width: 100%; + padding: 1.2rem 1.6rem; +`; + +export const OptionListItemText = styled.p` + padding-top: 0.3rem; + + ${({ theme }) => theme.fonts.Title2_M_16}; +`; + +export const ClosebarContainer = styled.div` + display: flex; + justify-content: center; + + width: 100%; + height: 3rem; + padding-top: 1.2rem; +`; diff --git a/src/History/components/SelectModal/index.tsx b/src/History/components/SelectModal/index.tsx new file mode 100644 index 00000000..bb5d3c56 --- /dev/null +++ b/src/History/components/SelectModal/index.tsx @@ -0,0 +1,62 @@ +import { useState } from 'react'; + +import { IcMypageArrowRight, IcMypageTouchbar } from '../../../assets'; +import { optionList } from '../../constants/optionList'; +import SelectModalPortal from '../SelectModalPortal'; +import * as S from './SelectModal.style'; + +interface SelectModalProps { + modalOn: boolean; + closeModal: () => void; + selectOption: (option: number) => void; + selectedModalOptionList: Array; +} + +function SelectModal({ + modalOn, + closeModal, + selectOption, + selectedModalOptionList, +}: SelectModalProps) { + const [animationDirection, setAnimationDirection] = useState('slideUp'); + + const handleCloseModal = () => { + setAnimationDirection('slideDown'); + setTimeout(() => { + closeModal(); + setAnimationDirection('slideUp'); + }, 200); + }; + + return ( + + handleCloseModal()}> + e.stopPropagation()} + animationDirection={animationDirection} + modalOn={modalOn} + > + handleCloseModal()}> + + + + {selectedModalOptionList.map((item) => ( + { + selectOption(item); + handleCloseModal(); + }} + > + {optionList[item]} + + + ))} + + + + + ); +} + +export default SelectModal; diff --git a/src/History/components/SelectModalPortal/index.tsx b/src/History/components/SelectModalPortal/index.tsx new file mode 100644 index 00000000..35ab0fe1 --- /dev/null +++ b/src/History/components/SelectModalPortal/index.tsx @@ -0,0 +1,12 @@ +import ReactDOM from 'react-dom'; + +interface SelectModalPortalProps { + children: React.ReactNode; +} + +function SelectModalPortal({ children }: SelectModalPortalProps) { + const el: HTMLElement | null = document.getElementById('historyselect-modal'); + return ReactDOM.createPortal(children, el as Element | DocumentFragment); +} + +export default SelectModalPortal; diff --git a/src/History/page/History.style.ts b/src/History/page/History.style.ts new file mode 100644 index 00000000..8c7e415a --- /dev/null +++ b/src/History/page/History.style.ts @@ -0,0 +1,29 @@ +import styled from '@emotion/styled'; + +export const HistoryPageWrapper = styled.div` + display: flex; + flex-direction: column; + + width: 100vw; + height: 100dvh; + overflow-x: hidden; +`; + +export const HistoryPageBodyWrapper = styled.div` + padding: 0 1.6rem; + margin-top: 5.4rem; +`; + +export const HistorySelectButton = styled.button` + display: flex; + gap: 0.5rem; + align-items: center; + + margin: 3.4rem 0 2rem; +`; + +export const CurrentHistoryOption = styled.h2` + padding-top: 0.3rem; + + ${({ theme }) => theme.fonts.Head2_SB_18}; +`; diff --git a/src/History/page/index.tsx b/src/History/page/index.tsx new file mode 100644 index 00000000..67dbec61 --- /dev/null +++ b/src/History/page/index.tsx @@ -0,0 +1,45 @@ +import { useState } from 'react'; + +import { IcArrowDownBlack } from '../../assets'; +import Header from '../../components/common/Header'; +import SelectModal from '../components/SelectModal'; +import { optionList } from '../constants/optionList'; +import * as S from './History.style'; + +function History() { + const [modalOn, setModalOn] = useState(false); + const [selectedOption, setSelectedOption] = useState(0); + + const handleClickHistorySelectButton = () => { + setModalOn(true); + }; + + return ( + + {modalOn && ( + setModalOn(false)} + selectOption={(option: number) => setSelectedOption(option)} + selectedModalOptionList={[0, 1, 2].filter( + (num) => num !== selectedOption, + )} + /> + )} +
+ + + + {optionList[selectedOption]} + + + + + + ); +} + +export default History; From e65570897666cbd1de88a308f6e49891d7e08836 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Mon, 18 Mar 2024 17:49:31 +0900 Subject: [PATCH 25/99] =?UTF-8?q?feat:=20LecueBook=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EB=B3=80=EA=B2=BD=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/LecueBook/LecueBook.style.ts | 24 ++++++++++++------ src/Mypage/components/LecueBook/index.tsx | 25 +++++++++++++++++-- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/Mypage/components/LecueBook/LecueBook.style.ts b/src/Mypage/components/LecueBook/LecueBook.style.ts index be02ab3a..49c6eab0 100644 --- a/src/Mypage/components/LecueBook/LecueBook.style.ts +++ b/src/Mypage/components/LecueBook/LecueBook.style.ts @@ -8,15 +8,15 @@ export const Wrapper = styled.li` width: 100%; height: 11.4rem; - padding: 1.2rem 1.1rem 0.9rem 1.9rem; + padding: 1.3rem 1.8rem 1.1rem 2.5rem; border-radius: 0.4rem; - background-color: ${({ theme }) => theme.colors.background}; + background-color: ${({ theme }) => theme.colors.white}; `; export const BookWrapper = styled.div` display: flex; - justify-content: space-between; + justify-content: center; flex-direction: column; width: 100%; @@ -27,20 +27,27 @@ export const BookWrapper = styled.div` export const Header = styled.div` display: flex; - justify-content: space-between; + gap: 0.5rem; align-items: center; width: 100%; + margin-bottom: 1.2rem; `; export const Name = styled.p` ${({ theme }) => theme.fonts.Head2_SB_18}; + color: ${({ theme }) => theme.colors.BG}; +`; + +export const Favorite = styled.button` + width: 2.2rem; + height: 2.2rem; `; export const TrashBtn = styled.button` position: absolute; - top: 1rem; - right: 1rem; + top: 1.2rem; + right: 1.8rem; width: 3.2rem; height: 3.2rem; @@ -48,17 +55,20 @@ export const TrashBtn = styled.button` export const Title = styled.p` ${({ theme }) => theme.fonts.Title1_SB_16}; + color: ${({ theme }) => theme.colors.BG}; `; export const Footer = styled.div` display: flex; justify-content: space-between; - align-items: baseline; + align-items: flex-end; width: 100%; `; export const Date = styled.p` + padding-bottom: 0.4rem; + ${({ theme }) => theme.fonts.E_Caption_R_12}; color: ${({ theme }) => theme.colors.DG50}; `; diff --git a/src/Mypage/components/LecueBook/index.tsx b/src/Mypage/components/LecueBook/index.tsx index 915592be..3f68ded8 100644 --- a/src/Mypage/components/LecueBook/index.tsx +++ b/src/Mypage/components/LecueBook/index.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { IcWaste } from '../../../assets'; +import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; import CommonModal from '../../../components/common/Modal/CommonModal'; import useDeleteMyBook from '../../hooks/useDeleteMyBook'; import { LecueBookProps } from '../../types/myPageType'; @@ -9,9 +9,11 @@ import * as S from './LecueBook.style'; function LecueBook(props: LecueBookProps) { const { bookId, favoriteName, title, bookDate, noteNum, bookUuid } = props; + // const { bookId, favoriteName, title, bookDate, noteNum, bookUuid, isFavorite } = props; const [noteCount, setNoteCount] = useState(''); const [modalOn, setModalOn] = useState(false); + const [isFavorite, setIsFavorite] = useState(false); const navigate = useNavigate(); @@ -32,6 +34,14 @@ function LecueBook(props: LecueBookProps) { event.stopPropagation(); }; + /** 즐찾 버튼 클릭 & 해제 */ + const handleClickFavoriteBtn = ( + event: React.MouseEvent, + ) => { + event.stopPropagation(); + setIsFavorite(!isFavorite); + }; + const handleFn = () => { deleteMutation.mutate(bookId); }; @@ -49,13 +59,24 @@ function LecueBook(props: LecueBookProps) { > {favoriteName} + { + handleClickFavoriteBtn(event); + }} + > + {isFavorite ? : } + {title} {bookDate} {noteCount}개 - handleClickTrashBtn(event)}> + handleClickTrashBtn(event)} + > From ae325270e99ecd211df3977a81ed774e7ebaa836 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Mon, 18 Mar 2024 17:49:54 +0900 Subject: [PATCH 26/99] =?UTF-8?q?feat:=20MyLecueBook=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyLecueBook/MyLecueBook.style.ts | 10 ++++++ src/Mypage/components/MyLecueBook/index.tsx | 33 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Mypage/components/MyLecueBook/MyLecueBook.style.ts create mode 100644 src/Mypage/components/MyLecueBook/index.tsx diff --git a/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts b/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts new file mode 100644 index 00000000..71c2dca9 --- /dev/null +++ b/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts @@ -0,0 +1,10 @@ +import styled from '@emotion/styled'; + +export const Wrapper = styled.section` + display: flex; + gap: 1.2rem; + flex-direction: column; + + padding: 0 1.6rem 2rem; + margin-top: 7.9rem; +`; diff --git a/src/Mypage/components/MyLecueBook/index.tsx b/src/Mypage/components/MyLecueBook/index.tsx new file mode 100644 index 00000000..a860a4e1 --- /dev/null +++ b/src/Mypage/components/MyLecueBook/index.tsx @@ -0,0 +1,33 @@ +import useGetMyBookList from '../../hooks/useGetMyBookList'; +import { LecueBookProps } from '../../types/myPageType'; +import LecueBook from '../LecueBook'; +import * as S from './MyLecueBook.style'; + +function MyLecueBook() { + const { myBookList } = useGetMyBookList(); + + return ( + + {myBookList && myBookList.length !== 0 ? ( + myBookList.map((book: LecueBookProps) => { + return ( + + ); + }) + ) : ( +
레큐북 0개....~
+ )} +
+ ); +} + +export default MyLecueBook; From d42dc8dc2bd9a872f7fd87bb47bbb4fb238977a0 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 19 Mar 2024 09:23:04 +0900 Subject: [PATCH 27/99] =?UTF-8?q?style:=20font=20=EC=83=89=EC=83=81=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/SelectModal/SelectModal.style.ts | 1 + src/History/page/History.style.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/History/components/SelectModal/SelectModal.style.ts b/src/History/components/SelectModal/SelectModal.style.ts index bee05901..971d2057 100644 --- a/src/History/components/SelectModal/SelectModal.style.ts +++ b/src/History/components/SelectModal/SelectModal.style.ts @@ -71,6 +71,7 @@ export const OptionListItem = styled.button` export const OptionListItemText = styled.p` padding-top: 0.3rem; + color: ${({ theme }) => theme.colors.BG}; ${({ theme }) => theme.fonts.Title2_M_16}; `; diff --git a/src/History/page/History.style.ts b/src/History/page/History.style.ts index 8c7e415a..5f0b11c9 100644 --- a/src/History/page/History.style.ts +++ b/src/History/page/History.style.ts @@ -25,5 +25,6 @@ export const HistorySelectButton = styled.button` export const CurrentHistoryOption = styled.h2` padding-top: 0.3rem; + color: ${({ theme }) => theme.colors.BG}; ${({ theme }) => theme.fonts.Head2_SB_18}; `; From 56e91a1dbe2cb2b707dd1a86b37a10ef3ddf2258 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Tue, 19 Mar 2024 17:33:49 +0900 Subject: [PATCH 28/99] =?UTF-8?q?feat:=20getMyNickName=20api=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=82=AC=ED=95=AD=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/api/getMyNickName.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mypage/api/getMyNickName.ts b/src/Mypage/api/getMyNickName.ts index d555ab39..e4c93ed3 100644 --- a/src/Mypage/api/getMyNickName.ts +++ b/src/Mypage/api/getMyNickName.ts @@ -2,7 +2,7 @@ import { api } from '../../libs/api'; export async function getMyNickName() { const token = localStorage.getItem('token'); - const data = await api.get(`/api/mypage/note`, { + const data = await api.get(`/api/mypage`, { headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}`, From e4545c056a9c2c4546361fc494c48a43b9347e6f Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Tue, 19 Mar 2024 17:57:32 +0900 Subject: [PATCH 29/99] =?UTF-8?q?feat:=20=EB=A0=88=ED=81=90=EB=B6=81?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20api=20=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/api/getMyBookList.ts | 3 ++- src/Mypage/types/myPageType.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mypage/api/getMyBookList.ts b/src/Mypage/api/getMyBookList.ts index 09a063d3..7b111402 100644 --- a/src/Mypage/api/getMyBookList.ts +++ b/src/Mypage/api/getMyBookList.ts @@ -8,5 +8,6 @@ export async function getMyBookList() { Authorization: `Bearer ${token}`, }, }); - return data.data.data.bookList; + + return data.data.data; } diff --git a/src/Mypage/types/myPageType.ts b/src/Mypage/types/myPageType.ts index 6289a6f1..e8f1401d 100644 --- a/src/Mypage/types/myPageType.ts +++ b/src/Mypage/types/myPageType.ts @@ -5,6 +5,7 @@ export interface LecueBookType { title: string; bookDate: string; noteNum: number; + isFavorite: boolean; } export interface LecueBookProps extends LecueBookType { From 0d06969ceb75bb0a4e5862130aa88845ed406be8 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Tue, 19 Mar 2024 19:36:04 +0900 Subject: [PATCH 30/99] =?UTF-8?q?feat:=20postFavorite=20api=20=EB=B6=99?= =?UTF-8?q?=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/api/postFavorite.ts | 19 +++++++++++++++++++ src/libs/hooks/usePostFavorite.ts | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/libs/api/postFavorite.ts create mode 100644 src/libs/hooks/usePostFavorite.ts diff --git a/src/libs/api/postFavorite.ts b/src/libs/api/postFavorite.ts new file mode 100644 index 00000000..fb30f9b2 --- /dev/null +++ b/src/libs/api/postFavorite.ts @@ -0,0 +1,19 @@ +import { api } from '../../libs/api'; + +const postFavorite = async (bookId: number) => { + const token = localStorage.getItem('token'); + const { data } = await api.post( + '/api/favorite', + { bookId: bookId }, + { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + }, + ); + + return data; +}; + +export default postFavorite; diff --git a/src/libs/hooks/usePostFavorite.ts b/src/libs/hooks/usePostFavorite.ts new file mode 100644 index 00000000..b0f1854e --- /dev/null +++ b/src/libs/hooks/usePostFavorite.ts @@ -0,0 +1,17 @@ +import { useMutation } from 'react-query'; +import { useNavigate } from 'react-router-dom'; + +import postFavorite from '../api/postFavorite'; + +const usePostFavorite = () => { + const navigate = useNavigate(); + const mutation = useMutation({ + mutationFn: (bookId: number) => { + return postFavorite(bookId); + }, + onError: () => navigate('/error'), + }); + return mutation; +}; + +export default usePostFavorite; From 4d1331d42aa5789afa70ad5af8355b1179eb3f97 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Tue, 19 Mar 2024 19:36:54 +0900 Subject: [PATCH 31/99] =?UTF-8?q?feat:=20=EC=A6=90=EA=B2=A8=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0=20=EC=B6=94=EA=B0=80/=ED=95=B4=EC=A0=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/components/LecueBook/index.tsx | 34 +++++++++++++++------ src/Mypage/components/MyLecueBook/index.tsx | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/Mypage/components/LecueBook/index.tsx b/src/Mypage/components/LecueBook/index.tsx index 3f68ded8..e375bb32 100644 --- a/src/Mypage/components/LecueBook/index.tsx +++ b/src/Mypage/components/LecueBook/index.tsx @@ -3,21 +3,31 @@ import { useNavigate } from 'react-router-dom'; import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; import CommonModal from '../../../components/common/Modal/CommonModal'; +import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; +import usePostFavorite from '../../../libs/hooks/usePostFavorite'; import useDeleteMyBook from '../../hooks/useDeleteMyBook'; import { LecueBookProps } from '../../types/myPageType'; import * as S from './LecueBook.style'; function LecueBook(props: LecueBookProps) { - const { bookId, favoriteName, title, bookDate, noteNum, bookUuid } = props; - // const { bookId, favoriteName, title, bookDate, noteNum, bookUuid, isFavorite } = props; - + const { + bookId, + favoriteName, + title, + bookDate, + noteNum, + bookUuid, + isFavorite, + } = props; const [noteCount, setNoteCount] = useState(''); const [modalOn, setModalOn] = useState(false); - const [isFavorite, setIsFavorite] = useState(false); + const [favorite, setFavorite] = useState(isFavorite); const navigate = useNavigate(); const deleteMutation = useDeleteMyBook(); + const FavoritePostMutation = usePostFavorite(); + const FavoriteDeleteMutation = useDeleteFavorite(); const convertNoteCount = (noteNum: number) => { setNoteCount(noteNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); @@ -34,12 +44,18 @@ function LecueBook(props: LecueBookProps) { event.stopPropagation(); }; - /** 즐찾 버튼 클릭 & 해제 */ const handleClickFavoriteBtn = ( event: React.MouseEvent, + bookId: number, ) => { event.stopPropagation(); - setIsFavorite(!isFavorite); + if (favorite) { + FavoriteDeleteMutation.mutate(bookId); + setFavorite(false); + } else { + FavoritePostMutation.mutate(bookId); + setFavorite(true); + } }; const handleFn = () => { @@ -48,7 +64,7 @@ function LecueBook(props: LecueBookProps) { useEffect(() => { convertNoteCount(noteNum); - }); + }, [favorite]); return ( @@ -62,10 +78,10 @@ function LecueBook(props: LecueBookProps) { { - handleClickFavoriteBtn(event); + handleClickFavoriteBtn(event, bookId); }} > - {isFavorite ? : } + {favorite ? : } {title} diff --git a/src/Mypage/components/MyLecueBook/index.tsx b/src/Mypage/components/MyLecueBook/index.tsx index a860a4e1..92a06c3c 100644 --- a/src/Mypage/components/MyLecueBook/index.tsx +++ b/src/Mypage/components/MyLecueBook/index.tsx @@ -19,7 +19,7 @@ function MyLecueBook() { title={book.title} bookDate={book.bookDate} noteNum={book.noteNum} - // isFavorite = {book.isFavorite} + isFavorite={book.isFavorite} /> ); }) From 6d3fc783943322b4aed0a002db1b2bfaee90bd58 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Tue, 19 Mar 2024 19:41:05 +0900 Subject: [PATCH 32/99] =?UTF-8?q?style:=20padding,=20margin=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/components/MyLecueBook/MyLecueBook.style.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts b/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts index 71c2dca9..6a2cf763 100644 --- a/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts +++ b/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts @@ -1,10 +1,10 @@ import styled from '@emotion/styled'; -export const Wrapper = styled.section` +export const Wrapper = styled.article` display: flex; gap: 1.2rem; flex-direction: column; - padding: 0 1.6rem 2rem; - margin-top: 7.9rem; + width: 100%; + padding-bottom: 2rem; `; From 71a18926c8a75e91271ce0dc8a3732c8b95f98c3 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 20 Mar 2024 17:06:51 +0900 Subject: [PATCH 33/99] =?UTF-8?q?chore:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95=20(MyLecueB?= =?UTF-8?q?ook=20->=20LecueBookList)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LecueBookList.style.ts} | 0 src/Mypage/components/{MyLecueBook => LecueBookList}/index.tsx | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/Mypage/components/{MyLecueBook/MyLecueBook.style.ts => LecueBookList/LecueBookList.style.ts} (100%) rename src/Mypage/components/{MyLecueBook => LecueBookList}/index.tsx (95%) diff --git a/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts b/src/Mypage/components/LecueBookList/LecueBookList.style.ts similarity index 100% rename from src/Mypage/components/MyLecueBook/MyLecueBook.style.ts rename to src/Mypage/components/LecueBookList/LecueBookList.style.ts diff --git a/src/Mypage/components/MyLecueBook/index.tsx b/src/Mypage/components/LecueBookList/index.tsx similarity index 95% rename from src/Mypage/components/MyLecueBook/index.tsx rename to src/Mypage/components/LecueBookList/index.tsx index 92a06c3c..1367afb1 100644 --- a/src/Mypage/components/MyLecueBook/index.tsx +++ b/src/Mypage/components/LecueBookList/index.tsx @@ -1,7 +1,7 @@ import useGetMyBookList from '../../hooks/useGetMyBookList'; import { LecueBookProps } from '../../types/myPageType'; import LecueBook from '../LecueBook'; -import * as S from './MyLecueBook.style'; +import * as S from './LecueBookList.style'; function MyLecueBook() { const { myBookList } = useGetMyBookList(); From 6b5a0782c11005df249a1fc5a9837a069dce08ab Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 20 Mar 2024 17:37:11 +0900 Subject: [PATCH 34/99] =?UTF-8?q?chore:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EB=AA=85=20=EB=B3=80=EA=B2=BD(MyLecueBook,=20MyLecueB?= =?UTF-8?q?ookList)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyLecueBook/MyLecueBook.style.ts | 88 ++++++++++++++ src/Mypage/components/MyLecueBook/index.tsx | 111 ++++++++++++++++++ .../MyLecueBookList/MyLecueBookList.style.ts | 10 ++ .../components/MyLecueBookList/index.tsx | 33 ++++++ 4 files changed, 242 insertions(+) create mode 100644 src/Mypage/components/MyLecueBook/MyLecueBook.style.ts create mode 100644 src/Mypage/components/MyLecueBook/index.tsx create mode 100644 src/Mypage/components/MyLecueBookList/MyLecueBookList.style.ts create mode 100644 src/Mypage/components/MyLecueBookList/index.tsx diff --git a/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts b/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts new file mode 100644 index 00000000..49c6eab0 --- /dev/null +++ b/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts @@ -0,0 +1,88 @@ +import styled from '@emotion/styled'; + +export const Wrapper = styled.li` + display: flex; + gap: 0.8rem; + flex-direction: column; + position: relative; + + width: 100%; + height: 11.4rem; + padding: 1.3rem 1.8rem 1.1rem 2.5rem; + + border-radius: 0.4rem; + background-color: ${({ theme }) => theme.colors.white}; +`; + +export const BookWrapper = styled.div` + display: flex; + justify-content: center; + flex-direction: column; + + width: 100%; + height: 100%; + + cursor: pointer; +`; + +export const Header = styled.div` + display: flex; + gap: 0.5rem; + align-items: center; + + width: 100%; + margin-bottom: 1.2rem; +`; + +export const Name = styled.p` + ${({ theme }) => theme.fonts.Head2_SB_18}; + color: ${({ theme }) => theme.colors.BG}; +`; + +export const Favorite = styled.button` + width: 2.2rem; + height: 2.2rem; +`; + +export const TrashBtn = styled.button` + position: absolute; + top: 1.2rem; + right: 1.8rem; + + width: 3.2rem; + height: 3.2rem; +`; + +export const Title = styled.p` + ${({ theme }) => theme.fonts.Title1_SB_16}; + color: ${({ theme }) => theme.colors.BG}; +`; + +export const Footer = styled.div` + display: flex; + justify-content: space-between; + align-items: flex-end; + + width: 100%; +`; + +export const Date = styled.p` + padding-bottom: 0.4rem; + + ${({ theme }) => theme.fonts.E_Caption_R_12}; + color: ${({ theme }) => theme.colors.DG50}; +`; + +export const Count = styled.p` + display: flex; + justify-content: center; + align-items: center; + + height: 3.1rem; + padding: 0.6516rem 1.4661rem; + + border-radius: 5.7rem; + ${({ theme }) => theme.fonts.E_Caption_R_12}; + background-color: ${({ theme }) => theme.colors.BG}; + color: ${({ theme }) => theme.colors.white}; +`; diff --git a/src/Mypage/components/MyLecueBook/index.tsx b/src/Mypage/components/MyLecueBook/index.tsx new file mode 100644 index 00000000..4fbfb882 --- /dev/null +++ b/src/Mypage/components/MyLecueBook/index.tsx @@ -0,0 +1,111 @@ +import { useEffect, useState } from 'react'; +import { useNavigate } from 'react-router-dom'; + +import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; +import CommonModal from '../../../components/common/Modal/CommonModal'; +import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; +import usePostFavorite from '../../../libs/hooks/usePostFavorite'; +import useDeleteMyBook from '../../hooks/useDeleteMyBook'; +import { LecueBookProps } from '../../types/myPageType'; +import * as S from './MyLecueBook.style'; + +function MyLecueBook(props: LecueBookProps) { + const { + bookId, + favoriteName, + title, + bookDate, + noteNum, + bookUuid, + isFavorite, + } = 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(); + + const convertNoteCount = (noteNum: number) => { + setNoteCount(noteNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); + }; + + const handleClickBook = (bookUuid: string) => { + navigate(`/lecue-book/${bookUuid}`); + }; + + const handleClickTrashBtn = ( + event: React.MouseEvent, + ) => { + setModalOn(true); + event.stopPropagation(); + }; + + const handleClickFavoriteBtn = ( + event: React.MouseEvent, + bookId: number, + ) => { + event.stopPropagation(); + if (favorite) { + FavoriteDeleteMutation.mutate(bookId); + setFavorite(false); + } else { + FavoritePostMutation.mutate(bookId); + setFavorite(true); + } + }; + + const handleFn = () => { + deleteMutation.mutate(bookId); + }; + + useEffect(() => { + convertNoteCount(noteNum); + }, [favorite]); + + return ( + + { + handleClickBook(bookUuid); + }} + > + + {favoriteName} + { + handleClickFavoriteBtn(event, bookId); + }} + > + {favorite ? : } + + + {title} + + {bookDate} + {noteCount}개 + + handleClickTrashBtn(event)} + > + + + + + {modalOn && ( + + )} + + ); +} + +export default MyLecueBook; diff --git a/src/Mypage/components/MyLecueBookList/MyLecueBookList.style.ts b/src/Mypage/components/MyLecueBookList/MyLecueBookList.style.ts new file mode 100644 index 00000000..6a2cf763 --- /dev/null +++ b/src/Mypage/components/MyLecueBookList/MyLecueBookList.style.ts @@ -0,0 +1,10 @@ +import styled from '@emotion/styled'; + +export const Wrapper = styled.article` + display: flex; + gap: 1.2rem; + flex-direction: column; + + width: 100%; + padding-bottom: 2rem; +`; diff --git a/src/Mypage/components/MyLecueBookList/index.tsx b/src/Mypage/components/MyLecueBookList/index.tsx new file mode 100644 index 00000000..b4ed33c2 --- /dev/null +++ b/src/Mypage/components/MyLecueBookList/index.tsx @@ -0,0 +1,33 @@ +import useGetMyBookList from '../../hooks/useGetMyBookList'; +import { LecueBookProps } from '../../types/myPageType'; +import MyLecueBook from '../MyLecueBook'; +import * as S from './MyLecueBookList.style'; + +function MyLecueBookList() { + const { myBookList } = useGetMyBookList(); + + return ( + + {myBookList && myBookList.length !== 0 ? ( + myBookList.map((book: LecueBookProps) => { + return ( + + ); + }) + ) : ( +
레큐북 0개....~
+ )} +
+ ); +} + +export default MyLecueBookList; From 8c225ee9474b254a1df899cf0044921535f9f849 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 20 Mar 2024 18:28:36 +0900 Subject: [PATCH 35/99] =?UTF-8?q?chore:=20=EC=A4=91=EB=B3=B5=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/LecueBook/LecueBook.style.ts | 88 -------------- src/Mypage/components/LecueBook/index.tsx | 111 ------------------ .../LecueBookList/LecueBookList.style.ts | 10 -- src/Mypage/components/LecueBookList/index.tsx | 33 ------ 4 files changed, 242 deletions(-) delete mode 100644 src/Mypage/components/LecueBook/LecueBook.style.ts delete mode 100644 src/Mypage/components/LecueBook/index.tsx delete mode 100644 src/Mypage/components/LecueBookList/LecueBookList.style.ts delete mode 100644 src/Mypage/components/LecueBookList/index.tsx diff --git a/src/Mypage/components/LecueBook/LecueBook.style.ts b/src/Mypage/components/LecueBook/LecueBook.style.ts deleted file mode 100644 index 49c6eab0..00000000 --- a/src/Mypage/components/LecueBook/LecueBook.style.ts +++ /dev/null @@ -1,88 +0,0 @@ -import styled from '@emotion/styled'; - -export const Wrapper = styled.li` - display: flex; - gap: 0.8rem; - flex-direction: column; - position: relative; - - width: 100%; - height: 11.4rem; - padding: 1.3rem 1.8rem 1.1rem 2.5rem; - - border-radius: 0.4rem; - background-color: ${({ theme }) => theme.colors.white}; -`; - -export const BookWrapper = styled.div` - display: flex; - justify-content: center; - flex-direction: column; - - width: 100%; - height: 100%; - - cursor: pointer; -`; - -export const Header = styled.div` - display: flex; - gap: 0.5rem; - align-items: center; - - width: 100%; - margin-bottom: 1.2rem; -`; - -export const Name = styled.p` - ${({ theme }) => theme.fonts.Head2_SB_18}; - color: ${({ theme }) => theme.colors.BG}; -`; - -export const Favorite = styled.button` - width: 2.2rem; - height: 2.2rem; -`; - -export const TrashBtn = styled.button` - position: absolute; - top: 1.2rem; - right: 1.8rem; - - width: 3.2rem; - height: 3.2rem; -`; - -export const Title = styled.p` - ${({ theme }) => theme.fonts.Title1_SB_16}; - color: ${({ theme }) => theme.colors.BG}; -`; - -export const Footer = styled.div` - display: flex; - justify-content: space-between; - align-items: flex-end; - - width: 100%; -`; - -export const Date = styled.p` - padding-bottom: 0.4rem; - - ${({ theme }) => theme.fonts.E_Caption_R_12}; - color: ${({ theme }) => theme.colors.DG50}; -`; - -export const Count = styled.p` - display: flex; - justify-content: center; - align-items: center; - - height: 3.1rem; - padding: 0.6516rem 1.4661rem; - - border-radius: 5.7rem; - ${({ theme }) => theme.fonts.E_Caption_R_12}; - background-color: ${({ theme }) => theme.colors.BG}; - color: ${({ theme }) => theme.colors.white}; -`; diff --git a/src/Mypage/components/LecueBook/index.tsx b/src/Mypage/components/LecueBook/index.tsx deleted file mode 100644 index e375bb32..00000000 --- a/src/Mypage/components/LecueBook/index.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { useEffect, useState } from 'react'; -import { useNavigate } from 'react-router-dom'; - -import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; -import CommonModal from '../../../components/common/Modal/CommonModal'; -import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; -import usePostFavorite from '../../../libs/hooks/usePostFavorite'; -import useDeleteMyBook from '../../hooks/useDeleteMyBook'; -import { LecueBookProps } from '../../types/myPageType'; -import * as S from './LecueBook.style'; - -function LecueBook(props: LecueBookProps) { - const { - bookId, - favoriteName, - title, - bookDate, - noteNum, - bookUuid, - isFavorite, - } = 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(); - - const convertNoteCount = (noteNum: number) => { - setNoteCount(noteNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); - }; - - const handleClickBook = (bookUuid: string) => { - navigate(`/lecue-book/${bookUuid}`); - }; - - const handleClickTrashBtn = ( - event: React.MouseEvent, - ) => { - setModalOn(true); - event.stopPropagation(); - }; - - const handleClickFavoriteBtn = ( - event: React.MouseEvent, - bookId: number, - ) => { - event.stopPropagation(); - if (favorite) { - FavoriteDeleteMutation.mutate(bookId); - setFavorite(false); - } else { - FavoritePostMutation.mutate(bookId); - setFavorite(true); - } - }; - - const handleFn = () => { - deleteMutation.mutate(bookId); - }; - - useEffect(() => { - convertNoteCount(noteNum); - }, [favorite]); - - return ( - - { - handleClickBook(bookUuid); - }} - > - - {favoriteName} - { - handleClickFavoriteBtn(event, bookId); - }} - > - {favorite ? : } - - - {title} - - {bookDate} - {noteCount}개 - - handleClickTrashBtn(event)} - > - - - - - {modalOn && ( - - )} - - ); -} - -export default LecueBook; diff --git a/src/Mypage/components/LecueBookList/LecueBookList.style.ts b/src/Mypage/components/LecueBookList/LecueBookList.style.ts deleted file mode 100644 index 6a2cf763..00000000 --- a/src/Mypage/components/LecueBookList/LecueBookList.style.ts +++ /dev/null @@ -1,10 +0,0 @@ -import styled from '@emotion/styled'; - -export const Wrapper = styled.article` - display: flex; - gap: 1.2rem; - flex-direction: column; - - width: 100%; - padding-bottom: 2rem; -`; diff --git a/src/Mypage/components/LecueBookList/index.tsx b/src/Mypage/components/LecueBookList/index.tsx deleted file mode 100644 index 1367afb1..00000000 --- a/src/Mypage/components/LecueBookList/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import useGetMyBookList from '../../hooks/useGetMyBookList'; -import { LecueBookProps } from '../../types/myPageType'; -import LecueBook from '../LecueBook'; -import * as S from './LecueBookList.style'; - -function MyLecueBook() { - const { myBookList } = useGetMyBookList(); - - return ( - - {myBookList && myBookList.length !== 0 ? ( - myBookList.map((book: LecueBookProps) => { - return ( - - ); - }) - ) : ( -
레큐북 0개....~
- )} -
- ); -} - -export default MyLecueBook; From e0498d28afd507ba671d4522ba0ac73ffbb682e9 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 14:53:47 +0900 Subject: [PATCH 36/99] =?UTF-8?q?style:=20=EC=8A=A4=ED=83=80=EC=9D=BC?= =?UTF-8?q?=EB=A6=B0=ED=8A=B8=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PageLayout/EnterView/EnterView.style.ts | 4 ++-- .../PageLayout/HistoryEnterView/HistoryEnterView.style.ts | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Mypage/components/PageLayout/EnterView/EnterView.style.ts b/src/Mypage/components/PageLayout/EnterView/EnterView.style.ts index 742f2dfc..f00384e0 100644 --- a/src/Mypage/components/PageLayout/EnterView/EnterView.style.ts +++ b/src/Mypage/components/PageLayout/EnterView/EnterView.style.ts @@ -6,7 +6,7 @@ export const NicknameWrapper = styled.div<{ variant?: string }>` align-items: center; height: 8.9rem; - padding: 3.2rem 1.6rem 2.9rem 1.6rem; + padding: 3.2rem 1.6rem 2.9rem; border-bottom: 0.6rem solid ${({ theme }) => theme.colors.LG_2}; @@ -22,7 +22,7 @@ export const MenuWrapper = styled.div` display: flex; flex-direction: column; - padding: 2rem 1.6rem 1rem 1.6rem; + padding: 2rem 1.6rem 1rem; `; export const Line = styled.div` diff --git a/src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts b/src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts index c477bb27..09a24459 100644 --- a/src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts +++ b/src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts @@ -2,20 +2,21 @@ import styled from '@emotion/styled'; export const Wrapper = styled.section` display: flex; + gap: 1.2rem; flex-direction: column; + padding: 2.9rem 1.6rem; - gap: 1.2rem; `; export const Tab = styled.li` display: flex; align-items: center; + width: 100%; height: 13rem; - padding: 0 3rem; - border-radius: 0.2rem; + border-radius: 0.2rem; background-color: ${({ theme }) => theme.colors.LG}; cursor: pointer; From a1b0be9cd6e5e3c0574342245b211324a076741e Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 15:59:34 +0900 Subject: [PATCH 37/99] =?UTF-8?q?chore:=20EditNickname=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/api/.gitkeep | 0 src/EditNickname/components/.gitkeep | 0 src/EditNickname/constants/.gitkeep | 0 src/EditNickname/hooks/.gitkeep | 0 src/EditNickname/page/.gitkeep | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/EditNickname/api/.gitkeep create mode 100644 src/EditNickname/components/.gitkeep create mode 100644 src/EditNickname/constants/.gitkeep create mode 100644 src/EditNickname/hooks/.gitkeep create mode 100644 src/EditNickname/page/.gitkeep diff --git a/src/EditNickname/api/.gitkeep b/src/EditNickname/api/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/components/.gitkeep b/src/EditNickname/components/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/constants/.gitkeep b/src/EditNickname/constants/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/hooks/.gitkeep b/src/EditNickname/hooks/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/page/.gitkeep b/src/EditNickname/page/.gitkeep new file mode 100644 index 00000000..e69de29b From 7cf7c19522940aa78e1f55e2a191f4c195b922f6 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 16:17:04 +0900 Subject: [PATCH 38/99] =?UTF-8?q?chore:=20Enter=20=ED=8F=B4=EB=8D=94=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Enter/api/.gitkeep | 0 src/Enter/components/.gitkeep | 0 src/Enter/constants/.gitkeep | 0 src/Enter/hooks/.gitkeep | 0 .../EnterView.style.ts => Enter/page/Enter.style.ts} | 0 .../components/PageLayout/EnterView => Enter/page}/index.tsx | 4 ++-- 6 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/Enter/api/.gitkeep create mode 100644 src/Enter/components/.gitkeep create mode 100644 src/Enter/constants/.gitkeep create mode 100644 src/Enter/hooks/.gitkeep rename src/{Mypage/components/PageLayout/EnterView/EnterView.style.ts => Enter/page/Enter.style.ts} (100%) rename src/{Mypage/components/PageLayout/EnterView => Enter/page}/index.tsx (98%) diff --git a/src/Enter/api/.gitkeep b/src/Enter/api/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Enter/components/.gitkeep b/src/Enter/components/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Enter/constants/.gitkeep b/src/Enter/constants/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Enter/hooks/.gitkeep b/src/Enter/hooks/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Mypage/components/PageLayout/EnterView/EnterView.style.ts b/src/Enter/page/Enter.style.ts similarity index 100% rename from src/Mypage/components/PageLayout/EnterView/EnterView.style.ts rename to src/Enter/page/Enter.style.ts diff --git a/src/Mypage/components/PageLayout/EnterView/index.tsx b/src/Enter/page/index.tsx similarity index 98% rename from src/Mypage/components/PageLayout/EnterView/index.tsx rename to src/Enter/page/index.tsx index 084017d0..39838f01 100644 --- a/src/Mypage/components/PageLayout/EnterView/index.tsx +++ b/src/Enter/page/index.tsx @@ -5,7 +5,7 @@ import { IcArrowRightGray } from '../../../../assets'; import useGetMyNickName from '../../../hooks/useGetMyNickname'; import * as S from './EnterView.style'; -function EnterView() { +function Enter() { const [nickname, setNickname] = useState(''); const navigate = useNavigate(); const { state } = useLocation(); @@ -110,4 +110,4 @@ function EnterView() { ); } -export default EnterView; +export default Enter; From f1f36fb5ea1d47d395bfccfcd91e856450731cc1 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 16:28:37 +0900 Subject: [PATCH 39/99] =?UTF-8?q?chore:=20History=20=ED=8F=B4=EB=8D=94=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/{Mypage => History}/api/deleteMyBook.ts | 0 src/{Mypage => History}/api/getMyBookList.ts | 0 src/{Mypage => History}/api/getMyNoteList.ts | 0 src/History/{api => components/MyFavoriteBook}/.gitkeep | 0 src/History/{hooks => components/MyFavoriteBookList}/.gitkeep | 0 .../components/MyLecueBook/MyLecueBook.style.ts | 0 src/{Mypage => History}/components/MyLecueBook/index.tsx | 4 ++-- .../components/MyLecueBookList/MyLecueBookList.style.ts | 0 src/{Mypage => History}/components/MyLecueBookList/index.tsx | 4 ++-- src/{Mypage => History}/hooks/useDeleteMyBook.ts | 0 src/{Mypage => History}/hooks/useGetMyBookList.ts | 0 src/{Mypage => History}/hooks/useGetMyNoteList.ts | 0 src/History/types/.gitkeep | 0 13 files changed, 4 insertions(+), 4 deletions(-) rename src/{Mypage => History}/api/deleteMyBook.ts (100%) rename src/{Mypage => History}/api/getMyBookList.ts (100%) rename src/{Mypage => History}/api/getMyNoteList.ts (100%) rename src/History/{api => components/MyFavoriteBook}/.gitkeep (100%) rename src/History/{hooks => components/MyFavoriteBookList}/.gitkeep (100%) rename src/{Mypage => History}/components/MyLecueBook/MyLecueBook.style.ts (100%) rename src/{Mypage => History}/components/MyLecueBook/index.tsx (95%) rename src/{Mypage => History}/components/MyLecueBookList/MyLecueBookList.style.ts (100%) rename src/{Mypage => History}/components/MyLecueBookList/index.tsx (85%) rename src/{Mypage => History}/hooks/useDeleteMyBook.ts (100%) rename src/{Mypage => History}/hooks/useGetMyBookList.ts (100%) rename src/{Mypage => History}/hooks/useGetMyNoteList.ts (100%) create mode 100644 src/History/types/.gitkeep diff --git a/src/Mypage/api/deleteMyBook.ts b/src/History/api/deleteMyBook.ts similarity index 100% rename from src/Mypage/api/deleteMyBook.ts rename to src/History/api/deleteMyBook.ts diff --git a/src/Mypage/api/getMyBookList.ts b/src/History/api/getMyBookList.ts similarity index 100% rename from src/Mypage/api/getMyBookList.ts rename to src/History/api/getMyBookList.ts diff --git a/src/Mypage/api/getMyNoteList.ts b/src/History/api/getMyNoteList.ts similarity index 100% rename from src/Mypage/api/getMyNoteList.ts rename to src/History/api/getMyNoteList.ts diff --git a/src/History/api/.gitkeep b/src/History/components/MyFavoriteBook/.gitkeep similarity index 100% rename from src/History/api/.gitkeep rename to src/History/components/MyFavoriteBook/.gitkeep diff --git a/src/History/hooks/.gitkeep b/src/History/components/MyFavoriteBookList/.gitkeep similarity index 100% rename from src/History/hooks/.gitkeep rename to src/History/components/MyFavoriteBookList/.gitkeep diff --git a/src/Mypage/components/MyLecueBook/MyLecueBook.style.ts b/src/History/components/MyLecueBook/MyLecueBook.style.ts similarity index 100% rename from src/Mypage/components/MyLecueBook/MyLecueBook.style.ts rename to src/History/components/MyLecueBook/MyLecueBook.style.ts diff --git a/src/Mypage/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx similarity index 95% rename from src/Mypage/components/MyLecueBook/index.tsx rename to src/History/components/MyLecueBook/index.tsx index 4fbfb882..349f47c0 100644 --- a/src/Mypage/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -5,8 +5,8 @@ import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; import CommonModal from '../../../components/common/Modal/CommonModal'; import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; import usePostFavorite from '../../../libs/hooks/usePostFavorite'; -import useDeleteMyBook from '../../hooks/useDeleteMyBook'; -import { LecueBookProps } from '../../types/myPageType'; +import useDeleteMyBook from '../../../Mypage/hooks/useDeleteMyBook'; +import { LecueBookProps } from '../../../Mypage/types/myPageType'; import * as S from './MyLecueBook.style'; function MyLecueBook(props: LecueBookProps) { diff --git a/src/Mypage/components/MyLecueBookList/MyLecueBookList.style.ts b/src/History/components/MyLecueBookList/MyLecueBookList.style.ts similarity index 100% rename from src/Mypage/components/MyLecueBookList/MyLecueBookList.style.ts rename to src/History/components/MyLecueBookList/MyLecueBookList.style.ts diff --git a/src/Mypage/components/MyLecueBookList/index.tsx b/src/History/components/MyLecueBookList/index.tsx similarity index 85% rename from src/Mypage/components/MyLecueBookList/index.tsx rename to src/History/components/MyLecueBookList/index.tsx index b4ed33c2..acfdc32f 100644 --- a/src/Mypage/components/MyLecueBookList/index.tsx +++ b/src/History/components/MyLecueBookList/index.tsx @@ -1,5 +1,5 @@ -import useGetMyBookList from '../../hooks/useGetMyBookList'; -import { LecueBookProps } from '../../types/myPageType'; +import useGetMyBookList from '../../../Mypage/hooks/useGetMyBookList'; +import { LecueBookProps } from '../../../Mypage/types/myPageType'; import MyLecueBook from '../MyLecueBook'; import * as S from './MyLecueBookList.style'; diff --git a/src/Mypage/hooks/useDeleteMyBook.ts b/src/History/hooks/useDeleteMyBook.ts similarity index 100% rename from src/Mypage/hooks/useDeleteMyBook.ts rename to src/History/hooks/useDeleteMyBook.ts diff --git a/src/Mypage/hooks/useGetMyBookList.ts b/src/History/hooks/useGetMyBookList.ts similarity index 100% rename from src/Mypage/hooks/useGetMyBookList.ts rename to src/History/hooks/useGetMyBookList.ts diff --git a/src/Mypage/hooks/useGetMyNoteList.ts b/src/History/hooks/useGetMyNoteList.ts similarity index 100% rename from src/Mypage/hooks/useGetMyNoteList.ts rename to src/History/hooks/useGetMyNoteList.ts diff --git a/src/History/types/.gitkeep b/src/History/types/.gitkeep new file mode 100644 index 00000000..e69de29b From a05f0bb73a5bdf9794271c094ed8de3b04248da4 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 16:31:53 +0900 Subject: [PATCH 40/99] =?UTF-8?q?chore:=20HistoryEnter=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HistoryEnter/api/.gitkeep | 0 src/HistoryEnter/components/.gitkeep | 0 src/HistoryEnter/constants/.gitkeep | 0 src/HistoryEnter/hooks/.gitkeep | 0 .../page/HistoryEnter.style.ts} | 0 .../HistoryEnterView => HistoryEnter/page}/index.tsx | 6 +++--- 6 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/HistoryEnter/api/.gitkeep create mode 100644 src/HistoryEnter/components/.gitkeep create mode 100644 src/HistoryEnter/constants/.gitkeep create mode 100644 src/HistoryEnter/hooks/.gitkeep rename src/{Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts => HistoryEnter/page/HistoryEnter.style.ts} (100%) rename src/{Mypage/components/PageLayout/HistoryEnterView => HistoryEnter/page}/index.tsx (63%) diff --git a/src/HistoryEnter/api/.gitkeep b/src/HistoryEnter/api/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/HistoryEnter/components/.gitkeep b/src/HistoryEnter/components/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/HistoryEnter/constants/.gitkeep b/src/HistoryEnter/constants/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/HistoryEnter/hooks/.gitkeep b/src/HistoryEnter/hooks/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts b/src/HistoryEnter/page/HistoryEnter.style.ts similarity index 100% rename from src/Mypage/components/PageLayout/HistoryEnterView/HistoryEnterView.style.ts rename to src/HistoryEnter/page/HistoryEnter.style.ts diff --git a/src/Mypage/components/PageLayout/HistoryEnterView/index.tsx b/src/HistoryEnter/page/index.tsx similarity index 63% rename from src/Mypage/components/PageLayout/HistoryEnterView/index.tsx rename to src/HistoryEnter/page/index.tsx index b8c3d9b0..7f4aa152 100644 --- a/src/Mypage/components/PageLayout/HistoryEnterView/index.tsx +++ b/src/HistoryEnter/page/index.tsx @@ -1,6 +1,6 @@ -import * as S from './HistoryEnterView.style'; +import * as S from './HistoryEnter.style'; -function HistoryEnterView() { +function HistoryEnter() { return ( 즐겨찾기 한 레큐북 @@ -10,4 +10,4 @@ function HistoryEnterView() { ); } -export default HistoryEnterView; +export default HistoryEnter; From c59ff363c9d52916555e8d28583bd3ac374d87f5 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 16:38:14 +0900 Subject: [PATCH 41/99] =?UTF-8?q?chore:=20=EA=B3=B5=ED=86=B5=20api=20utils?= =?UTF-8?q?=EB=A1=9C=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Mypage/api/.gitkeep | 0 src/Mypage/hooks/.gitkeep | 0 src/{Mypage => libs}/api/getMyNickName.ts | 0 src/{Mypage => libs}/hooks/useGetMyNickname.ts | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/Mypage/api/.gitkeep create mode 100644 src/Mypage/hooks/.gitkeep rename src/{Mypage => libs}/api/getMyNickName.ts (100%) rename src/{Mypage => libs}/hooks/useGetMyNickname.ts (100%) diff --git a/src/Mypage/api/.gitkeep b/src/Mypage/api/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Mypage/hooks/.gitkeep b/src/Mypage/hooks/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/Mypage/api/getMyNickName.ts b/src/libs/api/getMyNickName.ts similarity index 100% rename from src/Mypage/api/getMyNickName.ts rename to src/libs/api/getMyNickName.ts diff --git a/src/Mypage/hooks/useGetMyNickname.ts b/src/libs/hooks/useGetMyNickname.ts similarity index 100% rename from src/Mypage/hooks/useGetMyNickname.ts rename to src/libs/hooks/useGetMyNickname.ts From 8b9675f1552453e0a742fcf88f208caf43af6589 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 16:38:49 +0900 Subject: [PATCH 42/99] =?UTF-8?q?chore:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/LecueList/LecueList.style.ts | 56 --------- src/Mypage/components/LecueList/index.tsx | 107 ------------------ 2 files changed, 163 deletions(-) delete mode 100644 src/Mypage/components/LecueList/LecueList.style.ts delete mode 100644 src/Mypage/components/LecueList/index.tsx diff --git a/src/Mypage/components/LecueList/LecueList.style.ts b/src/Mypage/components/LecueList/LecueList.style.ts deleted file mode 100644 index fb477f7e..00000000 --- a/src/Mypage/components/LecueList/LecueList.style.ts +++ /dev/null @@ -1,56 +0,0 @@ -import styled from '@emotion/styled'; - -export const Wrapper = styled.article` - display: flex; - flex-direction: column; - - width: 100%; - height: 100%; -`; - -export const ButtonWrapper = styled.section` - display: flex; - - width: 100%; -`; - -export const Button = styled.button<{ variant: boolean }>` - width: calc(100vw - 4rem); - height: 3.7rem; - padding: 0.7rem 1.15rem; - - border-radius: 0.4rem 0.4rem 0 0; - background-color: ${({ theme, variant }) => - variant ? theme.colors.black : 'transparent'}; - color: ${({ theme, variant }) => - variant ? theme.colors.background : theme.colors.MG}; - ${({ theme }) => theme.fonts.Title2_M_16} - - text-align: center; - vertical-align: center; -`; - -export const ListWrapper = styled.section<{ variant: string }>` - display: flex; - justify-content: center; - - width: 100%; - height: calc(100dvh - 19.3rem); - padding: 1rem 1rem 1rem ${({ variant }) => (variant === 'note' ? 1.5 : 1)}rem; - - border-radius: ${({ variant }) => (variant === 'note' ? 0 : 0.4)}rem - ${({ variant }) => (variant === 'note' ? 0.4 : 0)}rem 0.4rem 0.4rem; - background-color: ${({ theme }) => theme.colors.black}; -`; - -export const ListContainer = styled.div<{ variant: string }>` - display: flex; - gap: ${({ variant }) => (variant === 'note' ? 1.1 : 0.8)}rem - ${({ variant }) => (variant === 'note' ? 1.1 : 0.95)}rem; - flex-wrap: wrap; - overflow: scroll; - - width: 100%; - height: 100%; - align-content: flex-start; -`; diff --git a/src/Mypage/components/LecueList/index.tsx b/src/Mypage/components/LecueList/index.tsx deleted file mode 100644 index bc4fedf7..00000000 --- a/src/Mypage/components/LecueList/index.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { useEffect, useState } from 'react'; - -import useGetMyBookList from '../../hooks/useGetMyBookList'; -import useGetNoteList from '../../hooks/useGetMyNoteList'; -import { - LecueBookProps, - LecueBookType, - LecueNoteType, -} from '../../types/myPageType'; -import EmptyView from '../EmptyView'; -import LecueBook from '../LecueBook'; -import LecueNote from '../LecueNote'; -import * as S from './LecueList.style'; - -function LecueList() { - const [clickedBtn, setClickedBtn] = useState('note'); - const [counter, setCounter] = useState([0, 0]); - - const { myBookList } = useGetMyBookList(); - const { myNoteList } = useGetNoteList(); - - const handleClickNoteBtn = () => { - document.getElementById('list-wrapper')!.scrollTo(0, 0); - setClickedBtn('note'); - }; - - const handleClickBookBtn = () => { - document.getElementById('list-wrapper')!.scrollTo(0, 0); - setClickedBtn('book'); - }; - - const numberCount = (NOTE: LecueNoteType[], BOOK: LecueBookType[]) => { - setCounter([NOTE.length, BOOK.length]); - }; - - useEffect(() => { - if (myNoteList && myBookList) { - numberCount(myNoteList, myBookList); - } - }, [myNoteList, myBookList]); - - return ( - - - - 레큐노트 ({counter[0]}개) - - - 레큐북 ({counter[1]}개) - - - - - - {clickedBtn === 'note' ? ( - myNoteList && myNoteList.length !== 0 ? ( - myNoteList.map((note: LecueNoteType) => { - return ( - - ); - }) - ) : ( - - ) - ) : myBookList && myBookList.length !== 0 ? ( - myBookList.map((book: LecueBookProps) => { - return ( - - ); - }) - ) : ( - - )} - - - - ); -} - -export default LecueList; From a6293651370dd08ba22bacda63b34e8a81d8f2e7 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 16:51:39 +0900 Subject: [PATCH 43/99] =?UTF-8?q?chore:=20=ED=8F=B4=EB=8D=94=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?import=EB=AC=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Enter/page/index.tsx | 6 +++--- src/History/components/MyLecueBook/index.tsx | 2 +- src/History/components/MyLecueBookList/index.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Enter/page/index.tsx b/src/Enter/page/index.tsx index 39838f01..a97455a7 100644 --- a/src/Enter/page/index.tsx +++ b/src/Enter/page/index.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { IcArrowRightGray } from '../../../../assets'; -import useGetMyNickName from '../../../hooks/useGetMyNickname'; -import * as S from './EnterView.style'; +import { IcArrowRightGray } from '../../assets'; +import useGetMyNickName from '../../libs/hooks/useGetMyNickname'; +import * as S from './Enter.style'; function Enter() { const [nickname, setNickname] = useState(''); diff --git a/src/History/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx index 349f47c0..cb2c7923 100644 --- a/src/History/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -5,8 +5,8 @@ import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; import CommonModal from '../../../components/common/Modal/CommonModal'; import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; import usePostFavorite from '../../../libs/hooks/usePostFavorite'; -import useDeleteMyBook from '../../../Mypage/hooks/useDeleteMyBook'; import { LecueBookProps } from '../../../Mypage/types/myPageType'; +import useDeleteMyBook from '../../hooks/useDeleteMyBook'; import * as S from './MyLecueBook.style'; function MyLecueBook(props: LecueBookProps) { diff --git a/src/History/components/MyLecueBookList/index.tsx b/src/History/components/MyLecueBookList/index.tsx index acfdc32f..e95de85d 100644 --- a/src/History/components/MyLecueBookList/index.tsx +++ b/src/History/components/MyLecueBookList/index.tsx @@ -1,5 +1,5 @@ -import useGetMyBookList from '../../../Mypage/hooks/useGetMyBookList'; import { LecueBookProps } from '../../../Mypage/types/myPageType'; +import useGetMyBookList from '../../hooks/useGetMyBookList'; import MyLecueBook from '../MyLecueBook'; import * as S from './MyLecueBookList.style'; From f89879e112cd38d59b0a744957778cff6d191d85 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 17:03:10 +0900 Subject: [PATCH 44/99] =?UTF-8?q?chore:=20LecueBook=20type=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/components/MyLecueBook/index.tsx | 2 +- src/History/components/MyLecueBookList/index.tsx | 2 +- src/History/types/.gitkeep | 0 src/History/types/historyType.ts | 13 +++++++++++++ src/Mypage/types/myPageType.ts | 14 -------------- 5 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 src/History/types/.gitkeep create mode 100644 src/History/types/historyType.ts diff --git a/src/History/components/MyLecueBook/index.tsx b/src/History/components/MyLecueBook/index.tsx index cb2c7923..2b4a64a2 100644 --- a/src/History/components/MyLecueBook/index.tsx +++ b/src/History/components/MyLecueBook/index.tsx @@ -5,8 +5,8 @@ import { IcStar, IcStarDefault, IcWaste } from '../../../assets'; import CommonModal from '../../../components/common/Modal/CommonModal'; import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; import usePostFavorite from '../../../libs/hooks/usePostFavorite'; -import { LecueBookProps } from '../../../Mypage/types/myPageType'; import useDeleteMyBook from '../../hooks/useDeleteMyBook'; +import { LecueBookProps } from '../../types/historyType'; import * as S from './MyLecueBook.style'; function MyLecueBook(props: LecueBookProps) { diff --git a/src/History/components/MyLecueBookList/index.tsx b/src/History/components/MyLecueBookList/index.tsx index e95de85d..96637e18 100644 --- a/src/History/components/MyLecueBookList/index.tsx +++ b/src/History/components/MyLecueBookList/index.tsx @@ -1,5 +1,5 @@ -import { LecueBookProps } from '../../../Mypage/types/myPageType'; import useGetMyBookList from '../../hooks/useGetMyBookList'; +import { LecueBookProps } from '../../types/historyType'; import MyLecueBook from '../MyLecueBook'; import * as S from './MyLecueBookList.style'; diff --git a/src/History/types/.gitkeep b/src/History/types/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/History/types/historyType.ts b/src/History/types/historyType.ts new file mode 100644 index 00000000..b55fa932 --- /dev/null +++ b/src/History/types/historyType.ts @@ -0,0 +1,13 @@ +export interface LecueBookType { + bookUuid: string; + bookId: number; + favoriteName: string; + title: string; + bookDate: string; + noteNum: number; + isFavorite: boolean; +} + +export interface LecueBookProps extends LecueBookType { + key: number; +} diff --git a/src/Mypage/types/myPageType.ts b/src/Mypage/types/myPageType.ts index e8f1401d..a4c1c428 100644 --- a/src/Mypage/types/myPageType.ts +++ b/src/Mypage/types/myPageType.ts @@ -1,17 +1,3 @@ -export interface LecueBookType { - bookUuid: string; - bookId: number; - favoriteName: string; - title: string; - bookDate: string; - noteNum: number; - isFavorite: boolean; -} - -export interface LecueBookProps extends LecueBookType { - key: number; -} - export interface LecueNoteType { bookUuid: string; noteId: number; From 70f9a699a2cf5d87f2a4c9bdb95bc4fdb666bd06 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 17:09:54 +0900 Subject: [PATCH 45/99] =?UTF-8?q?feat:=20=EC=A4=91=EC=B2=A9=20=EB=9D=BC?= =?UTF-8?q?=EC=9A=B0=ED=84=B0=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Router.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Router.tsx b/src/Router.tsx index 361e5cc5..4177b7fb 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -9,12 +9,13 @@ import ErrorPage from './components/common/ErrorPage'; import LoadingPage from './components/common/LoadingPage'; import CreateBook from './CreateBook/page'; import DetailPage from './Detail/page/DetailPage'; +import Enter from './Enter/page'; import HealthTest from './HealthTest'; import History from './History/page'; +import HistoryEnter from './HistoryEnter/page'; import LecueNotePage from './LecueNote/page/LeceuNotePage'; import LoginCallback from './Login/components/LoginCallback/LoginCallback'; import Login from './Login/page'; -import EnterView from './Mypage/components/PageLayout/EnterView'; import Mypage from './Mypage/page'; import Register from './Register/page'; import SelectBookPage from './SelectBook/page/SelectBookPage'; @@ -54,10 +55,10 @@ function Router() { } /> } /> }> - } /> - {/* } /> */} - {/* } /> */} - {/* } /> */} + } /> + {/* } /> */} + } /> + } /> } /> } /> @@ -73,7 +74,6 @@ function Router() { } /> } /> } /> - } /> From 85296743300095248b0f1f221f392bab96771045 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 18:09:44 +0900 Subject: [PATCH 46/99] =?UTF-8?q?feat:=20=EC=A4=91=EC=B2=A9=20=EB=9D=BC?= =?UTF-8?q?=EC=9A=B0=ED=8C=85=20=EC=A0=81=EC=9A=A9=20=ED=9B=84=20Outlet=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PageLayout/PageLayout.style.tsx | 6 ------ src/Mypage/components/PageLayout/index.tsx | 13 ------------- src/Mypage/page/index.tsx | 7 +++---- 3 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 src/Mypage/components/PageLayout/PageLayout.style.tsx delete mode 100644 src/Mypage/components/PageLayout/index.tsx diff --git a/src/Mypage/components/PageLayout/PageLayout.style.tsx b/src/Mypage/components/PageLayout/PageLayout.style.tsx deleted file mode 100644 index 8535e20f..00000000 --- a/src/Mypage/components/PageLayout/PageLayout.style.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import styled from '@emotion/styled'; - -export const MyPageBodyWrapper = styled.div` - width: 100%; - margin-top: 5.4rem; -`; diff --git a/src/Mypage/components/PageLayout/index.tsx b/src/Mypage/components/PageLayout/index.tsx deleted file mode 100644 index 130ddf99..00000000 --- a/src/Mypage/components/PageLayout/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Outlet } from 'react-router-dom'; - -import * as S from './PageLayout.style'; - -function PageLayout() { - return ( - - - - ); -} - -export default PageLayout; diff --git a/src/Mypage/page/index.tsx b/src/Mypage/page/index.tsx index 52430909..69dcf7dc 100644 --- a/src/Mypage/page/index.tsx +++ b/src/Mypage/page/index.tsx @@ -1,12 +1,11 @@ -import Header from '../../components/common/Header'; -import PageLayout from '../components/PageLayout'; +import { Outlet } from 'react-router-dom'; + import * as S from './Mypage.style'; function Mypage() { return ( -
- + ); } From 8ba7451e639b4bcf982c74ca65156c46e71729f2 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 18:10:14 +0900 Subject: [PATCH 47/99] =?UTF-8?q?feat:=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EB=B3=84=20=ED=97=A4=EB=8D=94=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/page/.gitkeep | 0 src/EditNickname/page/EditNickname.style.ts | 6 ++++++ src/EditNickname/page/index.tsx | 14 ++++++++++++++ src/Enter/page/Enter.style.ts | 14 +++++--------- src/Enter/page/index.tsx | 19 ++++++------------- src/History/page/History.style.ts | 12 +----------- src/History/page/index.tsx | 7 +++---- src/HistoryEnter/page/HistoryEnter.style.ts | 4 +++- src/HistoryEnter/page/index.tsx | 16 +++++++++++----- 9 files changed, 49 insertions(+), 43 deletions(-) delete mode 100644 src/EditNickname/page/.gitkeep create mode 100644 src/EditNickname/page/EditNickname.style.ts create mode 100644 src/EditNickname/page/index.tsx diff --git a/src/EditNickname/page/.gitkeep b/src/EditNickname/page/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/EditNickname/page/EditNickname.style.ts b/src/EditNickname/page/EditNickname.style.ts new file mode 100644 index 00000000..f4f4fed4 --- /dev/null +++ b/src/EditNickname/page/EditNickname.style.ts @@ -0,0 +1,6 @@ +import styled from '@emotion/styled'; + +export const EditNicknameBodyWrapper = styled.div` + width: 100%; + margin-top: 5.4rem; +`; diff --git a/src/EditNickname/page/index.tsx b/src/EditNickname/page/index.tsx new file mode 100644 index 00000000..e9a55641 --- /dev/null +++ b/src/EditNickname/page/index.tsx @@ -0,0 +1,14 @@ +import React from 'react'; + +import Header from '../../components/common/Header'; +import * as S from './EditNickname.style'; + +function EditNickname() { + return ( + +
+ + + ); +} +export default EditNickname; diff --git a/src/Enter/page/Enter.style.ts b/src/Enter/page/Enter.style.ts index f00384e0..366653b8 100644 --- a/src/Enter/page/Enter.style.ts +++ b/src/Enter/page/Enter.style.ts @@ -1,5 +1,10 @@ import styled from '@emotion/styled'; +export const MypageBodyWrapper = styled.div` + width: 100%; + margin-top: 5.4rem; +`; + export const NicknameWrapper = styled.div<{ variant?: string }>` display: flex; justify-content: space-between; @@ -9,15 +14,12 @@ export const NicknameWrapper = styled.div<{ variant?: string }>` padding: 3.2rem 1.6rem 2.9rem; border-bottom: 0.6rem solid ${({ theme }) => theme.colors.LG_2}; - cursor: ${({ variant }) => variant === 'login' && 'pointer'}; `; - export const NicknameText = styled.span` color: ${({ theme }) => theme.colors.BG}; ${({ theme }) => theme.fonts.Head1_B_20}; `; - export const MenuWrapper = styled.div` display: flex; flex-direction: column; @@ -31,7 +33,6 @@ export const Line = styled.div` background-color: ${({ theme }) => theme.colors.LG}; `; - export const Tab = styled.li` display: flex; justify-content: space-between; @@ -40,17 +41,14 @@ export const Tab = styled.li` width: 100%; height: 3.2rem; margin: 0.525rem 0; - cursor: pointer; `; - export const SubTitle = styled.span` padding-bottom: 1em; color: ${({ theme }) => theme.colors.WG}; ${({ theme }) => theme.fonts.Caption2_SB_12}; `; - export const Link = styled.a` display: flex; justify-content: space-between; @@ -59,10 +57,8 @@ export const Link = styled.a` width: 100%; height: 3.2rem; margin: 0.525rem 0; - cursor: pointer; `; - export const Text = styled.span` ${({ theme }) => theme.fonts.Title2_M_16}; color: ${({ theme }) => theme.colors.BG}; diff --git a/src/Enter/page/index.tsx b/src/Enter/page/index.tsx index a97455a7..1b304c44 100644 --- a/src/Enter/page/index.tsx +++ b/src/Enter/page/index.tsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { IcArrowRightGray } from '../../assets'; +import Header from '../../components/common/Header'; import useGetMyNickName from '../../libs/hooks/useGetMyNickname'; import * as S from './Enter.style'; @@ -9,32 +10,28 @@ function Enter() { const [nickname, setNickname] = useState(''); const navigate = useNavigate(); const { state } = useLocation(); - if (state) { const { myNickName } = useGetMyNickName(); if (nickname === '' || nickname !== myNickName) setNickname(myNickName); } - const handleClickNickname = () => { navigate('edit-nickname'); }; - const handleClickHistory = () => { navigate('select-history'); }; - const handleClickLogin = () => { navigate('/login'); }; return ( +
{state ? ( - + {nickname}님, 안녕하세요 - 프로필 @@ -47,7 +44,6 @@ function Enter() { - 서비스 이용 방침 @@ -67,24 +63,21 @@ function Enter() { - 기타 로그아웃 - - + ) : ( - + 로그인하세요 - 서비스 이용 방침 @@ -104,7 +97,7 @@ function Enter() { - + )} ); diff --git a/src/History/page/History.style.ts b/src/History/page/History.style.ts index 5f0b11c9..877ee91f 100644 --- a/src/History/page/History.style.ts +++ b/src/History/page/History.style.ts @@ -1,19 +1,10 @@ import styled from '@emotion/styled'; -export const HistoryPageWrapper = styled.div` - display: flex; - flex-direction: column; - - width: 100vw; - height: 100dvh; - overflow-x: hidden; -`; - export const HistoryPageBodyWrapper = styled.div` + width: 100%; padding: 0 1.6rem; margin-top: 5.4rem; `; - export const HistorySelectButton = styled.button` display: flex; gap: 0.5rem; @@ -21,7 +12,6 @@ export const HistorySelectButton = styled.button` margin: 3.4rem 0 2rem; `; - export const CurrentHistoryOption = styled.h2` padding-top: 0.3rem; diff --git a/src/History/page/index.tsx b/src/History/page/index.tsx index 67dbec61..17fda6c7 100644 --- a/src/History/page/index.tsx +++ b/src/History/page/index.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import React, { useState } from 'react'; import { IcArrowDownBlack } from '../../assets'; import Header from '../../components/common/Header'; @@ -9,13 +9,12 @@ import * as S from './History.style'; function History() { const [modalOn, setModalOn] = useState(false); const [selectedOption, setSelectedOption] = useState(0); - const handleClickHistorySelectButton = () => { setModalOn(true); }; return ( - + {modalOn && ( - + ); } diff --git a/src/HistoryEnter/page/HistoryEnter.style.ts b/src/HistoryEnter/page/HistoryEnter.style.ts index 09a24459..59815928 100644 --- a/src/HistoryEnter/page/HistoryEnter.style.ts +++ b/src/HistoryEnter/page/HistoryEnter.style.ts @@ -1,11 +1,13 @@ import styled from '@emotion/styled'; -export const Wrapper = styled.section` +export const HistoryEnterPageBodyWrapper = styled.section` display: flex; gap: 1.2rem; flex-direction: column; + width: 100%; padding: 2.9rem 1.6rem; + margin-top: 5.4rem; `; export const Tab = styled.li` diff --git a/src/HistoryEnter/page/index.tsx b/src/HistoryEnter/page/index.tsx index 7f4aa152..0dc1a454 100644 --- a/src/HistoryEnter/page/index.tsx +++ b/src/HistoryEnter/page/index.tsx @@ -1,12 +1,18 @@ +import React from 'react'; + +import Header from '../../components/common/Header'; import * as S from './HistoryEnter.style'; function HistoryEnter() { return ( - - 즐겨찾기 한 레큐북 - 내가 만든 레큐북 - 내가 남긴 레큐노트 - + +
+ + 즐겨찾기 한 레큐북 + 내가 만든 레큐북 + 내가 남긴 레큐노트 + + ); } From c3d23c78b848e2ca84bb5bbc1e1e4e707cb200ab Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 21 Mar 2024 18:11:37 +0900 Subject: [PATCH 48/99] =?UTF-8?q?feat:=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=EB=9D=BC?= =?UTF-8?q?=EC=9A=B0=ED=8C=85=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Router.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Router.tsx b/src/Router.tsx index 4177b7fb..a93f5d8f 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -9,6 +9,7 @@ import ErrorPage from './components/common/ErrorPage'; import LoadingPage from './components/common/LoadingPage'; import CreateBook from './CreateBook/page'; import DetailPage from './Detail/page/DetailPage'; +import EditNickname from './EditNickname/page'; import Enter from './Enter/page'; import HealthTest from './HealthTest'; import History from './History/page'; @@ -56,7 +57,7 @@ function Router() { } /> }> } /> - {/* } /> */} + } /> } /> } /> From e124f28ddf89e921a924efa18830ddaa5765d558 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Fri, 22 Mar 2024 11:37:04 +0900 Subject: [PATCH 49/99] =?UTF-8?q?chore:=20=EC=A4=91=EB=B3=B5=20asset=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Enter/page/index.tsx | 22 +++++++++++----------- src/assets/icon/ic_arrow_right_gray.svg | 3 --- src/assets/index.ts | 2 -- 3 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 src/assets/icon/ic_arrow_right_gray.svg diff --git a/src/Enter/page/index.tsx b/src/Enter/page/index.tsx index 1b304c44..d1db5a3e 100644 --- a/src/Enter/page/index.tsx +++ b/src/Enter/page/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { IcArrowRightGray } from '../../assets'; +import { IcMypageArrowRight } from '../../assets'; import Header from '../../components/common/Header'; import useGetMyNickName from '../../libs/hooks/useGetMyNickname'; import * as S from './Enter.style'; @@ -36,11 +36,11 @@ function Enter() { 프로필 닉네임 수정 - + 내 기록보기 - + @@ -48,7 +48,7 @@ function Enter() { 서비스 이용 방침 팀 설명 보기 - + 공지사항 - + 문의하기 - + @@ -68,7 +68,7 @@ function Enter() { 기타 로그아웃 - + @@ -76,13 +76,13 @@ function Enter() { 로그인하세요 - + 서비스 이용 방침 팀 설명 보기 - + 공지사항 - + 문의하기 - + diff --git a/src/assets/icon/ic_arrow_right_gray.svg b/src/assets/icon/ic_arrow_right_gray.svg deleted file mode 100644 index 3bdf199c..00000000 --- a/src/assets/icon/ic_arrow_right_gray.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/index.ts b/src/assets/index.ts index eff578fd..3ad1e9d8 100644 --- a/src/assets/index.ts +++ b/src/assets/index.ts @@ -11,7 +11,6 @@ import IcAlertX from './icon/ic_alert_x.svg?react'; import IcArrowDownBlack from './icon/ic_arrow_down_black.svg?react'; import IcArrowLeftBlack from './icon/ic_arrow_left_black.svg?react'; import IcArrowLeftWhite from './icon/ic_arrow_left_white.svg?react'; -import IcArrowRightGray from './icon/ic_arrow_right_gray.svg?react'; import IcCamera from './icon/ic_camera.svg?react'; import IcCameraSmall from './icon/ic_camera_small.svg?react'; import IcCaution from './icon/ic_caution.svg?react'; @@ -73,7 +72,6 @@ export { IcArrowDownBlack, IcArrowLeftBlack, IcArrowLeftWhite, - IcArrowRightGray, IcCamera, IcCameraSmall, IcCaution, From e0757bb1914e58a383b890c7afe3af3a95f89f61 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Sun, 24 Mar 2024 04:02:12 +0900 Subject: [PATCH 50/99] Merge branch 'SP1/Mypage' of https://github.com/Team-Lequu/Lequu-Client into Mypage/#265-switch-modal --- src/EditNickname/api/.gitkeep | 0 src/EditNickname/components/.gitkeep | 0 .../components/EditButton/EditButton.style.ts | 0 .../components/EditButton/index.tsx | 16 ++++++++ .../NicknameInput/NicknameInput.style.ts | 38 +++++++++++++++++++ .../components/NicknameInput/index.tsx | 33 ++++++++++++++++ src/EditNickname/constants/.gitkeep | 0 src/EditNickname/hooks/.gitkeep | 0 src/EditNickname/page/EditNickname.style.ts | 18 +++++++++ src/EditNickname/page/index.tsx | 26 +++++++++++++ 10 files changed, 131 insertions(+) create mode 100644 src/EditNickname/api/.gitkeep create mode 100644 src/EditNickname/components/.gitkeep create mode 100644 src/EditNickname/components/EditButton/EditButton.style.ts create mode 100644 src/EditNickname/components/EditButton/index.tsx create mode 100644 src/EditNickname/components/NicknameInput/NicknameInput.style.ts create mode 100644 src/EditNickname/components/NicknameInput/index.tsx create mode 100644 src/EditNickname/constants/.gitkeep create mode 100644 src/EditNickname/hooks/.gitkeep create mode 100644 src/EditNickname/page/EditNickname.style.ts create mode 100644 src/EditNickname/page/index.tsx diff --git a/src/EditNickname/api/.gitkeep b/src/EditNickname/api/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/components/.gitkeep b/src/EditNickname/components/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/components/EditButton/EditButton.style.ts b/src/EditNickname/components/EditButton/EditButton.style.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/components/EditButton/index.tsx b/src/EditNickname/components/EditButton/index.tsx new file mode 100644 index 00000000..ec147d08 --- /dev/null +++ b/src/EditNickname/components/EditButton/index.tsx @@ -0,0 +1,16 @@ +import Button from '../../../components/common/Button'; + +interface EditButtonProps { + isActive: boolean; + onClick: () => void; +} + +function EditButton({ isActive, onClick }: EditButtonProps) { + return ( + + ); +} + +export default EditButton; diff --git a/src/EditNickname/components/NicknameInput/NicknameInput.style.ts b/src/EditNickname/components/NicknameInput/NicknameInput.style.ts new file mode 100644 index 00000000..e0b77318 --- /dev/null +++ b/src/EditNickname/components/NicknameInput/NicknameInput.style.ts @@ -0,0 +1,38 @@ +import styled from '@emotion/styled'; + +export const NicknameInputWrapper = styled.section` + display: flex; + align-items: center; + flex-direction: column; + + width: 100%; + margin-top: 1.2rem; +`; + +export const InputContainer = styled.div<{ isEmpty: boolean }>` + display: flex; + justify-content: space-between; + align-items: center; + + width: 100%; + padding: 1.55rem 2rem; + + ${({ theme }) => theme.fonts.Body3_R_14}; + + border: 0.1rem solid + ${({ theme, isEmpty }) => (isEmpty ? theme.colors.LG : theme.colors.BG)}; + border-radius: 0.8rem; + background-color: ${({ theme }) => theme.colors.white}; +`; + +export const Input = styled.input` + width: 100%; + + color: ${({ theme }) => theme.colors.BG}; + ${({ theme }) => theme.fonts.Body2_M_14}; +`; + +export const WordCount = styled.p` + color: ${({ theme }) => theme.colors.WG}; + ${({ theme }) => theme.fonts.E_Body2_R_14}; +`; diff --git a/src/EditNickname/components/NicknameInput/index.tsx b/src/EditNickname/components/NicknameInput/index.tsx new file mode 100644 index 00000000..1b9fd24e --- /dev/null +++ b/src/EditNickname/components/NicknameInput/index.tsx @@ -0,0 +1,33 @@ +import EditButton from '../EditButton'; +import * as S from './NicknameInput.style'; + +interface NicknameInputProps { + nickname: string; + changeNickname: (nickname: string) => void; +} + +const handleClickEditButton = () => {}; + +function NicknameInput({ nickname, changeNickname }: NicknameInputProps) { + const handleChangeInput = (e: React.ChangeEvent) => { + if (e.target.value.length <= 8) { + changeNickname(e.target.value); + } + }; + return ( + + + + ({nickname.length}/8) + + + + ); +} + +export default NicknameInput; diff --git a/src/EditNickname/constants/.gitkeep b/src/EditNickname/constants/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/hooks/.gitkeep b/src/EditNickname/hooks/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/EditNickname/page/EditNickname.style.ts b/src/EditNickname/page/EditNickname.style.ts new file mode 100644 index 00000000..7244cdbe --- /dev/null +++ b/src/EditNickname/page/EditNickname.style.ts @@ -0,0 +1,18 @@ +import styled from '@emotion/styled'; + +export const EditNicknameBodyWrapper = styled.div` + width: 100%; + padding: 0 1.6rem; + margin-top: 5.4rem; +`; + +export const NicknameInputSection = styled.section` + width: 100%; + margin-top: 3.4rem; +`; + +export const NicknameInputSectionTitle = styled.h2` + color: ${({ theme }) => theme.colors.BG}; + + ${({ theme }) => theme.fonts.Head2_SB_18} +`; diff --git a/src/EditNickname/page/index.tsx b/src/EditNickname/page/index.tsx new file mode 100644 index 00000000..84d326b3 --- /dev/null +++ b/src/EditNickname/page/index.tsx @@ -0,0 +1,26 @@ +import React, { useState } from 'react'; + +import Header from '../../components/common/Header'; +import NicknameInput from '../components/NicknameInput'; +import * as S from './EditNickname.style'; + +function EditNickname() { + const [nickname, setNickname] = useState('테스트테스트'); + + return ( + +
+ + + 나의 닉네임 + setNickname(nickname)} + /> + + + + ); +} + +export default EditNickname; From 6dd5f3aa8f711b984711c8668e98cd5990302814 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Mon, 25 Mar 2024 18:41:30 +0900 Subject: [PATCH 51/99] =?UTF-8?q?feat:=20MyFavoriteBook=20=ED=8D=BC?= =?UTF-8?q?=EB=B8=94=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MyFavoriteBook/.gitkeep | 0 .../MyFavoriteBook/MyFavoriteBook.style.ts | 30 ++++++++++++++++ .../components/MyFavoriteBook/index.tsx | 35 +++++++++++++++++++ 3 files changed, 65 insertions(+) delete mode 100644 src/History/components/MyFavoriteBook/.gitkeep create mode 100644 src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts create mode 100644 src/History/components/MyFavoriteBook/index.tsx diff --git a/src/History/components/MyFavoriteBook/.gitkeep b/src/History/components/MyFavoriteBook/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts b/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts new file mode 100644 index 00000000..ee4169bc --- /dev/null +++ b/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts @@ -0,0 +1,30 @@ +import styled from '@emotion/styled'; + +export const MyFavoriteBookWrapper = styled.div` + display: flex; + gap: 1rem; + align-items: center; + flex-direction: column; + + width: 9.8rem; + height: 14.4rem; +`; + +export const FavoriteButton = styled.button` + display: absolute; +`; + +export const BookImage = styled.div` + position: relative; + + width: 9.8rem; + height: 9.8rem; + + border-radius: 5rem; + background-color: black; +`; + +export const Title = styled.h1` + color: ${({ theme }) => theme.colors.BG} + ${({ theme }) => theme.fonts.E_Body1_SB_14}; +`; diff --git a/src/History/components/MyFavoriteBook/index.tsx b/src/History/components/MyFavoriteBook/index.tsx new file mode 100644 index 00000000..3d2ccddf --- /dev/null +++ b/src/History/components/MyFavoriteBook/index.tsx @@ -0,0 +1,35 @@ +import React from 'react'; + +import { IcHomeFavoriteEmpty } from '../../../assets'; +import * as S from './MyFavoriteBook.style'; + +function MyFavoriteBook() { + const handleClickFavoriteBtn = ( + event: React.MouseEvent, + ) => { + event.stopPropagation(); + console.log('favorite'); + }; + + const handleClickBook = () => { + console.log('book'); + }; + + return ( + + + handleClickBook()}> + handleClickFavoriteBtn(e)} + > + + + + SOPT + + + ); +} + +export default MyFavoriteBook; From f94b8c90e7f39f4e8f5b6a99c4fb5d0d2c555a44 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 26 Mar 2024 09:06:36 +0900 Subject: [PATCH 52/99] =?UTF-8?q?chore:=20.gitkeep=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/api/.gitkeep | 0 src/EditNickname/hooks/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/EditNickname/api/.gitkeep delete mode 100644 src/EditNickname/hooks/.gitkeep diff --git a/src/EditNickname/api/.gitkeep b/src/EditNickname/api/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/EditNickname/hooks/.gitkeep b/src/EditNickname/hooks/.gitkeep deleted file mode 100644 index e69de29b..00000000 From f0012d6299bfcd104634902e77a73990c34a36d2 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 26 Mar 2024 09:07:00 +0900 Subject: [PATCH 53/99] =?UTF-8?q?chore:=20.gitkeep=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/components/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/EditNickname/components/.gitkeep diff --git a/src/EditNickname/components/.gitkeep b/src/EditNickname/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 From b1b22fc0c6260ca47b8f5fdc1a87dfb6f6c62dbe Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 26 Mar 2024 09:08:48 +0900 Subject: [PATCH 54/99] =?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=EB=A1=9C=20nav?= =?UTF-8?q?igate=EC=8B=9C=20JWT=20=ED=86=A0=ED=81=B0=20state=EB=A1=9C=20?= =?UTF-8?q?=EC=A0=84=EB=8B=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Enter/page/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Enter/page/index.tsx b/src/Enter/page/index.tsx index d1db5a3e..8189805d 100644 --- a/src/Enter/page/index.tsx +++ b/src/Enter/page/index.tsx @@ -14,8 +14,9 @@ function Enter() { const { myNickName } = useGetMyNickName(); if (nickname === '' || nickname !== myNickName) setNickname(myNickName); } + const handleClickNickname = () => { - navigate('edit-nickname'); + navigate('edit-nickname', { state: state }); }; const handleClickHistory = () => { navigate('select-history'); From 53cf78e728274b449828674ed6e58502ae92f33d Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 26 Mar 2024 09:13:33 +0900 Subject: [PATCH 55/99] =?UTF-8?q?feat:=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=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/api/patchNickname.ts | 16 ++++++ .../components/EditButton/EditButton.style.ts | 11 ++++ .../components/EditButton/index.tsx | 42 ++++++++++++--- .../NicknameInput/NicknameInput.style.ts | 25 +++++++-- .../components/NicknameInput/index.tsx | 54 +++++++++++++------ src/EditNickname/hooks/usePatchNickname.ts | 47 ++++++++++++++++ src/EditNickname/page/EditNickname.style.ts | 5 ++ src/EditNickname/page/index.tsx | 44 +++++++++++++-- src/EditNickname/types/editNicknameTypes.ts | 41 ++++++++++++++ src/EditNickname/utils/checkInputRange.ts | 7 +++ src/EditNickname/utils/handleCheckInput.ts | 36 +++++++++++++ 11 files changed, 299 insertions(+), 29 deletions(-) create mode 100644 src/EditNickname/api/patchNickname.ts create mode 100644 src/EditNickname/hooks/usePatchNickname.ts create mode 100644 src/EditNickname/types/editNicknameTypes.ts create mode 100644 src/EditNickname/utils/checkInputRange.ts create mode 100644 src/EditNickname/utils/handleCheckInput.ts diff --git a/src/EditNickname/api/patchNickname.ts b/src/EditNickname/api/patchNickname.ts new file mode 100644 index 00000000..08dd9ca3 --- /dev/null +++ b/src/EditNickname/api/patchNickname.ts @@ -0,0 +1,16 @@ +import { api } from '../../libs/api'; + +export const patchNickname = async (token: string, nickname: string) => { + const response = await api.patch( + '/api/nickname', + { nickname: nickname }, + { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + }, + ); + + return { code: response.data.code }; +}; diff --git a/src/EditNickname/components/EditButton/EditButton.style.ts b/src/EditNickname/components/EditButton/EditButton.style.ts index e69de29b..1ded588b 100644 --- a/src/EditNickname/components/EditButton/EditButton.style.ts +++ b/src/EditNickname/components/EditButton/EditButton.style.ts @@ -0,0 +1,11 @@ +import styled from '@emotion/styled'; + +export const ButtonWrapper = styled.section` + display: flex; + justify-content: center; + align-items: end; + + width: 100%; + height: calc(100% - 12.1rem); + margin-bottom: 2rem; +`; diff --git a/src/EditNickname/components/EditButton/index.tsx b/src/EditNickname/components/EditButton/index.tsx index ec147d08..5182448d 100644 --- a/src/EditNickname/components/EditButton/index.tsx +++ b/src/EditNickname/components/EditButton/index.tsx @@ -1,15 +1,41 @@ import Button from '../../../components/common/Button'; +import usePatchNickname from '../../hooks/usePatchNickname'; +import { EditButtonProps } from '../../types/editNicknameTypes'; +import * as S from './EditButton.style'; -interface EditButtonProps { - isActive: boolean; - onClick: () => void; -} +function EditButton({ + isActive, + token, + nickname, + handleSetIsValid, + handleSetIsActive, +}: EditButtonProps) { + const patchMutation = usePatchNickname({ + handleSetIsValid, + handleSetIsActive, + token, + nickname, + }); + + const handelClickSubmitBtn = (token: string, nickname: string) => { + const patchNickname = nickname.trim(); + + patchMutation.mutate({ + nickname: patchNickname, + token: token, + }); + }; -function EditButton({ isActive, onClick }: EditButtonProps) { return ( - + + + ); } diff --git a/src/EditNickname/components/NicknameInput/NicknameInput.style.ts b/src/EditNickname/components/NicknameInput/NicknameInput.style.ts index e0b77318..44da9982 100644 --- a/src/EditNickname/components/NicknameInput/NicknameInput.style.ts +++ b/src/EditNickname/components/NicknameInput/NicknameInput.style.ts @@ -9,18 +9,29 @@ export const NicknameInputWrapper = styled.section` margin-top: 1.2rem; `; -export const InputContainer = styled.div<{ isEmpty: boolean }>` +export const InputContainer = styled.div<{ + isEmpty: boolean; + isValid: string; +}>` display: flex; + gap: 1.6rem; justify-content: space-between; align-items: center; width: 100%; - padding: 1.55rem 2rem; + padding: 1.9rem 2rem; ${({ theme }) => theme.fonts.Body3_R_14}; border: 0.1rem solid - ${({ theme, isEmpty }) => (isEmpty ? theme.colors.LG : theme.colors.BG)}; + ${({ theme, isEmpty, isValid }) => + isValid === 'unchanged' + ? theme.colors.LG + : isValid !== 'valid' + ? theme.colors.red + : isEmpty + ? theme.colors.LG + : theme.colors.BG}; border-radius: 0.8rem; background-color: ${({ theme }) => theme.colors.white}; `; @@ -36,3 +47,11 @@ export const WordCount = styled.p` color: ${({ theme }) => theme.colors.WG}; ${({ theme }) => theme.fonts.E_Body2_R_14}; `; + +export const WarnigMsg = styled.p` + width: 100%; + padding-top: 0.9rem; + + ${({ theme }) => theme.fonts.Caption1_R_12}; + color: ${({ theme }) => theme.colors.red}; +`; diff --git a/src/EditNickname/components/NicknameInput/index.tsx b/src/EditNickname/components/NicknameInput/index.tsx index 1b9fd24e..e71bd803 100644 --- a/src/EditNickname/components/NicknameInput/index.tsx +++ b/src/EditNickname/components/NicknameInput/index.tsx @@ -1,31 +1,55 @@ -import EditButton from '../EditButton'; -import * as S from './NicknameInput.style'; +import { useEffect, useState } from 'react'; -interface NicknameInputProps { - nickname: string; - changeNickname: (nickname: string) => void; -} +import { NicknameInputProps } from '../../types/editNicknameTypes'; +import handleChangeInput from '../../utils/handleCheckInput'; +import * as S from './NicknameInput.style'; -const handleClickEditButton = () => {}; +function NicknameInput({ + nickname, + isValid, + handleSetNickname, + handleSetIsActive, + handleSetIsValid, +}: NicknameInputProps) { + const [wordCnt, setWordCnt] = useState(0); + const currentNickname: string = localStorage.getItem('nickname') || ''; -function NicknameInput({ nickname, changeNickname }: NicknameInputProps) { - const handleChangeInput = (e: React.ChangeEvent) => { - if (e.target.value.length <= 8) { - changeNickname(e.target.value); - } + const handleSetWordCnt = (wordCnt: number) => { + setWordCnt(wordCnt); }; + + useEffect(() => { + wordCnt >= 2 ? handleSetIsActive(true) : handleSetIsActive(false); + }, [wordCnt]); + return ( - + { + handleChangeInput({ + handleSetNickname, + handleSetWordCnt, + handleSetIsValid, + currentNickname, + e, + }); + }} /> ({nickname.length}/8) - + {isValid === 'special' ? ( + 특수문자/이모지는 사용 불가능해요 + ) : isValid === 'duplicate' ? ( + 이미 있는 닉네임이에요 + ) : ( + isValid === 'space' && ( + 마지막 공백 제외 2자 이상 입력해주세요 + ) + )} ); } diff --git a/src/EditNickname/hooks/usePatchNickname.ts b/src/EditNickname/hooks/usePatchNickname.ts new file mode 100644 index 00000000..c3815c64 --- /dev/null +++ b/src/EditNickname/hooks/usePatchNickname.ts @@ -0,0 +1,47 @@ +import { AxiosError } from 'axios'; +import { useMutation } from 'react-query'; +import { useNavigate } from 'react-router-dom'; + +import { patchNickname } from '../api/patchNickname'; +import { + patchNicknameProps, + usePatchNicknameProps, +} from '../types/editNicknameTypes'; + +const usePatchNickname = (props: usePatchNicknameProps) => { + const { handleSetIsValid, handleSetIsActive, token, nickname } = props; + + const navigate = useNavigate(); + + const mutation = useMutation({ + mutationFn: async ({ token, nickname }: patchNicknameProps) => { + return await patchNickname(token, nickname); + }, + onError: (err: AxiosError) => { + const code = err.response?.status; + if (code === 409) { + // 닉네임 중복코드 : 409 + handleSetIsValid('duplicate'); + handleSetIsActive(false); + } else if (code === 400) { + handleSetIsValid('space'); + handleSetIsActive(false); + } else { + navigate('/error'); + } + }, + onSuccess: () => { + window.localStorage.setItem('token', token); + window.localStorage.setItem('nickname', nickname); + if (sessionStorage.getItem('url') === '') { + navigate('/', { state: { step: 1 } }); + } else { + navigate(-4); + } + }, + }); + + return mutation; +}; + +export default usePatchNickname; diff --git a/src/EditNickname/page/EditNickname.style.ts b/src/EditNickname/page/EditNickname.style.ts index 7244cdbe..bbb446a2 100644 --- a/src/EditNickname/page/EditNickname.style.ts +++ b/src/EditNickname/page/EditNickname.style.ts @@ -1,7 +1,12 @@ import styled from '@emotion/styled'; export const EditNicknameBodyWrapper = styled.div` + display: flex; + align-items: center; + flex-direction: column; + width: 100%; + height: calc(100dvh - 5.4rem); padding: 0 1.6rem; margin-top: 5.4rem; `; diff --git a/src/EditNickname/page/index.tsx b/src/EditNickname/page/index.tsx index 84d326b3..991d8126 100644 --- a/src/EditNickname/page/index.tsx +++ b/src/EditNickname/page/index.tsx @@ -1,11 +1,38 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; +import { useLocation } from 'react-router-dom'; import Header from '../../components/common/Header'; +import EditButton from '../components/EditButton'; import NicknameInput from '../components/NicknameInput'; +import { isValidState } from '../types/editNicknameTypes'; import * as S from './EditNickname.style'; function EditNickname() { - const [nickname, setNickname] = useState('테스트테스트'); + const [isActive, setIsActive] = useState(false); + const [nickname, setNickname] = useState( + localStorage.getItem('nickname') || '', + ); + const [isValid, setIsValid] = useState('unchanged'); + + const { state } = useLocation(); + + const handleSetNickname = (nickname: string) => { + setNickname(nickname); + }; + + const handleSetIsValid = (isValid: isValidState) => { + setIsValid(isValid); + }; + + const handleSetIsActive = (isActive: boolean) => { + setIsActive(isActive); + }; + + useEffect(() => { + if (nickname === localStorage.getItem('nickname')) { + handleSetIsActive(false); + } + }, [nickname]); return ( @@ -14,10 +41,21 @@ function EditNickname() { 나의 닉네임 setNickname(nickname)} + handleSetNickname={handleSetNickname} + isValid={isValid} + handleSetIsValid={handleSetIsValid} /> + ); diff --git a/src/EditNickname/types/editNicknameTypes.ts b/src/EditNickname/types/editNicknameTypes.ts new file mode 100644 index 00000000..f41f4372 --- /dev/null +++ b/src/EditNickname/types/editNicknameTypes.ts @@ -0,0 +1,41 @@ +export type isValidState = + | 'valid' + | 'special' + | 'duplicate' + | 'space' + | 'unchanged'; + +export interface NicknameInputProps { + nickname: string; + isValid: string; + handleSetNickname: (nickname: string) => void; + handleSetIsActive: (isActive: boolean) => void; + handleSetIsValid: (isValid: isValidState) => void; +} + +export interface EditButtonProps { + token: string; + nickname: string; + isActive: boolean; + isValid: string; + handleSetIsValid: (isValid: isValidState) => void; + handleSetIsActive: (isActive: boolean) => void; +} + +export interface CheckNicknameProps { + handleSetNickname: (nickname: string) => void; + handleSetWordCnt: (wordCnt: number) => void; + handleSetIsValid: (isValid: isValidState) => void; + currentNickname: string; + e: React.ChangeEvent; +} + +export interface patchNicknameProps { + token: string; + nickname: string; +} + +export interface usePatchNicknameProps extends patchNicknameProps { + handleSetIsActive: (isActive: boolean) => void; + handleSetIsValid: (isValid: isValidState) => void; +} diff --git a/src/EditNickname/utils/checkInputRange.ts b/src/EditNickname/utils/checkInputRange.ts new file mode 100644 index 00000000..ae995c51 --- /dev/null +++ b/src/EditNickname/utils/checkInputRange.ts @@ -0,0 +1,7 @@ +/** 영어, 숫자, 문자, 공백인지 체크하는 정규식 함수 */ +const checkInputRange = (str: string) => { + const regExp = /[ㄱ-ㅎㅏ-ㅣ가-힣0-9a-zA-Z\s]/g; + return regExp.test(str) || str.length === 0; +}; + +export default checkInputRange; diff --git a/src/EditNickname/utils/handleCheckInput.ts b/src/EditNickname/utils/handleCheckInput.ts new file mode 100644 index 00000000..b1d2334e --- /dev/null +++ b/src/EditNickname/utils/handleCheckInput.ts @@ -0,0 +1,36 @@ +import { CheckNicknameProps } from '../types/editNicknameTypes'; +import checkInputRange from './checkInputRange'; + +/** 8자 이하 & 한글, 영어, 숫자만 입력 가능하도록 & 첫번째 글자는 공백 불가능 체크 함수*/ +const handleChangeInput = (props: CheckNicknameProps) => { + const { + handleSetNickname, + handleSetWordCnt, + handleSetIsValid, + currentNickname, + e, + } = props; + + const input = e.target.value; + + if (e.target.value.length <= 8 && checkInputRange(input[input.length - 1])) { + if (e.target.value === ' ') { + handleSetNickname(''); + handleSetWordCnt(0); + } else { + handleSetNickname(e.target.value); + handleSetWordCnt(e.target.value.length); + } + if (e.target.value === currentNickname) { + handleSetIsValid('unchanged'); + } else { + handleSetIsValid('valid'); + } + } else { + e.target.value.length > 8 + ? handleSetIsValid('valid') + : handleSetIsValid('special'); + } +}; + +export default handleChangeInput; From a7387bb6c93d9311c6d3be0c3d9b7b8cdedef66d Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Tue, 26 Mar 2024 09:51:56 +0900 Subject: [PATCH 56/99] =?UTF-8?q?fix:=20=EB=8B=89=EB=84=A4=EC=9E=84=20?= =?UTF-8?q?=EB=8F=99=EC=9D=BC=20=EC=97=AC=EB=B6=80=20=EB=B9=84=EA=B5=90?= =?UTF-8?q?=EB=AC=B8=EC=97=90=20else=EB=AC=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/page/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EditNickname/page/index.tsx b/src/EditNickname/page/index.tsx index 991d8126..2d764560 100644 --- a/src/EditNickname/page/index.tsx +++ b/src/EditNickname/page/index.tsx @@ -31,6 +31,8 @@ function EditNickname() { useEffect(() => { if (nickname === localStorage.getItem('nickname')) { handleSetIsActive(false); + } else { + handleSetIsActive(true); } }, [nickname]); From 674321d8934d7eabe3e76b795fb1c71724fd80a6 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Tue, 26 Mar 2024 23:15:15 +0900 Subject: [PATCH 57/99] =?UTF-8?q?feat:=20MyFavoriteBookList=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=8D=BC=EB=B8=94=EB=A6=AC?= =?UTF-8?q?=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MyFavoriteBookList/.gitkeep | 0 .../MyFavoriteBookList.style.ts | 8 +++++ .../components/MyFavoriteBookList/index.tsx | 29 +++++++++++++++++++ 3 files changed, 37 insertions(+) delete mode 100644 src/History/components/MyFavoriteBookList/.gitkeep create mode 100644 src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts create mode 100644 src/History/components/MyFavoriteBookList/index.tsx diff --git a/src/History/components/MyFavoriteBookList/.gitkeep b/src/History/components/MyFavoriteBookList/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts b/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts new file mode 100644 index 00000000..2cc7db30 --- /dev/null +++ b/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts @@ -0,0 +1,8 @@ +import styled from '@emotion/styled'; + +export const MyFavoriteBookListWrapper = styled.section` + display: grid; + gap: 2rem; + grid-template-columns: 1fr 1fr 1fr; + justify-items: center; +`; diff --git a/src/History/components/MyFavoriteBookList/index.tsx b/src/History/components/MyFavoriteBookList/index.tsx new file mode 100644 index 00000000..b95b31c3 --- /dev/null +++ b/src/History/components/MyFavoriteBookList/index.tsx @@ -0,0 +1,29 @@ +import useGetFavorite from '../../../libs/hooks/useGetFavorite'; +import MyFavoriteBook from '../MyFavoriteBook'; +import * as S from './MyFavoriteBookList.style'; + +function MyFavoriteBookList() { + const { data } = useGetFavorite(); + + return ( + + + + + + + + + + + + + + + + + + ); +} + +export default MyFavoriteBookList; From 618f204474f4a8c88a6681878d66335669cfabdd Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 27 Mar 2024 02:08:45 +0900 Subject: [PATCH 58/99] =?UTF-8?q?feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A6=90=EA=B2=A8=EC=B0=BE=EA=B8=B0=20GET?= =?UTF-8?q?=20api=20=EB=B6=99=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/api/getMyFavorite.ts | 13 +++++++++++++ src/History/hooks/useGetMyFavorite.ts | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/History/api/getMyFavorite.ts create mode 100644 src/History/hooks/useGetMyFavorite.ts diff --git a/src/History/api/getMyFavorite.ts b/src/History/api/getMyFavorite.ts new file mode 100644 index 00000000..8c6d3a84 --- /dev/null +++ b/src/History/api/getMyFavorite.ts @@ -0,0 +1,13 @@ +import { api } from '../../libs/api'; + +export async function getMyFavorite() { + const token = localStorage.getItem('token'); + const data = await api.get(`/api/mypage/favorite`, { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + }); + + return data.data.data; +} diff --git a/src/History/hooks/useGetMyFavorite.ts b/src/History/hooks/useGetMyFavorite.ts new file mode 100644 index 00000000..6d58cbec --- /dev/null +++ b/src/History/hooks/useGetMyFavorite.ts @@ -0,0 +1,20 @@ +import { useQuery } from 'react-query'; +import { useNavigate } from 'react-router-dom'; + +import { getMyFavorite } from '../api/getMyFavorite'; + +export default function useGetMyFavorite() { + const navigate = useNavigate(); + const { data: myFavoriteList, isLoading } = useQuery( + ['useGetMyFavorite'], + () => getMyFavorite(), + { + onError: () => { + navigate('/error'); + }, + refetchOnWindowFocus: false, + }, + ); + + return { myFavoriteList, isLoading }; +} From cc4e606af71f65bea1f29620067a6cd154f9e992 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 27 Mar 2024 02:09:13 +0900 Subject: [PATCH 59/99] =?UTF-8?q?feat:=20FavoriteBook=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20Type=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/types/historyType.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/History/types/historyType.ts b/src/History/types/historyType.ts index b55fa932..8b5b6fed 100644 --- a/src/History/types/historyType.ts +++ b/src/History/types/historyType.ts @@ -11,3 +11,14 @@ export interface LecueBookType { export interface LecueBookProps extends LecueBookType { key: number; } + +export interface FavoriteBookType { + bookId: number; + bookUuid: string; + favoriteImage: string; + favoriteName: string; +} + +export interface FavoriteBookProps extends FavoriteBookType { + key: number; +} From b6728a7d49d24cd1f00dadad6bdc7cc94a3cbfad Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 27 Mar 2024 02:20:22 +0900 Subject: [PATCH 60/99] =?UTF-8?q?feat:=20api=20=EB=B6=99=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFavoriteBook/MyFavoriteBook.style.ts | 24 ++++++---- .../components/MyFavoriteBook/index.tsx | 45 +++++++++++-------- .../components/MyFavoriteBookList/index.tsx | 35 ++++++++------- 3 files changed, 61 insertions(+), 43 deletions(-) diff --git a/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts b/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts index ee4169bc..872691ff 100644 --- a/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts +++ b/src/History/components/MyFavoriteBook/MyFavoriteBook.style.ts @@ -5,26 +5,34 @@ export const MyFavoriteBookWrapper = styled.div` gap: 1rem; align-items: center; flex-direction: column; + position: relative; width: 9.8rem; height: 14.4rem; `; export const FavoriteButton = styled.button` - display: absolute; + position: absolute; + left: 0.2rem; `; -export const BookImage = styled.div` - position: relative; - +export const BookImage = styled.img` width: 9.8rem; height: 9.8rem; - border-radius: 5rem; - background-color: black; + border-radius: 50%; + + object-fit: cover; `; export const Title = styled.h1` - color: ${({ theme }) => theme.colors.BG} - ${({ theme }) => theme.fonts.E_Body1_SB_14}; + width: 100%; + + color: ${({ theme }) => theme.colors.BG}; + + text-align: center; + word-wrap: normal; + word-break: break-all; + + ${({ theme }) => theme.fonts.E_Body1_SB_14}; `; diff --git a/src/History/components/MyFavoriteBook/index.tsx b/src/History/components/MyFavoriteBook/index.tsx index 3d2ccddf..9b83f06e 100644 --- a/src/History/components/MyFavoriteBook/index.tsx +++ b/src/History/components/MyFavoriteBook/index.tsx @@ -1,32 +1,41 @@ import React from 'react'; +import { useNavigate } from 'react-router-dom'; -import { IcHomeFavoriteEmpty } from '../../../assets'; +import { IcHomeFavoriteFilled } from '../../../assets'; +import useDeleteFavorite from '../../../libs/hooks/useDeleteFavorite'; +import { FavoriteBookProps } from '../../types/historyType'; import * as S from './MyFavoriteBook.style'; -function MyFavoriteBook() { - const handleClickFavoriteBtn = ( - event: React.MouseEvent, - ) => { - event.stopPropagation(); - console.log('favorite'); +function MyFavoriteBook(props: FavoriteBookProps) { + const { bookId, bookUuid, favoriteImage, favoriteName } = props; + + const navigate = useNavigate(); + const deleteMutation = useDeleteFavorite(); + + const handleClickFavoriteBtn = (bookId: number) => { + deleteMutation.mutate(bookId); }; - const handleClickBook = () => { - console.log('book'); + const handleClickBook = (bookUuid: string) => { + navigate(`/lecue-book/${bookUuid}`); }; return ( - handleClickBook()}> - handleClickFavoriteBtn(e)} - > - - - - SOPT + handleClickBook(bookUuid)} + /> + handleClickFavoriteBtn(bookId)} + > + + + + {favoriteName} ); diff --git a/src/History/components/MyFavoriteBookList/index.tsx b/src/History/components/MyFavoriteBookList/index.tsx index b95b31c3..6f580de0 100644 --- a/src/History/components/MyFavoriteBookList/index.tsx +++ b/src/History/components/MyFavoriteBookList/index.tsx @@ -1,27 +1,28 @@ -import useGetFavorite from '../../../libs/hooks/useGetFavorite'; +import useGetMyFavorite from '../../hooks/useGetMyFavorite'; +import { FavoriteBookProps } from '../../types/historyType'; import MyFavoriteBook from '../MyFavoriteBook'; import * as S from './MyFavoriteBookList.style'; function MyFavoriteBookList() { - const { data } = useGetFavorite(); + const { myFavoriteList } = useGetMyFavorite(); return ( - - - - - - - - - - - - - - - + {myFavoriteList && myFavoriteList.length !== 0 ? ( + myFavoriteList.map((book: FavoriteBookProps) => { + return ( + + ); + }) + ) : ( +
0개입니당 ㅋㅋ
+ )}
); } From 5ac06ebbd5c8e30058413ce7604087dad9161151 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 27 Mar 2024 22:04:22 +0900 Subject: [PATCH 61/99] =?UTF-8?q?feat:=20=EC=A6=90=EA=B2=A8=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0=20=ED=95=B4=EC=A0=9C=20=EC=8B=9C=20=EB=B0=94=EB=A1=9C?= =?UTF-8?q?=20=EB=B0=98=EC=98=81=EB=90=98=EB=8F=84=EB=A1=9D=20query=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/History/components/MyFavoriteBook/index.tsx | 2 +- src/History/hooks/useGetMyFavorite.ts | 2 +- src/Home/components/LecueBookList/index.tsx | 2 +- src/libs/hooks/useDeleteFavorite.ts | 10 ++++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/History/components/MyFavoriteBook/index.tsx b/src/History/components/MyFavoriteBook/index.tsx index 9b83f06e..0e021aa2 100644 --- a/src/History/components/MyFavoriteBook/index.tsx +++ b/src/History/components/MyFavoriteBook/index.tsx @@ -10,7 +10,7 @@ function MyFavoriteBook(props: FavoriteBookProps) { const { bookId, bookUuid, favoriteImage, favoriteName } = props; const navigate = useNavigate(); - const deleteMutation = useDeleteFavorite(); + const deleteMutation = useDeleteFavorite('mypage'); const handleClickFavoriteBtn = (bookId: number) => { deleteMutation.mutate(bookId); diff --git a/src/History/hooks/useGetMyFavorite.ts b/src/History/hooks/useGetMyFavorite.ts index 6d58cbec..2772cb45 100644 --- a/src/History/hooks/useGetMyFavorite.ts +++ b/src/History/hooks/useGetMyFavorite.ts @@ -6,7 +6,7 @@ import { getMyFavorite } from '../api/getMyFavorite'; export default function useGetMyFavorite() { const navigate = useNavigate(); const { data: myFavoriteList, isLoading } = useQuery( - ['useGetMyFavorite'], + ['get-my-favorite'], () => getMyFavorite(), { onError: () => { diff --git a/src/Home/components/LecueBookList/index.tsx b/src/Home/components/LecueBookList/index.tsx index 4eda671e..3835d3a7 100644 --- a/src/Home/components/LecueBookList/index.tsx +++ b/src/Home/components/LecueBookList/index.tsx @@ -20,7 +20,7 @@ interface LecueBookListProps { function LecueBookList({ title }: LecueBookListProps) { const navigate = useNavigate(); - const deleteMutation = useDeleteFavorite(); + const deleteMutation = useDeleteFavorite('home'); const isBookmark = title.includes('즐겨찾기'); const { data } = isBookmark ? useGetFavorite() : useGetLecueBook(); diff --git a/src/libs/hooks/useDeleteFavorite.ts b/src/libs/hooks/useDeleteFavorite.ts index 81a364e1..d1bd9c8f 100644 --- a/src/libs/hooks/useDeleteFavorite.ts +++ b/src/libs/hooks/useDeleteFavorite.ts @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom'; import deleteFavorite from '../api/deleteFavorite'; -const useDeleteFavorite = () => { +const useDeleteFavorite = (state: string) => { const navigate = useNavigate(); const queryClient = useQueryClient(); const mutation = useMutation({ @@ -12,7 +12,13 @@ const useDeleteFavorite = () => { }, onError: () => navigate('/error'), onSuccess: () => { - queryClient.refetchQueries(['get-favorite'], { exact: true }); + state === 'home' + ? queryClient.refetchQueries(['get-favorite'], { + exact: true, + }) + : queryClient.refetchQueries(['get-my-favorite'], { + exact: true, + }); }, }); return mutation; From d3c82d82b84b3a9e59cbb4b4723c2cf58e540973 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Wed, 27 Mar 2024 23:47:03 +0900 Subject: [PATCH 62/99] =?UTF-8?q?chore:=20queryKey=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/History/hooks/useGetMyFavorite.ts | 2 +- src/libs/hooks/useDeleteFavorite.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/History/hooks/useGetMyFavorite.ts b/src/History/hooks/useGetMyFavorite.ts index 2772cb45..23956ee3 100644 --- a/src/History/hooks/useGetMyFavorite.ts +++ b/src/History/hooks/useGetMyFavorite.ts @@ -6,7 +6,7 @@ import { getMyFavorite } from '../api/getMyFavorite'; export default function useGetMyFavorite() { const navigate = useNavigate(); const { data: myFavoriteList, isLoading } = useQuery( - ['get-my-favorite'], + ['get-mypage-favorite'], () => getMyFavorite(), { onError: () => { diff --git a/src/libs/hooks/useDeleteFavorite.ts b/src/libs/hooks/useDeleteFavorite.ts index d1bd9c8f..086ad981 100644 --- a/src/libs/hooks/useDeleteFavorite.ts +++ b/src/libs/hooks/useDeleteFavorite.ts @@ -16,7 +16,7 @@ const useDeleteFavorite = (state: string) => { ? queryClient.refetchQueries(['get-favorite'], { exact: true, }) - : queryClient.refetchQueries(['get-my-favorite'], { + : queryClient.refetchQueries(['get-mypage-favorite'], { exact: true, }); }, From bddf4c6022bdb7afb770564903848395977c3062 Mon Sep 17 00:00:00 2001 From: Doyun Lee Date: Thu, 28 Mar 2024 00:20:14 +0900 Subject: [PATCH 63/99] =?UTF-8?q?chore:=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MyFavoriteBook/index.tsx | 33 +++++++++---------- .../MyFavoriteBookList.style.ts | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/History/components/MyFavoriteBook/index.tsx b/src/History/components/MyFavoriteBook/index.tsx index 0e021aa2..b2a19f45 100644 --- a/src/History/components/MyFavoriteBook/index.tsx +++ b/src/History/components/MyFavoriteBook/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { useNavigate } from 'react-router-dom'; import { IcHomeFavoriteFilled } from '../../../assets'; @@ -21,23 +20,21 @@ function MyFavoriteBook(props: FavoriteBookProps) { }; return ( - - - handleClickBook(bookUuid)} - /> - handleClickFavoriteBtn(bookId)} - > - - - - {favoriteName} - - + + handleClickBook(bookUuid)} + /> + handleClickFavoriteBtn(bookId)} + > + + + + {favoriteName} + ); } diff --git a/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts b/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts index 2cc7db30..51b4ac30 100644 --- a/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts +++ b/src/History/components/MyFavoriteBookList/MyFavoriteBookList.style.ts @@ -3,6 +3,6 @@ import styled from '@emotion/styled'; export const MyFavoriteBookListWrapper = styled.section` display: grid; gap: 2rem; - grid-template-columns: 1fr 1fr 1fr; + grid-template-columns: repeat(3, 1fr); justify-items: center; `; From c1edf2a76dc26b1451432fdfe5603bff8b815c04 Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Fri, 29 Mar 2024 11:10:33 +0900 Subject: [PATCH 64/99] =?UTF-8?q?fix:=20patch=20=EC=84=B1=EA=B3=B5=20?= =?UTF-8?q?=EC=8B=9C=20navigate=20=EB=B6=84=EA=B8=B0=EB=AC=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/hooks/usePatchNickname.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/EditNickname/hooks/usePatchNickname.ts b/src/EditNickname/hooks/usePatchNickname.ts index c3815c64..f31a1331 100644 --- a/src/EditNickname/hooks/usePatchNickname.ts +++ b/src/EditNickname/hooks/usePatchNickname.ts @@ -33,11 +33,7 @@ const usePatchNickname = (props: usePatchNicknameProps) => { onSuccess: () => { window.localStorage.setItem('token', token); window.localStorage.setItem('nickname', nickname); - if (sessionStorage.getItem('url') === '') { - navigate('/', { state: { step: 1 } }); - } else { - navigate(-4); - } + navigate('/'); }, }); From 90f67c6d30b0a773a5a9ade1ab56a3af3d9cc18a Mon Sep 17 00:00:00 2001 From: jungwoo3490 Date: Fri, 29 Mar 2024 11:12:28 +0900 Subject: [PATCH 65/99] =?UTF-8?q?fix:=20button=EC=97=90=20type=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EditNickname/components/EditButton/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EditNickname/components/EditButton/index.tsx b/src/EditNickname/components/EditButton/index.tsx index 5182448d..5e5a758b 100644 --- a/src/EditNickname/components/EditButton/index.tsx +++ b/src/EditNickname/components/EditButton/index.tsx @@ -29,6 +29,7 @@ function EditButton({ return (