From f10262f40ec92305594b192a5bcd96f8775d7e6e Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sun, 16 Jul 2023 14:34:29 +0900 Subject: [PATCH 01/45] =?UTF-8?q?feat:=20PC=20=EB=B7=B0,=20=EB=AA=A8?= =?UTF-8?q?=EB=B0=94=EC=9D=BC=20=EB=B7=B0=20=EB=84=A4=EB=B9=84=EA=B2=8C?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 2 ++ src/pages/MyPage/index.tsx | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/pages/MyPage/index.tsx diff --git a/src/App.tsx b/src/App.tsx index bbce53e9..c1f96816 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,6 +20,7 @@ import Withdrawal from 'pages/Setting/Withdrawal'; import Inquiry from 'pages/Inquiry'; import Myinquiry from 'pages/Inquiry/Myinquiry'; import Notice from 'pages/Notice'; +import MyPage from 'pages/MyPage'; export default function App(): JSX.Element { return ( @@ -40,6 +41,7 @@ export default function App(): JSX.Element { } /> } /> + } /> }> } /> diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx new file mode 100644 index 00000000..4cd22b74 --- /dev/null +++ b/src/pages/MyPage/index.tsx @@ -0,0 +1,14 @@ +import BottomNavigation from 'components/common/BottomNavigation'; +import TopNavigation from 'components/common/TopNavigation'; +import useMediaQuery from 'utils/hooks/useMediaQuery'; + +export default function MyPage() { + const { isMobile } = useMediaQuery(); + return ( + <> + {!isMobile && } +
마이페이지
+ {isMobile && } + + ); +} From 8fee9a00075d0ca0fd37b89057a7fcbe59eb3bf1 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:32:07 +0900 Subject: [PATCH 02/45] =?UTF-8?q?feat:=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/components/BoardSelector/index.tsx | 12 ++++++++++++ src/pages/MyPage/components/BookMark/index.tsx | 3 +++ src/pages/MyPage/components/Information/index.tsx | 3 +++ src/pages/MyPage/components/MyWrite/index.tsx | 3 +++ src/pages/MyPage/index.tsx | 11 ++++++++++- 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/pages/MyPage/components/BoardSelector/index.tsx create mode 100644 src/pages/MyPage/components/BookMark/index.tsx create mode 100644 src/pages/MyPage/components/Information/index.tsx create mode 100644 src/pages/MyPage/components/MyWrite/index.tsx diff --git a/src/pages/MyPage/components/BoardSelector/index.tsx b/src/pages/MyPage/components/BoardSelector/index.tsx new file mode 100644 index 00000000..5428566e --- /dev/null +++ b/src/pages/MyPage/components/BoardSelector/index.tsx @@ -0,0 +1,12 @@ +type SelectorProps = { + setBoard: (type:string)=>void +}; + +export default function BoardSelector({ setBoard }:SelectorProps) { + return ( +
+ + +
+ ); +} diff --git a/src/pages/MyPage/components/BookMark/index.tsx b/src/pages/MyPage/components/BookMark/index.tsx new file mode 100644 index 00000000..58328909 --- /dev/null +++ b/src/pages/MyPage/components/BookMark/index.tsx @@ -0,0 +1,3 @@ +export default function BookMark() { + return
북마크
; +} diff --git a/src/pages/MyPage/components/Information/index.tsx b/src/pages/MyPage/components/Information/index.tsx new file mode 100644 index 00000000..8ce55921 --- /dev/null +++ b/src/pages/MyPage/components/Information/index.tsx @@ -0,0 +1,3 @@ +export default function Information() { + return
내 정보
; +} diff --git a/src/pages/MyPage/components/MyWrite/index.tsx b/src/pages/MyPage/components/MyWrite/index.tsx new file mode 100644 index 00000000..9132a14c --- /dev/null +++ b/src/pages/MyPage/components/MyWrite/index.tsx @@ -0,0 +1,3 @@ +export default function MyWrite() { + return
내가 쓴 글
; +} diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index 4cd22b74..4a4afea1 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -1,13 +1,22 @@ import BottomNavigation from 'components/common/BottomNavigation'; import TopNavigation from 'components/common/TopNavigation'; import useMediaQuery from 'utils/hooks/useMediaQuery'; +import { useState } from 'react'; +import Information from './components/Information'; +import BoardSelector from './components/BoardSelector'; +import MyWrite from './components/MyWrite'; +import BookMark from './components/BookMark'; export default function MyPage() { const { isMobile } = useMediaQuery(); + const [board, setBoard] = useState('MYWRITE'); return ( <> {!isMobile && } -
마이페이지
+ + + {board === 'MYWRITE' && } + {board === 'BOOKMARK' && } {isMobile && } ); From f0b0bfb691425b25f88054f73e29f6a0455ec063 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Thu, 27 Jul 2023 15:26:33 +0900 Subject: [PATCH 03/45] =?UTF-8?q?feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=ED=97=A4=EB=8D=94=20UI=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/assets/images/mypage/option.svg | 8 + src/assets/images/mypage/pencil.svg | 3 + src/pages/MyPage/MyPage.module.scss | 12 ++ .../Information/Information.module.scss | 139 ++++++++++++++++++ .../MyPage/components/Information/index.tsx | 44 +++++- src/pages/MyPage/index.tsx | 11 +- 6 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 src/assets/images/mypage/option.svg create mode 100644 src/assets/images/mypage/pencil.svg create mode 100644 src/pages/MyPage/MyPage.module.scss create mode 100644 src/pages/MyPage/components/Information/Information.module.scss diff --git a/src/assets/images/mypage/option.svg b/src/assets/images/mypage/option.svg new file mode 100644 index 00000000..ef292779 --- /dev/null +++ b/src/assets/images/mypage/option.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/images/mypage/pencil.svg b/src/assets/images/mypage/pencil.svg new file mode 100644 index 00000000..7193807a --- /dev/null +++ b/src/assets/images/mypage/pencil.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/MyPage/MyPage.module.scss b/src/pages/MyPage/MyPage.module.scss new file mode 100644 index 00000000..8728d30b --- /dev/null +++ b/src/pages/MyPage/MyPage.module.scss @@ -0,0 +1,12 @@ +@use "src/utils/styles/mediaQuery" as media; + +.my-page { + width: 68%; + margin: 0 auto; + margin-top: 103px; + + @include media.media-breakpoint-down(mobile) { + width: 100%; + margin-top: 56px; + } +} diff --git a/src/pages/MyPage/components/Information/Information.module.scss b/src/pages/MyPage/components/Information/Information.module.scss new file mode 100644 index 00000000..ac1c1543 --- /dev/null +++ b/src/pages/MyPage/components/Information/Information.module.scss @@ -0,0 +1,139 @@ +@use "src/utils/styles/mediaQuery" as media; + +.information { + display: flex; + justify-content: space-between; + align-items: center; + + @include media.media-breakpoint-down(mobile) { + width: 91%; + margin: 0 auto; + } +} + +.user { + width: 308px; + display: flex; + justify-content: space-between; + align-items: center; + + @include media.media-breakpoint-down(mobile) { + width: 230px; + justify-content: start; + } + + &__image { + width: 112px; + height: 112px; + + @include media.media-breakpoint-down(mobile) { + width: 46px; + height: 46px; + margin-right: 16px; + } + } + + &__nickname { + display: block; + font-size: 48px; + margin-bottom: 15px; + font-weight: 400; + + @include media.media-breakpoint-down(mobile) { + display: inline; + font-size: 16px; + font-weight: 700; + margin: 0; + } + } + + &__account { + display: block; + font-size: 25px; + font-weight: 300; + + @include media.media-breakpoint-down(mobile) { + font-size: 14px; + font-weight: 400; + } + } +} + +.totals { + width: 174px; + display: flex; + justify-content: space-between; + + &__post { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + &--number { + font-size: 40px; + font-weight: 500; + } + + &--label { + font-size: 24px; + font-weight: 400; + } + } + + &__follower { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + &--number { + font-size: 40px; + font-weight: 500; + + @include media.media-breakpoint-down(mobile) { + font-size: 14px; + font-weight: 500; + } + } + + &--label { + font-size: 24px; + font-weight: 400; + } + } +} + +.dot { + display: inline-block; + width: 0; + height: 0; + border: 1px solid black; + border-radius: 100; + margin: 5px; +} + +.option { + width: 24px; + height: 24px; +} + +.profile { + position: relative; + + &:hover { + filter: brightness(50%); + } + + @include media.media-breakpoint-down(mobile) { + &:hover { + filter: none; + } + } +} + +.change--image { + position: absolute; + top: 25%; + left: 25%; +} diff --git a/src/pages/MyPage/components/Information/index.tsx b/src/pages/MyPage/components/Information/index.tsx index 8ce55921..c332f619 100644 --- a/src/pages/MyPage/components/Information/index.tsx +++ b/src/pages/MyPage/components/Information/index.tsx @@ -1,3 +1,45 @@ +import defaultImage from 'assets/images/follow/default-image.png'; +// import fixPencil from 'assets/images/mypage/pencil.svg'; +import option from 'assets/images/mypage/option.svg'; +import useMediaQuery from 'utils/hooks/useMediaQuery'; +import styles from './Information.module.scss'; + export default function Information() { - return
내 정보
; + const { isMobile } = useMediaQuery(); + return ( +
+
+
+ profileImage + {/* changeProfile */} +
+
+ + 닉네임 + + {isMobile && ( + <> +
+ 팔로워 120 + + )} + abcdIdentifier +
+
+ {!isMobile && ( +
+
+ 11 + 게시물 +
+
+ 22 + 팔로워 +
+
+ )} + {isMobile && option} + +
+ ); } diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index 4a4afea1..df931d2a 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -6,6 +6,7 @@ import Information from './components/Information'; import BoardSelector from './components/BoardSelector'; import MyWrite from './components/MyWrite'; import BookMark from './components/BookMark'; +import style from './MyPage.module.scss'; export default function MyPage() { const { isMobile } = useMediaQuery(); @@ -13,10 +14,12 @@ export default function MyPage() { return ( <> {!isMobile && } - - - {board === 'MYWRITE' && } - {board === 'BOOKMARK' && } +
+ + + {board === 'MYWRITE' && } + {board === 'BOOKMARK' && } +
{isMobile && } ); From 853735b3ee074e2f738d64d1ff36aedec1d90a47 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Thu, 27 Jul 2023 15:58:09 +0900 Subject: [PATCH 04/45] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0/=EB=B6=81?= =?UTF-8?q?=EB=B0=94=ED=81=AC=20=EC=84=A0=ED=83=9D=20=EB=B0=94=20UI?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BoardSelector/BoardSelector.module.scss | 66 +++++++++++++++++++ .../MyPage/components/BoardSelector/index.tsx | 20 ++++-- src/pages/MyPage/index.tsx | 2 +- 3 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 src/pages/MyPage/components/BoardSelector/BoardSelector.module.scss diff --git a/src/pages/MyPage/components/BoardSelector/BoardSelector.module.scss b/src/pages/MyPage/components/BoardSelector/BoardSelector.module.scss new file mode 100644 index 00000000..4170c087 --- /dev/null +++ b/src/pages/MyPage/components/BoardSelector/BoardSelector.module.scss @@ -0,0 +1,66 @@ +@use "src/utils/styles/mediaQuery" as media; + +.selector { + width: 106%; + margin-left: -3%; + margin-top: 105px; + display: flex; + justify-content: space-around; + + @include media.media-breakpoint-down(mobile) { + width: 100%; + margin: 0 auto; + margin-top: 41px; + } + + &__option { + all: unset; + width: 184px; + text-align: center; + font-size: 24px; + font-weight: 400; + + @include media.media-breakpoint-down(mobile) { + font-size: 14px; + width: 80px; + } + + &--selected { + all: unset; + width: 184px; + text-align: center; + font-size: 24px; + font-weight: 400; + + @include media.media-breakpoint-down(mobile) { + font-size: 14px; + width: 80px; + } + + &::after { + display: block; + content: ""; + width: 184px; + padding-top: 19px; + margin-bottom: -20px; + border-bottom: 1px solid #ff7f23; + + @include media.media-breakpoint-down(mobile) { + font-size: 14px; + width: 80px; + padding-top: 10px; + margin-bottom: -11px; + } + } + } + } +} + +.underline { + margin-top: 19px; + border-bottom: 1px solid #eeeeee; + + @include media.media-breakpoint-down(mobile) { + margin-top: 10px; + } +} diff --git a/src/pages/MyPage/components/BoardSelector/index.tsx b/src/pages/MyPage/components/BoardSelector/index.tsx index 5428566e..7fc48a14 100644 --- a/src/pages/MyPage/components/BoardSelector/index.tsx +++ b/src/pages/MyPage/components/BoardSelector/index.tsx @@ -1,12 +1,20 @@ +import useMediaQuery from 'utils/hooks/useMediaQuery'; +import styles from './BoardSelector.module.scss'; + type SelectorProps = { - setBoard: (type:string)=>void + setBoard: (type:string)=>void, + board: string }; -export default function BoardSelector({ setBoard }:SelectorProps) { +export default function BoardSelector({ setBoard, board }:SelectorProps) { + const { isMobile } = useMediaQuery(); return ( -
- - -
+ <> +
+ + +
+
+ ); } diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index df931d2a..9f21c017 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -16,7 +16,7 @@ export default function MyPage() { {!isMobile && }
- + {board === 'MYWRITE' && } {board === 'BOOKMARK' && }
From d3bfe82cc16081c4655ab0ee7f91150d2ee3439e Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:22:36 +0900 Subject: [PATCH 05/45] =?UTF-8?q?refactor:=20=EB=82=B4=EA=B0=80=20?= =?UTF-8?q?=EC=93=B4=20=EA=B8=80=20=EB=B3=80=EC=88=98=EB=AA=85=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/components/BoardSelector/index.tsx | 2 +- src/pages/MyPage/components/{MyWrite => MyPost}/index.tsx | 2 +- src/pages/MyPage/index.tsx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/pages/MyPage/components/{MyWrite => MyPost}/index.tsx (51%) diff --git a/src/pages/MyPage/components/BoardSelector/index.tsx b/src/pages/MyPage/components/BoardSelector/index.tsx index 7fc48a14..e390d750 100644 --- a/src/pages/MyPage/components/BoardSelector/index.tsx +++ b/src/pages/MyPage/components/BoardSelector/index.tsx @@ -11,7 +11,7 @@ export default function BoardSelector({ setBoard, board }:SelectorProps) { return ( <>
- +
diff --git a/src/pages/MyPage/components/MyWrite/index.tsx b/src/pages/MyPage/components/MyPost/index.tsx similarity index 51% rename from src/pages/MyPage/components/MyWrite/index.tsx rename to src/pages/MyPage/components/MyPost/index.tsx index 9132a14c..68d5d3e6 100644 --- a/src/pages/MyPage/components/MyWrite/index.tsx +++ b/src/pages/MyPage/components/MyPost/index.tsx @@ -1,3 +1,3 @@ -export default function MyWrite() { +export default function MyPost() { return
내가 쓴 글
; } diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index 9f21c017..5d8d9a55 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -4,20 +4,20 @@ import useMediaQuery from 'utils/hooks/useMediaQuery'; import { useState } from 'react'; import Information from './components/Information'; import BoardSelector from './components/BoardSelector'; -import MyWrite from './components/MyWrite'; import BookMark from './components/BookMark'; import style from './MyPage.module.scss'; +import MyPost from './components/MyPost'; export default function MyPage() { const { isMobile } = useMediaQuery(); - const [board, setBoard] = useState('MYWRITE'); + const [board, setBoard] = useState('MYPOST'); return ( <> {!isMobile && }
- {board === 'MYWRITE' && } + {board === 'MYPOST' && } {board === 'BOOKMARK' && }
{isMobile && } From 6c0395cb718ddbbb771c52089c14434a5fab85b9 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Fri, 28 Jul 2023 15:44:14 +0900 Subject: [PATCH 06/45] =?UTF-8?q?feat:=20=EB=82=B4=EA=B0=80=20=EC=93=B4=20?= =?UTF-8?q?=EA=B8=80=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/svg/mypage/checkerboard-filled.svg | 6 ++ src/assets/svg/mypage/checkerboard.svg | 6 ++ src/assets/svg/mypage/close-arrow.svg | 3 + src/assets/svg/mypage/hamberger-filled.svg | 5 + src/assets/svg/mypage/hamberger.svg | 5 + src/assets/svg/mypage/open-arrow.svg | 3 + src/assets/{images => svg}/mypage/option.svg | 0 src/assets/{images => svg}/mypage/pencil.svg | 0 src/assets/svg/mypage/star-filled.svg | 4 + src/assets/svg/mypage/star.svg | 4 + .../Checkerboard/Checkerboard.module.scss | 14 +++ .../MyPage/components/Checkerboard/index.tsx | 19 ++++ .../HambergerBoard/HambergerBoard.module.scss | 53 +++++++++++ .../components/HambergerBoard/index.tsx | 61 ++++++++++++ .../MyPage/components/Information/index.tsx | 2 +- .../MobileBoard/MobileBoard.module.scss | 95 +++++++++++++++++++ .../MyPage/components/MobileBoard/index.tsx | 57 +++++++++++ .../components/MyPost/MyPost.module.scss | 17 ++++ src/pages/MyPage/components/MyPost/dummy.ts | 35 +++++++ src/pages/MyPage/components/MyPost/index.tsx | 30 +++++- 20 files changed, 417 insertions(+), 2 deletions(-) create mode 100644 src/assets/svg/mypage/checkerboard-filled.svg create mode 100644 src/assets/svg/mypage/checkerboard.svg create mode 100644 src/assets/svg/mypage/close-arrow.svg create mode 100644 src/assets/svg/mypage/hamberger-filled.svg create mode 100644 src/assets/svg/mypage/hamberger.svg create mode 100644 src/assets/svg/mypage/open-arrow.svg rename src/assets/{images => svg}/mypage/option.svg (100%) rename src/assets/{images => svg}/mypage/pencil.svg (100%) create mode 100644 src/assets/svg/mypage/star-filled.svg create mode 100644 src/assets/svg/mypage/star.svg create mode 100644 src/pages/MyPage/components/Checkerboard/Checkerboard.module.scss create mode 100644 src/pages/MyPage/components/Checkerboard/index.tsx create mode 100644 src/pages/MyPage/components/HambergerBoard/HambergerBoard.module.scss create mode 100644 src/pages/MyPage/components/HambergerBoard/index.tsx create mode 100644 src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss create mode 100644 src/pages/MyPage/components/MobileBoard/index.tsx create mode 100644 src/pages/MyPage/components/MyPost/MyPost.module.scss create mode 100644 src/pages/MyPage/components/MyPost/dummy.ts diff --git a/src/assets/svg/mypage/checkerboard-filled.svg b/src/assets/svg/mypage/checkerboard-filled.svg new file mode 100644 index 00000000..7955af4f --- /dev/null +++ b/src/assets/svg/mypage/checkerboard-filled.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/svg/mypage/checkerboard.svg b/src/assets/svg/mypage/checkerboard.svg new file mode 100644 index 00000000..81b40b23 --- /dev/null +++ b/src/assets/svg/mypage/checkerboard.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/svg/mypage/close-arrow.svg b/src/assets/svg/mypage/close-arrow.svg new file mode 100644 index 00000000..e19c3802 --- /dev/null +++ b/src/assets/svg/mypage/close-arrow.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/svg/mypage/hamberger-filled.svg b/src/assets/svg/mypage/hamberger-filled.svg new file mode 100644 index 00000000..e4a6a86e --- /dev/null +++ b/src/assets/svg/mypage/hamberger-filled.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/svg/mypage/hamberger.svg b/src/assets/svg/mypage/hamberger.svg new file mode 100644 index 00000000..57a5e40d --- /dev/null +++ b/src/assets/svg/mypage/hamberger.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/svg/mypage/open-arrow.svg b/src/assets/svg/mypage/open-arrow.svg new file mode 100644 index 00000000..c8d42ca3 --- /dev/null +++ b/src/assets/svg/mypage/open-arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/mypage/option.svg b/src/assets/svg/mypage/option.svg similarity index 100% rename from src/assets/images/mypage/option.svg rename to src/assets/svg/mypage/option.svg diff --git a/src/assets/images/mypage/pencil.svg b/src/assets/svg/mypage/pencil.svg similarity index 100% rename from src/assets/images/mypage/pencil.svg rename to src/assets/svg/mypage/pencil.svg diff --git a/src/assets/svg/mypage/star-filled.svg b/src/assets/svg/mypage/star-filled.svg new file mode 100644 index 00000000..3849280b --- /dev/null +++ b/src/assets/svg/mypage/star-filled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/svg/mypage/star.svg b/src/assets/svg/mypage/star.svg new file mode 100644 index 00000000..d5379e46 --- /dev/null +++ b/src/assets/svg/mypage/star.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/pages/MyPage/components/Checkerboard/Checkerboard.module.scss b/src/pages/MyPage/components/Checkerboard/Checkerboard.module.scss new file mode 100644 index 00000000..ae7f93eb --- /dev/null +++ b/src/pages/MyPage/components/Checkerboard/Checkerboard.module.scss @@ -0,0 +1,14 @@ +.checkerboard { + width: 100%; + display: flex; + flex-wrap: wrap; + gap: 21px; + margin: 0 auto; + margin-top: 26px; + + &__post { + width: 300px; + height: 300px; + margin: 0 auto; + } +} diff --git a/src/pages/MyPage/components/Checkerboard/index.tsx b/src/pages/MyPage/components/Checkerboard/index.tsx new file mode 100644 index 00000000..a7fd1f5d --- /dev/null +++ b/src/pages/MyPage/components/Checkerboard/index.tsx @@ -0,0 +1,19 @@ +import defaultImage from 'assets/images/search/default-image.png'; +import DUMMY from '../MyPost/dummy'; +import styles from './Checkerboard.module.scss'; + +type Post = { + url: string +}; +interface CheckerBoardProps { + posts: Array +} + +export default function CheckerBoard({ posts }:CheckerBoardProps) { + console.log(posts); + return ( +
+ {DUMMY.map(() => post)} +
+ ); +} diff --git a/src/pages/MyPage/components/HambergerBoard/HambergerBoard.module.scss b/src/pages/MyPage/components/HambergerBoard/HambergerBoard.module.scss new file mode 100644 index 00000000..5e54725a --- /dev/null +++ b/src/pages/MyPage/components/HambergerBoard/HambergerBoard.module.scss @@ -0,0 +1,53 @@ +.board { + margin: 0 auto; + margin-top: 26px; + display: flex; + flex-direction: column; + gap: 45px; +} + +.post { + display: flex; + gap: 70px; + width: 100%; + + &__image { + width: 300px; + height: 300px; + } + + &__detail { + display: flex; + width: 48vw; + justify-content: space-between; + + &--name { + display: block; + font-size: 40px; + } + + &--date { + font-size: 20px; + color: #afafaf; + } + } + + &__main-text { + margin-top: 30px; + font-size: 24px; + width: 48vw; + height: 195px; + line-height: 28.13px; + overflow: hidden; + } +} + +.star-rate { + display: flex; + align-items: center; + + &__star { + width: 30px; + height: 30px; + } +} diff --git a/src/pages/MyPage/components/HambergerBoard/index.tsx b/src/pages/MyPage/components/HambergerBoard/index.tsx new file mode 100644 index 00000000..6b661bb2 --- /dev/null +++ b/src/pages/MyPage/components/HambergerBoard/index.tsx @@ -0,0 +1,61 @@ +import defaultImage from 'assets/images/search/default-image.png'; +import star from 'assets/svg/mypage/star.svg'; +import filledStar from 'assets/svg/mypage/star-filled.svg'; +import styles from './HambergerBoard.module.scss'; + +type Post = { + url: string +}; + +interface HambergerBoardProps { + posts: Array +} + +export default function HambergerBoard({ posts }:HambergerBoardProps) { + return ( +
+ {posts.map(() => ( +
+ post +
+
+
+ 카페 마이야르 성수점 + 00.00.00 작성 +
+
+ score + score + score + score + score +
+
+

+ 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글글 + 글글글글글글글글글글글글글글글글글글글글글 + +

+
+
+ ))} +
+ ); +} diff --git a/src/pages/MyPage/components/Information/index.tsx b/src/pages/MyPage/components/Information/index.tsx index c332f619..1648e6b7 100644 --- a/src/pages/MyPage/components/Information/index.tsx +++ b/src/pages/MyPage/components/Information/index.tsx @@ -1,6 +1,6 @@ import defaultImage from 'assets/images/follow/default-image.png'; // import fixPencil from 'assets/images/mypage/pencil.svg'; -import option from 'assets/images/mypage/option.svg'; +import option from 'assets/svg/mypage/option.svg'; import useMediaQuery from 'utils/hooks/useMediaQuery'; import styles from './Information.module.scss'; diff --git a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss new file mode 100644 index 00000000..3995a8a9 --- /dev/null +++ b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss @@ -0,0 +1,95 @@ +.board { + width: 100%; + height: calc(100vh - 272px); + overflow-y: scroll; +} + +.total { + display: block; + width: 91%; + margin: 0 auto; + margin-bottom: 20px; + margin-top: 20px; + font-size: 16px; + font-weight: 700; + color: #ff7f23; + line-height: 20px; +} + +.post { + width: 91%; + margin: 0 auto; + margin-top: 16px; + + &__store { + display: flex; + justify-content: space-between; + } + + &__opener { + width: 24px; + height: 24px; + display: flex; + align-items: center; + border: 0; + background-color: transparent; + justify-content: center; + } +} + +.store { + display: flex; + margin-bottom: 8px; + align-items: end; + gap: 4px; + + &__name { + font-size: 18px; + font-weight: 700; + } + + &__type { + font-size: 12px; + font-weight: 500; + color: #c4c4c4; + } +} + +.underline { + border-bottom: 3px solid #eeeeee; +} + +.review { + display: flex; + align-items: center; + + &__main-text { + font-size: 14px; + line-height: 17.47px; + margin-bottom: 8px; + } + + &__detail { + display: flex; + gap: 4px; + font-size: 14px; + color: #666666; + align-items: center; + text-align: center; + margin-bottom: 16px; + } +} + +.star-rate { + display: flex; + align-items: center; + + &__image { + width: 17px; + height: 17px; + } + + &__rate { + font-size: 14px; + } +} diff --git a/src/pages/MyPage/components/MobileBoard/index.tsx b/src/pages/MyPage/components/MobileBoard/index.tsx new file mode 100644 index 00000000..9ff2a441 --- /dev/null +++ b/src/pages/MyPage/components/MobileBoard/index.tsx @@ -0,0 +1,57 @@ +import filledStar from 'assets/svg/mypage/star-filled.svg'; +import openArrow from 'assets/svg/mypage/open-arrow.svg'; +import closeArrow from 'assets/svg/mypage/close-arrow.svg'; +import { useState } from 'react'; +import styles from './MobileBoard.module.scss'; + +type Post = { + url: string +}; + +interface MobileBoardProps { + posts: Array +} +function Review() { + const [isOpen, setOpen] = useState(false); + return ( +
+
+
+ 국밥 공을기 + 중식당 +
+ +
+ {isOpen && ( +
+

두번째 방문인데 여전히 학교 주변에 숨겨진 맛집. 주인 아주머니가 친절하시고 가격도 싸다. 자주 방문할 것 같다.두번째 방문인데 여전히 학교 주변에 숨겨진 맛집. 주인 아주머니가 친절하시고 가격도 싸다. 자주 방문할 것 같다.

+
+ 02/22 + | +
+ rate + 4.0 +
+
+
+ )} + +
+ ); +} + +export default function MoileBoard({ posts }:MobileBoardProps) { + return ( +
+ 총 120개의 리뷰 + {posts.map(() => ( + <> + +
+ + ))} +
+ ); +} diff --git a/src/pages/MyPage/components/MyPost/MyPost.module.scss b/src/pages/MyPage/components/MyPost/MyPost.module.scss new file mode 100644 index 00000000..275a720b --- /dev/null +++ b/src/pages/MyPage/components/MyPost/MyPost.module.scss @@ -0,0 +1,17 @@ +@use "src/utils/styles/mediaQuery" as media; + +.view-options { + display: flex; + width: 98%; + gap: 17px; + justify-content: end; + margin-top: 25px; + + @include media.media-breakpoint-down(mobile) { + display: none; + } + + &__option { + all: unset; + } +} diff --git a/src/pages/MyPage/components/MyPost/dummy.ts b/src/pages/MyPage/components/MyPost/dummy.ts new file mode 100644 index 00000000..736bf682 --- /dev/null +++ b/src/pages/MyPage/components/MyPost/dummy.ts @@ -0,0 +1,35 @@ +const DUMMY = [{ + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}, { + url: 'assets/images/search/default-image.png', +}]; + +export default DUMMY; diff --git a/src/pages/MyPage/components/MyPost/index.tsx b/src/pages/MyPage/components/MyPost/index.tsx index 68d5d3e6..06cb785c 100644 --- a/src/pages/MyPage/components/MyPost/index.tsx +++ b/src/pages/MyPage/components/MyPost/index.tsx @@ -1,3 +1,31 @@ +import { useState } from 'react'; +import checkerboard from 'assets/svg/mypage/checkerboard.svg'; +import filledCheckerboard from 'assets/svg/mypage/checkerboard-filled.svg'; +import filledHamberger from 'assets/svg/mypage/hamberger-filled.svg'; +import hamberger from 'assets/svg/mypage/hamberger.svg'; +import useMediaQuery from 'utils/hooks/useMediaQuery'; +import styles from './MyPost.module.scss'; +import CheckerBoard from '../Checkerboard'; +import DUMMY from './dummy'; +import HambergerBoard from '../HambergerBoard'; +import MobileBoard from '../MobileBoard'; + export default function MyPost() { - return
내가 쓴 글
; + const [viewType, setType] = useState('CHECKERBOARD'); + const { isMobile } = useMediaQuery(); + return ( +
+
+ + +
+ {!isMobile && viewType === 'CHECKERBOARD' && } + {!isMobile && viewType === 'HAMBERGER' && } + {isMobile && } +
+ ); } From 7c64630fc18d8205ca0b10f00d13d65856cc4115 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sat, 29 Jul 2023 19:12:03 +0900 Subject: [PATCH 07/45] =?UTF-8?q?style:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20?= =?UTF-8?q?=EB=82=B4=20=EB=A6=AC=EB=B7=B0=20height=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/MyPage.module.scss | 4 +++- .../MyPage/components/MobileBoard/MobileBoard.module.scss | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/MyPage/MyPage.module.scss b/src/pages/MyPage/MyPage.module.scss index 8728d30b..501dfa25 100644 --- a/src/pages/MyPage/MyPage.module.scss +++ b/src/pages/MyPage/MyPage.module.scss @@ -6,7 +6,9 @@ margin-top: 103px; @include media.media-breakpoint-down(mobile) { + position: fixed; + top: 30px; width: 100%; - margin-top: 56px; + margin-top: 0; } } diff --git a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss index 3995a8a9..cd46c3d9 100644 --- a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss +++ b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss @@ -1,6 +1,6 @@ .board { width: 100%; - height: calc(100vh - 272px); + height: calc(100vh - 228px); overflow-y: scroll; } From 9170bd74dac439122b4f95e8e19bcdf708304da4 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sat, 29 Jul 2023 20:48:37 +0900 Subject: [PATCH 08/45] =?UTF-8?q?feat:=20=EB=B6=81=EB=A7=88=ED=81=AC=20?= =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BookMark/BookMark.module.scss | 78 +++++++++++++++++++ .../MyPage/components/BookMark/index.tsx | 26 ++++++- .../MobileBoard/MobileBoard.module.scss | 6 ++ 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 src/pages/MyPage/components/BookMark/BookMark.module.scss diff --git a/src/pages/MyPage/components/BookMark/BookMark.module.scss b/src/pages/MyPage/components/BookMark/BookMark.module.scss new file mode 100644 index 00000000..7feb6791 --- /dev/null +++ b/src/pages/MyPage/components/BookMark/BookMark.module.scss @@ -0,0 +1,78 @@ +.bookmarks { + width: 91%; + margin: 0 auto; + height: calc(100vh - 228px); + overflow-y: scroll; + -ms-overflow-style: none; + scrollbar-width: none; + + &::-webkit-scrollbar { + display: none; + } + + &__total { + display: block; + font-size: 14px; + font-weight: 500; + color: #c4c4c4; + margin-bottom: 8px; + margin-top: 16px; + } +} + +.bookmark { + &::after { + display: block; + content: ""; + width: 100%; + margin: 16px 0; + border-bottom: 1px solid #eeeeee; + } + + &__detail { + display: flex; + gap: 2px; + + &--name { + font-size: 18px; + font-weight: 700; + } + + &--type { + display: flex; + align-items: end; + font-size: 14px; + font-weight: 400; + color: #979797; + } + } + + &__star-rate { + display: flex; + gap: 1px; + + &--image { + width: 16px; + height: 16px; + } + + &--rate { + line-height: 17px; + font-size: 14px; + font-weight: 400; + color: #666666; + } + } + + &__store-image { + width: 100%; + height: 96px; + position: relative; + overflow: hidden; + + &--crop { + width: 100%; + position: absolute; + } + } +} diff --git a/src/pages/MyPage/components/BookMark/index.tsx b/src/pages/MyPage/components/BookMark/index.tsx index 58328909..34aa9803 100644 --- a/src/pages/MyPage/components/BookMark/index.tsx +++ b/src/pages/MyPage/components/BookMark/index.tsx @@ -1,3 +1,27 @@ +import filledStar from 'assets/svg/mypage/star-filled.svg'; +import defaultImage from 'assets/images/search/default-image.png'; +import DUMMY from '../MyPost/dummy'; +import styles from './BookMark.module.scss'; + export default function BookMark() { - return
북마크
; + return ( +
+ {`총 ${DUMMY.length}개의 음식점`} + {DUMMY.map(() => ( +
+
+ 국밥 공을기 + 중식당 +
+
+ satr-rate + 4.0 +
+
+ store +
+
+ ))} +
+ ); } diff --git a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss index cd46c3d9..334d397c 100644 --- a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss +++ b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss @@ -2,6 +2,12 @@ width: 100%; height: calc(100vh - 228px); overflow-y: scroll; + -ms-overflow-style: none; + scrollbar-width: none; + + &::-webkit-scrollbar { + display: none; + } } .total { From b86186027af4b68220ada83feeaf91d687e0e70e Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sat, 29 Jul 2023 21:16:49 +0900 Subject: [PATCH 09/45] =?UTF-8?q?feat:=20=EB=B6=81=EB=A7=88=ED=81=AC,=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20UI=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/svg/mypage/not-exist.svg | 42 +++++++++++ .../components/BookMark/BookMark.module.scss | 25 +++++++ .../MyPage/components/BookMark/index.tsx | 44 ++++++++---- .../MobileBoard/MobileBoard.module.scss | 25 +++++++ .../MyPage/components/MobileBoard/index.tsx | 24 +++++-- src/pages/MyPage/components/MyPost/dummy.ts | 72 ++++++++++--------- 6 files changed, 179 insertions(+), 53 deletions(-) create mode 100644 src/assets/svg/mypage/not-exist.svg diff --git a/src/assets/svg/mypage/not-exist.svg b/src/assets/svg/mypage/not-exist.svg new file mode 100644 index 00000000..7af5b39f --- /dev/null +++ b/src/assets/svg/mypage/not-exist.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/MyPage/components/BookMark/BookMark.module.scss b/src/pages/MyPage/components/BookMark/BookMark.module.scss index 7feb6791..b382e8d6 100644 --- a/src/pages/MyPage/components/BookMark/BookMark.module.scss +++ b/src/pages/MyPage/components/BookMark/BookMark.module.scss @@ -76,3 +76,28 @@ } } } + +.not-exist { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + &__phrase { + display: flex; + gap: 9px; + flex-direction: column; + text-align: center; + font-size: 14px; + color: #666666; + white-space: pre; + } + + &__image { + margin-top: 24px; + width: 207px; + height: 158px; + } +} diff --git a/src/pages/MyPage/components/BookMark/index.tsx b/src/pages/MyPage/components/BookMark/index.tsx index 34aa9803..505335eb 100644 --- a/src/pages/MyPage/components/BookMark/index.tsx +++ b/src/pages/MyPage/components/BookMark/index.tsx @@ -1,27 +1,41 @@ import filledStar from 'assets/svg/mypage/star-filled.svg'; import defaultImage from 'assets/images/search/default-image.png'; +import notExist from 'assets/svg/mypage/not-exist.svg'; import DUMMY from '../MyPost/dummy'; import styles from './BookMark.module.scss'; export default function BookMark() { return (
- {`총 ${DUMMY.length}개의 음식점`} - {DUMMY.map(() => ( -
-
- 국밥 공을기 - 중식당 -
-
- satr-rate - 4.0 -
-
- store -
+ {DUMMY.length !== 0 ? ( + <> + {`총 ${DUMMY.length}개의 음식점`} + {DUMMY.map(() => ( +
+
+ 국밥 공을기 + 중식당 +
+
+ satr-rate + 4.0 +
+
+ store +
+
+ ))} + + ) : ( +
+ +

둥록된 북마크가 없어요.

+

새로운 음식점을 저장해 보세요!

+
+ not-exist
- ))} + )} +
); } diff --git a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss index 334d397c..f42b2d1a 100644 --- a/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss +++ b/src/pages/MyPage/components/MobileBoard/MobileBoard.module.scss @@ -99,3 +99,28 @@ font-size: 14px; } } + +.not-exist { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + &__phrase { + display: flex; + gap: 9px; + flex-direction: column; + text-align: center; + font-size: 14px; + color: #666666; + white-space: pre; + } + + &__image { + margin-top: 24px; + width: 207px; + height: 158px; + } +} diff --git a/src/pages/MyPage/components/MobileBoard/index.tsx b/src/pages/MyPage/components/MobileBoard/index.tsx index 9ff2a441..2e9965c6 100644 --- a/src/pages/MyPage/components/MobileBoard/index.tsx +++ b/src/pages/MyPage/components/MobileBoard/index.tsx @@ -2,6 +2,7 @@ import filledStar from 'assets/svg/mypage/star-filled.svg'; import openArrow from 'assets/svg/mypage/open-arrow.svg'; import closeArrow from 'assets/svg/mypage/close-arrow.svg'; import { useState } from 'react'; +import notExist from 'assets/svg/mypage/not-exist.svg'; import styles from './MobileBoard.module.scss'; type Post = { @@ -45,13 +46,26 @@ function Review() { export default function MoileBoard({ posts }:MobileBoardProps) { return (
- 총 120개의 리뷰 - {posts.map(() => ( + {posts.length !== 0 ? ( <> - -
+ 총 120개의 리뷰 + {posts.map(() => ( + <> + +
+ + ))} - ))} + ) : ( +
+ +

둥록된 리뷰가 없어요.

+

다녀온 음식점의 리뷰를 작성해 보세요!

+
+ not-exist +
+ )} +
); } diff --git a/src/pages/MyPage/components/MyPost/dummy.ts b/src/pages/MyPage/components/MyPost/dummy.ts index 736bf682..cd355556 100644 --- a/src/pages/MyPage/components/MyPost/dummy.ts +++ b/src/pages/MyPage/components/MyPost/dummy.ts @@ -1,35 +1,41 @@ -const DUMMY = [{ - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}, { - url: 'assets/images/search/default-image.png', -}]; +type Post = { + url:string +}; + +const DUMMY:Array = [ +// { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// }, { +// url: 'assets/images/search/default-image.png', +// } +]; export default DUMMY; From 413bc123e41cd5b8bdd2f9b444aefea1a9c97f0a Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sat, 29 Jul 2023 21:22:36 +0900 Subject: [PATCH 10/45] =?UTF-8?q?feat:=20=EB=8D=B0=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=ED=86=B1=20=EB=B7=B0=20=EB=A6=AC=EB=B7=B0,=20=EB=B6=81?= =?UTF-8?q?=EB=A7=88=ED=81=AC=20=EC=97=86=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20?= =?UTF-8?q?UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MyPost/MyPost.module.scss | 25 +++++++++++++ src/pages/MyPage/components/MyPost/index.tsx | 36 +++++++++++++------ 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/pages/MyPage/components/MyPost/MyPost.module.scss b/src/pages/MyPage/components/MyPost/MyPost.module.scss index 275a720b..5f412bf2 100644 --- a/src/pages/MyPage/components/MyPost/MyPost.module.scss +++ b/src/pages/MyPage/components/MyPost/MyPost.module.scss @@ -15,3 +15,28 @@ all: unset; } } + +.not-exist { + width: 100%; + height: calc(100vh - 228px); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + &__phrase { + display: flex; + gap: 9px; + flex-direction: column; + text-align: center; + font-size: 14px; + color: #666666; + white-space: pre; + } + + &__image { + margin-top: 24px; + width: 207px; + height: 158px; + } +} diff --git a/src/pages/MyPage/components/MyPost/index.tsx b/src/pages/MyPage/components/MyPost/index.tsx index 06cb785c..25cbf541 100644 --- a/src/pages/MyPage/components/MyPost/index.tsx +++ b/src/pages/MyPage/components/MyPost/index.tsx @@ -4,6 +4,7 @@ import filledCheckerboard from 'assets/svg/mypage/checkerboard-filled.svg'; import filledHamberger from 'assets/svg/mypage/hamberger-filled.svg'; import hamberger from 'assets/svg/mypage/hamberger.svg'; import useMediaQuery from 'utils/hooks/useMediaQuery'; +import notExist from 'assets/svg/mypage/not-exist.svg'; import styles from './MyPost.module.scss'; import CheckerBoard from '../Checkerboard'; import DUMMY from './dummy'; @@ -15,17 +16,30 @@ export default function MyPost() { const { isMobile } = useMediaQuery(); return (
-
- - -
- {!isMobile && viewType === 'CHECKERBOARD' && } - {!isMobile && viewType === 'HAMBERGER' && } - {isMobile && } + {DUMMY.length !== 0 ? ( + <> +
+ + +
+ {!isMobile && viewType === 'CHECKERBOARD' && } + {!isMobile && viewType === 'HAMBERGER' && } + {isMobile && } + + ) : ( +
+ +

둥록된 리뷰가 없어요.

+

다녀온 음식점의 리뷰를 작성해 보세요!

+
+ not-exist +
+ )} +
); } From 0c84cee33f690c586e61736a7a99679933bf86dd Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Thu, 3 Aug 2023 19:16:37 +0900 Subject: [PATCH 11/45] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20api=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyPage/components/Information/index.tsx | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/pages/MyPage/components/Information/index.tsx b/src/pages/MyPage/components/Information/index.tsx index 1648e6b7..0edebadc 100644 --- a/src/pages/MyPage/components/Information/index.tsx +++ b/src/pages/MyPage/components/Information/index.tsx @@ -2,20 +2,43 @@ import defaultImage from 'assets/images/follow/default-image.png'; // import fixPencil from 'assets/images/mypage/pencil.svg'; import option from 'assets/svg/mypage/option.svg'; import useMediaQuery from 'utils/hooks/useMediaQuery'; +import { getMe } from 'api/user'; +import { useEffect, useState } from 'react'; +import { User } from 'api/user/entity'; import styles from './Information.module.scss'; +type Profile = User & { + profileImage?: { + url: string + } +}; + +const useMyInfo = () => { + const [profile, setProfile] = useState(); + const getMyInfo = async () => { + const { data } = await getMe(); + setProfile(data); + }; + useEffect(() => { + getMyInfo(); + }, []); + + return { profile }; +}; + export default function Information() { const { isMobile } = useMediaQuery(); + const { profile } = useMyInfo(); return (
- profileImage + profileImage {/* changeProfile */}
- 닉네임 + {profile?.nickname} {isMobile && ( <> @@ -23,13 +46,13 @@ export default function Information() { 팔로워 120 )} - abcdIdentifier + {profile?.account}
{!isMobile && (
- 11 + {profile?.userCountResponse.reviewCount} 게시물
From 3972d9a1db718a5bbf2a1005f2f3f818c2ae062d Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Thu, 3 Aug 2023 22:00:06 +0900 Subject: [PATCH 12/45] =?UTF-8?q?feat:=20=EB=82=B4=EA=B0=80=20=EC=93=B4=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20api=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mypage/entity.ts | 22 ++++++ src/api/mypage/index.ts | 6 ++ src/api/mypage/mypageApiClient.ts | 18 +++++ .../MyPage/components/Information/index.tsx | 25 +------ .../MyPage/components/MobileBoard/index.tsx | 67 ++++++++++++------- src/pages/MyPage/components/MyPost/index.tsx | 10 ++- src/pages/MyPage/hooks/useMyProfile.ts | 18 +++++ src/pages/MyPage/hooks/useReviewedShops.ts | 10 +++ src/pages/MyPage/hooks/useReviews.ts | 10 +++ 9 files changed, 135 insertions(+), 51 deletions(-) create mode 100644 src/api/mypage/entity.ts create mode 100644 src/api/mypage/index.ts create mode 100644 src/api/mypage/mypageApiClient.ts create mode 100644 src/pages/MyPage/hooks/useMyProfile.ts create mode 100644 src/pages/MyPage/hooks/useReviewedShops.ts create mode 100644 src/pages/MyPage/hooks/useReviews.ts diff --git a/src/api/mypage/entity.ts b/src/api/mypage/entity.ts new file mode 100644 index 00000000..ae541be5 --- /dev/null +++ b/src/api/mypage/entity.ts @@ -0,0 +1,22 @@ +export type Shop = { + shopId: number, + placeId: string, + name: string, + category: string, + +}; +export interface ReviewedShopsResponse { + content: Shop[] +} + +export type Review = { + id:number, + content: string, + rate: number, + createdAt:string + +}; + +export interface ReviewsResPonse { + content: Review[] +} diff --git a/src/api/mypage/index.ts b/src/api/mypage/index.ts new file mode 100644 index 00000000..4852a8ea --- /dev/null +++ b/src/api/mypage/index.ts @@ -0,0 +1,6 @@ +import { ReviewedShopsResponse, ReviewsResPonse } from './entity'; +import myPageApi from './mypageApiClient'; + +export const getReviewedShops = async () => myPageApi.get('/shops'); + +export const getReviews = async (placeId:string) => myPageApi.get(`/shop/${placeId}`); diff --git a/src/api/mypage/mypageApiClient.ts b/src/api/mypage/mypageApiClient.ts new file mode 100644 index 00000000..b8490629 --- /dev/null +++ b/src/api/mypage/mypageApiClient.ts @@ -0,0 +1,18 @@ +import { API_PATH } from 'config/constants'; +import axios from 'axios'; + +const myPageApi = axios.create({ + baseURL: `${API_PATH}/review`, + timeout: 2000, +}); + +myPageApi.interceptors.request.use( + (config) => { + const accessToken = sessionStorage.getItem('accessToken'); + // eslint-disable-next-line no-param-reassign + if (config.headers && accessToken) config.headers.Authorization = `Bearer ${accessToken}`; + return config; + }, +); + +export default myPageApi; diff --git a/src/pages/MyPage/components/Information/index.tsx b/src/pages/MyPage/components/Information/index.tsx index 0edebadc..4141c60f 100644 --- a/src/pages/MyPage/components/Information/index.tsx +++ b/src/pages/MyPage/components/Information/index.tsx @@ -2,33 +2,12 @@ import defaultImage from 'assets/images/follow/default-image.png'; // import fixPencil from 'assets/images/mypage/pencil.svg'; import option from 'assets/svg/mypage/option.svg'; import useMediaQuery from 'utils/hooks/useMediaQuery'; -import { getMe } from 'api/user'; -import { useEffect, useState } from 'react'; -import { User } from 'api/user/entity'; +import useMyProfile from 'pages/MyPage/hooks/useMyProfile'; import styles from './Information.module.scss'; -type Profile = User & { - profileImage?: { - url: string - } -}; - -const useMyInfo = () => { - const [profile, setProfile] = useState(); - const getMyInfo = async () => { - const { data } = await getMe(); - setProfile(data); - }; - useEffect(() => { - getMyInfo(); - }, []); - - return { profile }; -}; - export default function Information() { const { isMobile } = useMediaQuery(); - const { profile } = useMyInfo(); + const { profile } = useMyProfile(); return (
diff --git a/src/pages/MyPage/components/MobileBoard/index.tsx b/src/pages/MyPage/components/MobileBoard/index.tsx index 2e9965c6..8e174b60 100644 --- a/src/pages/MyPage/components/MobileBoard/index.tsx +++ b/src/pages/MyPage/components/MobileBoard/index.tsx @@ -3,57 +3,73 @@ import openArrow from 'assets/svg/mypage/open-arrow.svg'; import closeArrow from 'assets/svg/mypage/close-arrow.svg'; import { useState } from 'react'; import notExist from 'assets/svg/mypage/not-exist.svg'; +import { Shop } from 'api/mypage/entity'; +import useReviwes from 'pages/MyPage/hooks/useReviews'; +import useMyProfile from 'pages/MyPage/hooks/useMyProfile'; import styles from './MobileBoard.module.scss'; -type Post = { - url: string -}; - interface MobileBoardProps { - posts: Array + posts: Array, +} +interface ReviewProps { + placeId: string, + name:string, + category:string } -function Review() { +function Review({ + placeId, name, category, +}:ReviewProps) { const [isOpen, setOpen] = useState(false); + const { reviews, isLoading } = useReviwes(placeId); return (
- 국밥 공을기 - 중식당 + {name} + {category}
- {isOpen && ( -
-

두번째 방문인데 여전히 학교 주변에 숨겨진 맛집. 주인 아주머니가 친절하시고 가격도 싸다. 자주 방문할 것 같다.두번째 방문인데 여전히 학교 주변에 숨겨진 맛집. 주인 아주머니가 친절하시고 가격도 싸다. 자주 방문할 것 같다.

-
- 02/22 - | -
- rate - 4.0 + {!isLoading && reviews.map((review) => ( + isOpen && ( +
+

{review.content}

+
+ {review.createdAt} + | +
+ rate + + {parseFloat(review.rate.toString()).toFixed(1)} + +
-
- )} + ) + ))}
); } export default function MoileBoard({ posts }:MobileBoardProps) { + const { getTotal } = useMyProfile(); return (
- {posts.length !== 0 ? ( + {posts ? ( <> - 총 120개의 리뷰 - {posts.map(() => ( - <> - + {`총 ${getTotal()}개의 리뷰`} + {posts.map((post) => ( +
+
- +
))} ) : ( @@ -65,7 +81,6 @@ export default function MoileBoard({ posts }:MobileBoardProps) { not-exist
)} -
); } diff --git a/src/pages/MyPage/components/MyPost/index.tsx b/src/pages/MyPage/components/MyPost/index.tsx index 25cbf541..e9ab9270 100644 --- a/src/pages/MyPage/components/MyPost/index.tsx +++ b/src/pages/MyPage/components/MyPost/index.tsx @@ -5,6 +5,7 @@ import filledHamberger from 'assets/svg/mypage/hamberger-filled.svg'; import hamberger from 'assets/svg/mypage/hamberger.svg'; import useMediaQuery from 'utils/hooks/useMediaQuery'; import notExist from 'assets/svg/mypage/not-exist.svg'; +import useReviwedShops from 'pages/MyPage/hooks/useReviewedShops'; import styles from './MyPost.module.scss'; import CheckerBoard from '../Checkerboard'; import DUMMY from './dummy'; @@ -13,10 +14,12 @@ import MobileBoard from '../MobileBoard'; export default function MyPost() { const [viewType, setType] = useState('CHECKERBOARD'); + const { isLoading, isError, shops } = useReviwedShops(); + console.log(isLoading, isError, shops); const { isMobile } = useMediaQuery(); return (
- {DUMMY.length !== 0 ? ( + {!isLoading && !isError && shops?.length !== 0 ? ( <>
{!isMobile && viewType === 'CHECKERBOARD' && } {!isMobile && viewType === 'HAMBERGER' && } - {isMobile && } + {isMobile && } ) : ( + !isMobile + && (

둥록된 리뷰가 없어요.

@@ -38,6 +43,7 @@ export default function MyPost() {
not-exist
+ ) )}
diff --git a/src/pages/MyPage/hooks/useMyProfile.ts b/src/pages/MyPage/hooks/useMyProfile.ts new file mode 100644 index 00000000..9960b736 --- /dev/null +++ b/src/pages/MyPage/hooks/useMyProfile.ts @@ -0,0 +1,18 @@ +import { getMe } from 'api/user'; +import { User } from 'api/user/entity'; +import { useQuery } from 'react-query'; + +type Profile = User & { + profileImage?: { + url: string + }, +}; +const useMyProfile = () => { + const { data, isLoading } = useQuery('profile', getMe); + const profile:Profile | null = data ? data.data : null; + const getTotal = () => (data ? data.data.userCountResponse.reviewCount : 0); + + return { profile, isLoading, getTotal }; +}; + +export default useMyProfile; diff --git a/src/pages/MyPage/hooks/useReviewedShops.ts b/src/pages/MyPage/hooks/useReviewedShops.ts new file mode 100644 index 00000000..873bc245 --- /dev/null +++ b/src/pages/MyPage/hooks/useReviewedShops.ts @@ -0,0 +1,10 @@ +import { getReviewedShops } from 'api/mypage'; +import { useQuery } from 'react-query'; + +const useReviwedShops = () => { + const { isLoading, isError, data } = useQuery('reviewedShops', () => getReviewedShops()); + const shops = data ? data.data.content : []; + return { isLoading, isError, shops }; +}; + +export default useReviwedShops; diff --git a/src/pages/MyPage/hooks/useReviews.ts b/src/pages/MyPage/hooks/useReviews.ts new file mode 100644 index 00000000..0b0a67d7 --- /dev/null +++ b/src/pages/MyPage/hooks/useReviews.ts @@ -0,0 +1,10 @@ +import { getReviews } from 'api/mypage'; +import { useQuery } from 'react-query'; + +const useReviwes = (placeId:string) => { + const { isLoading, isError, data } = useQuery(['reviews', placeId], () => getReviews(placeId)); + const reviews = data ? data.data.content : []; + return { isLoading, isError, reviews }; +}; + +export default useReviwes; From 78bbee045ec83d1071ecd0912ee6b9666db9ee2f Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Thu, 3 Aug 2023 22:07:22 +0900 Subject: [PATCH 13/45] =?UTF-8?q?feat:=20=ED=8E=BC=EC=B9=98=EA=B8=B0=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20label?= =?UTF-8?q?=EB=A1=9C=20=ED=99=95=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/components/MobileBoard/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/MyPage/components/MobileBoard/index.tsx b/src/pages/MyPage/components/MobileBoard/index.tsx index 8e174b60..2dcfde46 100644 --- a/src/pages/MyPage/components/MobileBoard/index.tsx +++ b/src/pages/MyPage/components/MobileBoard/index.tsx @@ -23,15 +23,15 @@ function Review({ const { reviews, isLoading } = useReviwes(placeId); return (
-
+
+ {!isLoading && reviews.map((review) => ( isOpen && (
From ce8174665163afdd6fe7053f6e94aa77aabc4f01 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sat, 5 Aug 2023 17:42:27 +0900 Subject: [PATCH 14/45] =?UTF-8?q?feat:=20=EB=B6=81=EB=A7=88=ED=81=AC=20api?= =?UTF-8?q?=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mypage/entity.ts | 13 ++++++++++++ src/api/mypage/index.ts | 8 +++++--- src/api/mypage/mypageApiClient.ts | 2 +- .../MyPage/components/BookMark/index.tsx | 20 +++++++++---------- src/pages/MyPage/hooks/useScraps.ts | 10 ++++++++++ 5 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 src/pages/MyPage/hooks/useScraps.ts diff --git a/src/api/mypage/entity.ts b/src/api/mypage/entity.ts index ae541be5..09ad08c8 100644 --- a/src/api/mypage/entity.ts +++ b/src/api/mypage/entity.ts @@ -20,3 +20,16 @@ export type Review = { export interface ReviewsResPonse { content: Review[] } + +export type Scrap = { + placeId: string, + category: string, + name:string, + photo: string, + ratingCount: number, + scrapId: number, + totalRating: number +}; +export interface ScrapResponse { + content: Scrap[] +} diff --git a/src/api/mypage/index.ts b/src/api/mypage/index.ts index 4852a8ea..a8a60b3b 100644 --- a/src/api/mypage/index.ts +++ b/src/api/mypage/index.ts @@ -1,6 +1,8 @@ -import { ReviewedShopsResponse, ReviewsResPonse } from './entity'; +import { ReviewedShopsResponse, ReviewsResPonse, ScrapResponse } from './entity'; import myPageApi from './mypageApiClient'; -export const getReviewedShops = async () => myPageApi.get('/shops'); +export const getReviewedShops = async () => myPageApi.get('/review/shops'); -export const getReviews = async (placeId:string) => myPageApi.get(`/shop/${placeId}`); +export const getReviews = async (placeId:string) => myPageApi.get(`/review/shop/${placeId}`); + +export const getScraps = async () => myPageApi.get('/scraps'); diff --git a/src/api/mypage/mypageApiClient.ts b/src/api/mypage/mypageApiClient.ts index b8490629..03b38f50 100644 --- a/src/api/mypage/mypageApiClient.ts +++ b/src/api/mypage/mypageApiClient.ts @@ -2,7 +2,7 @@ import { API_PATH } from 'config/constants'; import axios from 'axios'; const myPageApi = axios.create({ - baseURL: `${API_PATH}/review`, + baseURL: `${API_PATH}`, timeout: 2000, }); diff --git a/src/pages/MyPage/components/BookMark/index.tsx b/src/pages/MyPage/components/BookMark/index.tsx index 505335eb..3ef386e7 100644 --- a/src/pages/MyPage/components/BookMark/index.tsx +++ b/src/pages/MyPage/components/BookMark/index.tsx @@ -1,27 +1,28 @@ import filledStar from 'assets/svg/mypage/star-filled.svg'; import defaultImage from 'assets/images/search/default-image.png'; import notExist from 'assets/svg/mypage/not-exist.svg'; -import DUMMY from '../MyPost/dummy'; +import useScraps from 'pages/MyPage/hooks/useScraps'; import styles from './BookMark.module.scss'; export default function BookMark() { + const { scraps, isLoading } = useScraps(); return (
- {DUMMY.length !== 0 ? ( + {!isLoading && scraps.length !== 0 ? ( <> - {`총 ${DUMMY.length}개의 음식점`} - {DUMMY.map(() => ( -
+ {`총 ${scraps.length}개의 음식점`} + {scraps.map((scrap) => ( +
- 국밥 공을기 - 중식당 + {scrap.name} + {scrap.category}
satr-rate - 4.0 + {parseFloat((scrap.totalRating / scrap.ratingCount).toString()).toFixed(1)}
- store + store
))} @@ -35,7 +36,6 @@ export default function BookMark() { not-exist
)} -
); } diff --git a/src/pages/MyPage/hooks/useScraps.ts b/src/pages/MyPage/hooks/useScraps.ts new file mode 100644 index 00000000..74018723 --- /dev/null +++ b/src/pages/MyPage/hooks/useScraps.ts @@ -0,0 +1,10 @@ +import { getScraps } from 'api/mypage'; +import { useQuery } from 'react-query'; + +const useScraps = () => { + const { data, isLoading } = useQuery('scraps', getScraps); + const scraps = data ? data.data.content : []; + return { scraps, isLoading }; +}; + +export default useScraps; From e22e3a059024707a4474bce1832a4f7d741f263a Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Sun, 6 Aug 2023 22:48:16 +0900 Subject: [PATCH 15/45] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0=20=EC=A1=B4?= =?UTF-8?q?=EC=9E=AC=ED=95=98=EC=A7=80=20=EC=95=8A=EA=B1=B0=EB=82=98,=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=EB=B0=9C=EC=83=9D=20=EC=8B=9C=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/components/MyPost/index.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/pages/MyPage/components/MyPost/index.tsx b/src/pages/MyPage/components/MyPost/index.tsx index e9ab9270..d8b97258 100644 --- a/src/pages/MyPage/components/MyPost/index.tsx +++ b/src/pages/MyPage/components/MyPost/index.tsx @@ -34,15 +34,14 @@ export default function MyPost() { {isMobile && } ) : ( - !isMobile - && ( -
- -

둥록된 리뷰가 없어요.

-

다녀온 음식점의 리뷰를 작성해 보세요!

-
- not-exist -
+ ( +
+ +

둥록된 리뷰가 없어요.

+

다녀온 음식점의 리뷰를 작성해 보세요!

+
+ not-exist +
) )} From 0ab52af8d7f0b81e08a39b24663ecb190f093809 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Mon, 7 Aug 2023 02:19:07 +0900 Subject: [PATCH 16/45] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=82=AC=EC=A7=84=20=EB=B3=80=EA=B2=BD=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/svg/mypage/plus.svg | 4 + src/pages/MyPage/MyPage.module.scss | 20 ++++ .../Information/Information.module.scss | 7 +- .../MyPage/components/Information/index.tsx | 12 ++- .../ProfileModal/ProfileModal.module.scss | 99 +++++++++++++++++++ .../MyPage/components/ProfileModal/index.tsx | 46 +++++++++ src/pages/MyPage/index.tsx | 22 ++++- 7 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 src/assets/svg/mypage/plus.svg create mode 100644 src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss create mode 100644 src/pages/MyPage/components/ProfileModal/index.tsx diff --git a/src/assets/svg/mypage/plus.svg b/src/assets/svg/mypage/plus.svg new file mode 100644 index 00000000..6506ea86 --- /dev/null +++ b/src/assets/svg/mypage/plus.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/pages/MyPage/MyPage.module.scss b/src/pages/MyPage/MyPage.module.scss index 501dfa25..46f1f419 100644 --- a/src/pages/MyPage/MyPage.module.scss +++ b/src/pages/MyPage/MyPage.module.scss @@ -12,3 +12,23 @@ margin-top: 0; } } + +.modal-overlay { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgb(0 0 0 / 50%); + opacity: 1; +} + +.bottom-sheet { + height: 50vh; + padding: 28px 24px 35px 28px; + border-radius: 10% 10% 0 0; + + @media (max-height: 500px) { + height: 70vh; + } +} diff --git a/src/pages/MyPage/components/Information/Information.module.scss b/src/pages/MyPage/components/Information/Information.module.scss index ac1c1543..fa7882bd 100644 --- a/src/pages/MyPage/components/Information/Information.module.scss +++ b/src/pages/MyPage/components/Information/Information.module.scss @@ -29,7 +29,6 @@ @include media.media-breakpoint-down(mobile) { width: 46px; height: 46px; - margin-right: 16px; } } @@ -119,7 +118,13 @@ } .profile { + all: unset; + display: flex; + overflow: hidden; position: relative; + outline: none; + border-radius: 50%; + margin-right: 16px; &:hover { filter: brightness(50%); diff --git a/src/pages/MyPage/components/Information/index.tsx b/src/pages/MyPage/components/Information/index.tsx index 4141c60f..598bbc6c 100644 --- a/src/pages/MyPage/components/Information/index.tsx +++ b/src/pages/MyPage/components/Information/index.tsx @@ -5,16 +5,21 @@ import useMediaQuery from 'utils/hooks/useMediaQuery'; import useMyProfile from 'pages/MyPage/hooks/useMyProfile'; import styles from './Information.module.scss'; -export default function Information() { +interface InformationProps { + openModal:(url:string | undefined) => void +} + +export default function Information({ openModal }:InformationProps) { const { isMobile } = useMediaQuery(); const { profile } = useMyProfile(); + return (
-
+
+
{profile?.nickname} @@ -41,7 +46,6 @@ export default function Information() {
)} {isMobile && option} -
); } diff --git a/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss b/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss new file mode 100644 index 00000000..d635e71c --- /dev/null +++ b/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss @@ -0,0 +1,99 @@ +.phrase { + display: block; + color: #000000; + font-size: 18px; + font-weight: 700; + line-height: 22.46px; + margin-bottom: 30px; +} + +.form { + &__upload { + background: inherit; + border: none; + box-shadow: none; + border-radius: 0; + padding: 0; + display: block; + margin: 0 auto; + margin-bottom: 25px; + + &--image { + position: relative; + } + + &--profile { + width: 100px; + height: 100px; + border-radius: 50%; + } + + &--plus { + position: absolute; + bottom: 3px; + right: 3px; + border-radius: 50%; + } + } + + &__name { + position: relative; + margin: 0 auto; + width: 48%; + margin-bottom: 50px; + } + + &__buttons { + display: flex; + width: 100%; + justify-content: space-between; + margin: 0 auto; + + &--cancle { + all: unset; + width: 45%; + height: 40px; + font-size: 16px; + color: #ffffff; + background-color: #c4c4c4; + outline: 0; + text-align: center; + border-radius: 999px; + } + + &--complete { + all: unset; + width: 45%; + height: 40px; + font-size: 16px; + color: #ffffff; + background-color: #ff7f23; + outline: 0; + text-align: center; + border-radius: 999px; + } + } +} + +.name { + &__input { + display: block; + width: calc(100% - 40px); + border: none; + margin: 0 auto; + border-bottom: 1px solid #c4c4c4; + padding: 4px 10px; + padding-right: 30px; + position: relative; + outline: none; + } + + &__length { + display: block; + width: 20px; + right: 3px; + top: 5px; + position: absolute; + font-size: 10px; + } +} diff --git a/src/pages/MyPage/components/ProfileModal/index.tsx b/src/pages/MyPage/components/ProfileModal/index.tsx new file mode 100644 index 00000000..ea0f823a --- /dev/null +++ b/src/pages/MyPage/components/ProfileModal/index.tsx @@ -0,0 +1,46 @@ +import defaultImage from 'assets/images/follow/default-image.png'; +import plus from 'assets/svg/mypage/plus.svg'; +import { toast } from 'react-toastify'; +import { useState } from 'react'; +import styles from './ProfileModal.module.scss'; + +interface ProfileModalProps { + imgUrl:string | undefined +} + +export default function ProfileModal({ imgUrl }:ProfileModalProps) { + const [nameLength, setName] = useState(7); + const changeName = (e:React.ChangeEvent) => { + if (e.target.value.length <= 10) { + setName(e.target.value.length); + } + }; + const closeModal = () => { + toast.dismiss(); + }; + return ( +
+ + 이병건이올씨다님, +
+ 프로필을 변경하시겠어요? +
+
+ +
+ changeName(e)} className={styles.name__input} maxLength={10} /> + {`${nameLength}/10`} +
+
+ + +
+
+
+ ); +} diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index 5d8d9a55..667870d9 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -2,25 +2,41 @@ import BottomNavigation from 'components/common/BottomNavigation'; import TopNavigation from 'components/common/TopNavigation'; import useMediaQuery from 'utils/hooks/useMediaQuery'; import { useState } from 'react'; +import { toast } from 'react-toastify'; import Information from './components/Information'; import BoardSelector from './components/BoardSelector'; import BookMark from './components/BookMark'; -import style from './MyPage.module.scss'; +import styles from './MyPage.module.scss'; import MyPost from './components/MyPost'; +import ProfileModal from './components/ProfileModal'; export default function MyPage() { const { isMobile } = useMediaQuery(); const [board, setBoard] = useState('MYPOST'); + const [isOpen, setOpen] = useState(false); + const openModal = (url:string | undefined) => { + setOpen(true); + toast(, { + position: 'bottom-center', + autoClose: false, + closeOnClick: false, + closeButton: false, + draggable: false, + onClose: () => setOpen(false), + className: styles['bottom-sheet'], + }); + }; return ( <> {!isMobile && } -
- +
+ {board === 'MYPOST' && } {board === 'BOOKMARK' && }
{isMobile && } + {isOpen &&
} ); } From 17281f55ad27d78ec20c32e3db45481e54a210bb Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:45:38 +0900 Subject: [PATCH 17/45] =?UTF-8?q?sylte:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=AA=A8=EB=8B=AC=20height=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/MyPage.module.scss | 11 +++++++---- .../components/ProfileModal/ProfileModal.module.scss | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pages/MyPage/MyPage.module.scss b/src/pages/MyPage/MyPage.module.scss index 46f1f419..a750e391 100644 --- a/src/pages/MyPage/MyPage.module.scss +++ b/src/pages/MyPage/MyPage.module.scss @@ -17,18 +17,21 @@ position: fixed; top: 0; left: 0; - width: 100vw; - height: 100vh; + right: 0; + bottom: 0; + + // width: 200vw; + // height: 100vh; background-color: rgb(0 0 0 / 50%); opacity: 1; } .bottom-sheet { - height: 50vh; + height: 400px; padding: 28px 24px 35px 28px; border-radius: 10% 10% 0 0; @media (max-height: 500px) { - height: 70vh; + height: 300px; } } diff --git a/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss b/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss index d635e71c..8332cab3 100644 --- a/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss +++ b/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss @@ -92,7 +92,7 @@ display: block; width: 20px; right: 3px; - top: 5px; + top: 7px; position: absolute; font-size: 10px; } From 6133c2869e1a2683a88997fa40e4cac246ada8f9 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:10:50 +0900 Subject: [PATCH 18/45] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B3=80=EA=B2=BD=20api=20?= =?UTF-8?q?=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mypage/entity.ts | 9 ++++ src/api/mypage/index.ts | 16 +++++- .../ProfileModal/ProfileModal.module.scss | 7 +++ .../MyPage/components/ProfileModal/index.tsx | 14 ++++-- src/pages/MyPage/hooks/useChangeProfile.ts | 49 +++++++++++++++++++ 5 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 src/pages/MyPage/hooks/useChangeProfile.ts diff --git a/src/api/mypage/entity.ts b/src/api/mypage/entity.ts index 09ad08c8..6eb36de8 100644 --- a/src/api/mypage/entity.ts +++ b/src/api/mypage/entity.ts @@ -33,3 +33,12 @@ export type Scrap = { export interface ScrapResponse { content: Scrap[] } + +export interface PatchProfileImageResponse { + profileImage: { + id: number, + originalName: string, + path: string, + url: string + } +} diff --git a/src/api/mypage/index.ts b/src/api/mypage/index.ts index a8a60b3b..9ebd1532 100644 --- a/src/api/mypage/index.ts +++ b/src/api/mypage/index.ts @@ -1,4 +1,6 @@ -import { ReviewedShopsResponse, ReviewsResPonse, ScrapResponse } from './entity'; +import { + PatchProfileImageResponse, ReviewedShopsResponse, ReviewsResPonse, ScrapResponse, +} from './entity'; import myPageApi from './mypageApiClient'; export const getReviewedShops = async () => myPageApi.get('/review/shops'); @@ -6,3 +8,15 @@ export const getReviewedShops = async () => myPageApi.get export const getReviews = async (placeId:string) => myPageApi.get(`/review/shop/${placeId}`); export const getScraps = async () => myPageApi.get('/scraps'); + +export const patchProfileImage = async (image:FormData | null) => myPageApi.patch('/user/profile', image, { + headers: { + 'Content-Type': 'multipart/form-data', + }, +}); + +export const patchDefaultImage = async () => myPageApi.patch('/user/profile', { + headers: { + 'Content-Type': 'multipart/form-data', + }, +}); diff --git a/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss b/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss index 8332cab3..48d637ef 100644 --- a/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss +++ b/src/pages/MyPage/components/ProfileModal/ProfileModal.module.scss @@ -8,6 +8,10 @@ } .form { + &__image-input { + display: none; + } + &__upload { background: inherit; border: none; @@ -19,6 +23,9 @@ margin-bottom: 25px; &--image { + width: 100px; + height: 100px; + margin: 0 auto; position: relative; } diff --git a/src/pages/MyPage/components/ProfileModal/index.tsx b/src/pages/MyPage/components/ProfileModal/index.tsx index ea0f823a..87943c7a 100644 --- a/src/pages/MyPage/components/ProfileModal/index.tsx +++ b/src/pages/MyPage/components/ProfileModal/index.tsx @@ -2,6 +2,7 @@ import defaultImage from 'assets/images/follow/default-image.png'; import plus from 'assets/svg/mypage/plus.svg'; import { toast } from 'react-toastify'; import { useState } from 'react'; +import useChangeProfile from 'pages/MyPage/hooks/useChangeProfile'; import styles from './ProfileModal.module.scss'; interface ProfileModalProps { @@ -18,6 +19,9 @@ export default function ProfileModal({ imgUrl }:ProfileModalProps) { const closeModal = () => { toast.dismiss(); }; + const { + onChange, onclick, previewUrl, + } = useChangeProfile(); return (
@@ -25,13 +29,15 @@ export default function ProfileModal({ imgUrl }:ProfileModalProps) {
프로필을 변경하시겠어요?
-
- +
changeName(e)} className={styles.name__input} maxLength={10} /> {`${nameLength}/10`} diff --git a/src/pages/MyPage/hooks/useChangeProfile.ts b/src/pages/MyPage/hooks/useChangeProfile.ts new file mode 100644 index 00000000..b68aa66d --- /dev/null +++ b/src/pages/MyPage/hooks/useChangeProfile.ts @@ -0,0 +1,49 @@ +import { patchDefaultImage, patchProfileImage } from 'api/mypage'; +import React, { useEffect, useState } from 'react'; +import { useQuery } from 'react-query'; + +const useChangeProfile = () => { + const [image, setImage] = useState(null); + const [previewUrl, setUrl] = useState(null); + // const [nickname, setNickname] = useState(nickname); + const { isError: imageError, data: imageResponse, refetch: imageRefetch } = useQuery(['changeImage', image], () => patchProfileImage(image), { enabled: false }); + const { refetch: defaultRefetch } = useQuery(['changeImage', image], () => patchDefaultImage(), { enabled: false }); + // const { isError: nicknameError, data: nicknameResponse, refetch: nicknameRefetch + const getImageUrl = (file:Blob) => { + const reader = new FileReader(); + reader.onload = () => { + setUrl(reader.result as string); + }; + reader.readAsDataURL(file); + }; + const onChange = (e:React.ChangeEvent) => { + const formData = new FormData(); + if (e.target.files) { + const imageFile = e.target.files[0]; + formData.append('profile', imageFile); + setImage(formData); + getImageUrl(e.target.files[0]); + } + }; + + const onclick = async (e:React.FormEvent) => { + e.preventDefault(); + if (image) { + imageRefetch(); + } else { + defaultRefetch(); + } + }; + + useEffect(() => { + if (imageResponse) { + window.location.reload(); + } + }, [imageResponse]); + + return { + onChange, imageResponse, imageError, onclick, previewUrl, + }; +}; + +export default useChangeProfile; From a473640a921e90b7c0ce144a13abf61f72eacb58 Mon Sep 17 00:00:00 2001 From: HAEROOL <71335694+HAEROOL@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:14:48 +0900 Subject: [PATCH 19/45] =?UTF-8?q?refactor:=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20=ED=95=A8=EC=88=98=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/components/ProfileModal/index.tsx | 4 ++-- src/pages/MyPage/hooks/useChangeProfile.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/MyPage/components/ProfileModal/index.tsx b/src/pages/MyPage/components/ProfileModal/index.tsx index 87943c7a..94ccf93d 100644 --- a/src/pages/MyPage/components/ProfileModal/index.tsx +++ b/src/pages/MyPage/components/ProfileModal/index.tsx @@ -20,7 +20,7 @@ export default function ProfileModal({ imgUrl }:ProfileModalProps) { toast.dismiss(); }; const { - onChange, onclick, previewUrl, + onChange, onClick, previewUrl, } = useChangeProfile(); return (
@@ -29,7 +29,7 @@ export default function ProfileModal({ imgUrl }:ProfileModalProps) {
프로필을 변경하시겠어요? - onclick(e)}> + onClick(e)}>