From ef05979ae3f718151de741f600234b7825868c11 Mon Sep 17 00:00:00 2001 From: gyeongza Date: Tue, 20 Feb 2024 17:57:50 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20?= =?UTF-8?q?=EA=B0=9C=EC=88=98=20api=20=ED=98=B8=EC=B6=9C=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20=EB=94=9C=EB=A0=88=EC=9D=B4=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/cypress/e2e/app.cy.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/cypress/e2e/app.cy.ts b/frontend/cypress/e2e/app.cy.ts index c9b221aa4..a323c5179 100644 --- a/frontend/cypress/e2e/app.cy.ts +++ b/frontend/cypress/e2e/app.cy.ts @@ -23,6 +23,8 @@ describe('러너 E2E 테스트', () => { }); it('게시글을 검색한다.', () => { + cy.wait(1000); + cy.contains('리뷰 완료').click(); cy.wait(500); From 3f582e96194549183ad35eb2ae8f5196534a8ca6 Mon Sep 17 00:00:00 2001 From: gyeongza Date: Tue, 20 Feb 2024 18:00:27 +0900 Subject: [PATCH 2/3] =?UTF-8?q?design:=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20form=20margin=20=EC=88=98=EC=A0=95=20(?= =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/RunnerPostCreatePage.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/pages/RunnerPostCreatePage.tsx b/frontend/src/pages/RunnerPostCreatePage.tsx index c438ea50e..dcffa7c15 100644 --- a/frontend/src/pages/RunnerPostCreatePage.tsx +++ b/frontend/src/pages/RunnerPostCreatePage.tsx @@ -278,6 +278,10 @@ const S = { &:first-child { margin-top: 60px; + + @media (max-width: 768px) { + margin-top: 20px; + } } `, From 78dc0219a0d0fc246cef8229a7eb49b422663e36 Mon Sep 17 00:00:00 2001 From: gyeongza Date: Tue, 20 Feb 2024 19:08:13 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20?= =?UTF-8?q?=EA=B0=9C=EC=88=98=20api=20=ED=83=80=EC=9E=85=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 --- frontend/src/apis/apis.ts | 4 ++-- .../RunnerPostFilter/RunnerPostFilter.tsx | 17 ++++++++++++----- frontend/src/hooks/query/usePostCount.ts | 6 +++--- frontend/src/mocks/data/postCount.json | 10 ++++------ frontend/src/pages/MainPage.tsx | 12 +++++++++++- frontend/src/types/runnerPost.ts | 4 ---- 6 files changed, 32 insertions(+), 21 deletions(-) diff --git a/frontend/src/apis/apis.ts b/frontend/src/apis/apis.ts index f775eadf5..0f2fe550c 100644 --- a/frontend/src/apis/apis.ts +++ b/frontend/src/apis/apis.ts @@ -5,7 +5,7 @@ import { GetOtherSupporterPostCountResponse, GetRunnerPostResponse, getRunnerPostRequestParams, - GetPostCountResponse, + PostCount, } from '@/types/runnerPost'; import { GetSearchTagResponse } from '@/types/tags'; import { @@ -109,7 +109,7 @@ export const getSupporterRank = () => { }; export const getPostCount = () => { - return request.get('/posts/runner/count', false); + return request.get('/posts/runner/count', false); }; export const postRunnerPostCreation = (formData: CreateRunnerPostRequest) => { diff --git a/frontend/src/components/RunnerPost/RunnerPostFilter/RunnerPostFilter.tsx b/frontend/src/components/RunnerPost/RunnerPostFilter/RunnerPostFilter.tsx index d08a8513c..47dae1b6c 100644 --- a/frontend/src/components/RunnerPost/RunnerPostFilter/RunnerPostFilter.tsx +++ b/frontend/src/components/RunnerPost/RunnerPostFilter/RunnerPostFilter.tsx @@ -14,7 +14,6 @@ interface Props { const RunnerPostFilter = ({ reviewStatus, handleClickRadioButton }: Props) => { const { data: totalCount } = usePostCount(); - const { isMobile } = useViewport(); function transformPostCountToReviewStatusFilter(postCount: PostCount): { [key in ReviewStatusFilter]: number } { const all = Object.values(postCount).reduce((acc, currentValue) => acc + currentValue, 0); @@ -28,10 +27,6 @@ const RunnerPostFilter = ({ reviewStatus, handleClickRadioButton }: Props) => { }; } - if (!totalCount) { - return
; - } - const reviewStatusCounts = transformPostCountToReviewStatusFilter(totalCount); return ( @@ -78,6 +73,18 @@ const appear = keyframes` } `; +const pulseAnimation = keyframes` + 0% { + background-color: #e0e0e0; + } + 50% { + background-color: #f0f0f0; + } + 100% { + background-color: #e0e0e0; + } +`; + const underLine = css` content: ''; margin-top: 5px; diff --git a/frontend/src/hooks/query/usePostCount.ts b/frontend/src/hooks/query/usePostCount.ts index de1ebabdb..5305d055b 100644 --- a/frontend/src/hooks/query/usePostCount.ts +++ b/frontend/src/hooks/query/usePostCount.ts @@ -1,12 +1,12 @@ import { getPostCount } from '@/apis/apis'; import { PostCount } from '@/types/runnerPost'; -import { useQuery } from '@tanstack/react-query'; +import { useQuery, useSuspenseQuery } from '@tanstack/react-query'; export const usePostCount = () => { - const queryResult = useQuery({ + const queryResult = useSuspenseQuery({ queryKey: ['runnerPostCount'], - queryFn: () => getPostCount().then((res) => res.data), + queryFn: () => getPostCount().then((res) => res), }); return { diff --git a/frontend/src/mocks/data/postCount.json b/frontend/src/mocks/data/postCount.json index 126177116..a0befea80 100644 --- a/frontend/src/mocks/data/postCount.json +++ b/frontend/src/mocks/data/postCount.json @@ -1,8 +1,6 @@ { - "data": { - "notStarted": 1, - "inProgress": 2, - "overdue": 3, - "done": 4 - } + "notStarted": 1, + "inProgress": 2, + "overdue": 3, + "done": 4 } diff --git a/frontend/src/pages/MainPage.tsx b/frontend/src/pages/MainPage.tsx index f761a45ff..21032abe5 100644 --- a/frontend/src/pages/MainPage.tsx +++ b/frontend/src/pages/MainPage.tsx @@ -7,7 +7,7 @@ import { usePageRouter } from '@/hooks/usePageRouter'; import { useRunnerPostList } from '@/hooks/query/useRunnerPostList'; import useViewport from '@/hooks/useViewport'; import { ReviewStatus } from '@/types/runnerPost'; -import { useContext, useEffect, useState } from 'react'; +import { useContext, useState } from 'react'; import { styled } from 'styled-components'; import { isLogin } from '@/apis/auth'; import SideWidget from '@/components/common/SideWidget/SideWidget'; @@ -124,6 +124,16 @@ const MainPage = () => { export default MainPage; +const FilterSkeleton = styled.div` + height: 104px; + width: 442px; + + @media (max-width: 768px) { + height: 92px; + width: 340px; + } +`; + const S = { MainContainer: styled.div` min-width: 480px; diff --git a/frontend/src/types/runnerPost.ts b/frontend/src/types/runnerPost.ts index 9903cbb9f..626da71f7 100644 --- a/frontend/src/types/runnerPost.ts +++ b/frontend/src/types/runnerPost.ts @@ -26,10 +26,6 @@ export interface PostCount { done: number; } -export interface GetPostCountResponse { - data: PostCount; -} - export interface RunnerProfile { name: string; imageUrl: string;