From 920e5d47128ddc488b67c62d66e3d7f94b034a28 Mon Sep 17 00:00:00 2001 From: gyeongza Date: Wed, 20 Sep 2023 18:42:46 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=A7=8C=EB=A3=8C=20=EC=98=A4=EB=A5=98=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/useFetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/useFetch.ts b/frontend/src/hooks/useFetch.ts index fc3354e98..09c4f5215 100644 --- a/frontend/src/hooks/useFetch.ts +++ b/frontend/src/hooks/useFetch.ts @@ -22,7 +22,7 @@ export const useFetch = () => { showErrorToast({ title: ERROR_TITLE.NO_PERMISSION, - description: ['JW007', 'JW008', 'JW009'].includes(apiError.errorCode) + description: ['JW007', 'JW008', 'JW009', 'JW010'].includes(apiError.errorCode) ? ERROR_DESCRIPTION.TOKEN_EXPIRATION : ERROR_DESCRIPTION.NO_TOKEN, }); From cb3e1420df8e479ba9401f5182312aaf0a160b79 Mon Sep 17 00:00:00 2001 From: gyeongza Date: Wed, 20 Sep 2023 18:55:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EC=A7=80=EC=9B=90=ED=95=9C=20?= =?UTF-8?q?=EC=84=9C=ED=8F=AC=ED=84=B0=20=EC=97=86=EC=9D=84=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EB=B2=84=ED=8A=BC=20=EC=88=A8=EA=B8=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyPage/MyPagePostButton/MyPagePostButton.tsx | 11 ++++++++++- .../MyPage/MyPagePostItem/MyPagePostItem.tsx | 1 + frontend/src/components/common/Button/Button.tsx | 11 +++++++---- .../src/mocks/data/myPagePost/myPagePostList.json | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/MyPage/MyPagePostButton/MyPagePostButton.tsx b/frontend/src/components/MyPage/MyPagePostButton/MyPagePostButton.tsx index 888fb8c19..066014baa 100644 --- a/frontend/src/components/MyPage/MyPagePostButton/MyPagePostButton.tsx +++ b/frontend/src/components/MyPage/MyPagePostButton/MyPagePostButton.tsx @@ -14,10 +14,18 @@ interface Props { reviewStatus: ReviewStatus; isRunner: boolean; supporterId?: number; + applicantCount: number; handleDeletePost: (handleDeletePost: number) => void; } -const MyPagePostButton = ({ runnerPostId, reviewStatus, isRunner, supporterId, handleDeletePost }: Props) => { +const MyPagePostButton = ({ + runnerPostId, + reviewStatus, + isRunner, + supporterId, + applicantCount, + handleDeletePost, +}: Props) => { const { goToSupportSelectPage, goToSupporterFeedbackPage } = usePageRouter(); const { isMobile } = useViewport(); @@ -78,6 +86,7 @@ const MyPagePostButton = ({ runnerPostId, reviewStatus, isRunner, supporterId, h fontWeight={700} width={isMobile ? '100%' : '180px'} height="40px" + disabled={applicantCount < 1} onClick={isRunner ? handleClickSupportSelectButton : handleClickCancelReviewButton} > {isRunner ? '서포터 선택하기' : '리뷰 제안 취소'} diff --git a/frontend/src/components/MyPage/MyPagePostItem/MyPagePostItem.tsx b/frontend/src/components/MyPage/MyPagePostItem/MyPagePostItem.tsx index 6f64ab660..e25d1c176 100644 --- a/frontend/src/components/MyPage/MyPagePostItem/MyPagePostItem.tsx +++ b/frontend/src/components/MyPage/MyPagePostItem/MyPagePostItem.tsx @@ -65,6 +65,7 @@ const MyPagePostItem = ({ { const Button = ({ colorTheme, children, - width, - height, type, fontSize, fontWeight, onClick, ariaLabel, dataType, + disabled, + ...buttonProps }: Props) => { return ( {children} @@ -57,6 +57,7 @@ const S = { $height?: string | number; $fontSize?: string | number; $fontWeight?: number; + $disabled?: boolean; }>` ${({ $colorTheme }) => themeStyles[$colorTheme]} @@ -68,6 +69,8 @@ const S = { font-size: ${({ $fontSize }) => $fontSize || '18px'}; font-weight: ${({ $fontWeight }) => $fontWeight || '400'}; + visibility: ${({ $disabled }) => ($disabled ? 'hidden' : 'visible')}; + @media (max-width: 768px) { width: ${({ $width }) => $width || '180px'}; height: 100%; diff --git a/frontend/src/mocks/data/myPagePost/myPagePostList.json b/frontend/src/mocks/data/myPagePost/myPagePostList.json index 93039c49b..c9a378518 100644 --- a/frontend/src/mocks/data/myPagePost/myPagePostList.json +++ b/frontend/src/mocks/data/myPagePost/myPagePostList.json @@ -6,7 +6,7 @@ "deadline": "2020-10-13T11:30", "tags": ["java", "JAVA"], "reviewStatus": "NOT_STARTED", - "applicantCount": 4, + "applicantCount": 0, "watchedCount": 125, "supporterId": 1 },