Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

페이지네이션 로직 변경 및 메인페이지 전체 필터 추가 #620

Merged
merged 85 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
0627ad1
chore: react query 라이브러리 추가
Sep 30, 2023
bb5aed9
refactor: 사용하지 않는 fetch 모듈 제거
Sep 30, 2023
86f526c
feat: api 타입 수정 및 추가
Sep 30, 2023
b3af60a
feat: QueryClientProvider 추가
Sep 30, 2023
2450416
feat: fetch 추상화 함수 추가
Sep 30, 2023
3a58b3b
feat: fetch 함수 에러 처리 추가
Sep 30, 2023
b3a2164
MainPage api 함수 추가
Sep 30, 2023
64edce0
RunnerPost hook(react-query) 추가
Sep 30, 2023
ef79278
useSearchTag hook(react-query) 추가
Sep 30, 2023
77c5cc7
feat: runnerPost 핸들러 함수 및 mock 데이터 변경
Sep 30, 2023
268144a
feat: MainPage react-query 적용
Sep 30, 2023
7f069b7
feat: RunnerPostSearchBox react-query 적용
Sep 30, 2023
7202e46
feat: getHeaderProfile api 추가
Oct 1, 2023
2d71940
feat: useHeaderProfile react-query hook 추가 및 적용
Oct 1, 2023
ee8a920
fix: api 요청 성공 시에도 에러 토스트가 작동하는 오류 수정
Oct 1, 2023
5c43940
feat: useRunnerPostCreation react-query hook 추가 및 queryClient 분할
Oct 1, 2023
f8fa961
feat: getMyRunnerProfile, getMySupporterProfile api 추가
Oct 1, 2023
30c25cb
feat: useMyGithubUrl react-query hook 추가
Oct 1, 2023
5e34d02
feat: useMyRunnerProfile react-query hook 추가
Oct 1, 2023
4cea3eb
feat: runnerPostCreate페이지 react-query hook 추가
Oct 1, 2023
3023005
refactor: react query hook 폴더 변경
Oct 1, 2023
fb0a846
fix: 캐싱값이 refresh되지 않는 현상 수정
Oct 1, 2023
83cab5d
feat: patchReviewCancelation, patchReviewComplete api 추가
Oct 1, 2023
ec24446
feat: useReviewCancelation react-query hook 추가
Oct 1, 2023
5985dfd
feat: useReviewComplete react-query hook 추가
Oct 1, 2023
5159199
feat: MyPagePostButton react-query 적용
Oct 1, 2023
9db48c6
style: 코드 수정 요청 주석 추가
Oct 1, 2023
15b6414
feat: patchRunnerProfile, patchSupporterProfile api 추가
Oct 1, 2023
e13f45f
feat: useRunnerProfileEdit, useSupporterProfileEdit react query hook 추가
Oct 1, 2023
5694f60
feat: staleTime 추가
Oct 1, 2023
56d7f98
fix: 잘못된 fetch method 수정
Oct 1, 2023
1ddeece
feat: patchMySupporterProfile api 추가
Oct 1, 2023
8e43ed9
style: 주석 설명 추가
Oct 1, 2023
b3c2ab5
refactor: useRunnerProfile hook을suspense query를 사용하도록 수정
Oct 1, 2023
799e940
feat: useMySupporterProfileEdit react qeury hook 추가
Oct 1, 2023
f907843
feat: 테스트를 위한 핸들러 함수 지연시간 추가
Oct 1, 2023
f7cafcf
feat: ProfileEditPage react query 적용
Oct 1, 2023
174e32d
Merge remote-tracking branch 'upstream/dev/FE' into feat/599
Oct 1, 2023
e748cd4
feat: useRunnerPostCreation 결과 페이지로 이동하도록 수정
Oct 1, 2023
b2f4a67
즉시 refetch가 필요한 경우 invalidQueries를 refetchQueries를 사용하도록 변경
Oct 2, 2023
4d0ae94
feat: getProposedSupporterList, patchProposedSupporterSelection api 추가
Oct 2, 2023
c5af2c7
feat: useProposedSupporterList, useSelectionSupporter react qeury hoo…
Oct 2, 2023
e490e88
SupporterSelectPage react query 적용
Oct 2, 2023
44f2e7a
feat: getRunnerPostDetail, postReviewSuggestionWithMessage, deleteRun…
Oct 2, 2023
505e596
useReviewSuggestion, useRunnerPostDelete, useRunnerPostDetail react q…
Oct 2, 2023
5dfa893
RunnerPostDetailPage react qeury 적용
Oct 2, 2023
4657428
feat: postFeedbackToSupporter api 추가
Oct 2, 2023
cd0a001
feat: getMyRunnerPost, getMySupporterPost api 추가
Oct 2, 2023
4ea1aff
refactor: 페이지네이션 api에서 any 타입 제거
Oct 2, 2023
45c9c37
fix: 잘못된 api url 수정
Oct 2, 2023
aceceac
fix: 서버로 부터 응답값이 없을 경우 에러 처리 추가
Oct 2, 2023
57a645e
feat: useMyPostList react query hook 추가
Oct 2, 2023
4d69336
feat: MyPage react qeury 적용
Oct 2, 2023
7bf14de
fix: 잘못된 url 수정
Oct 2, 2023
d2fbff4
fix: 잘못된 url 수정
Oct 2, 2023
5943bbe
fix: 잘못된 상태의 게시물이 조회되는 오류 수정
Oct 2, 2023
aaa3c59
feat: 피드백 페이지 react qeury 적용
Oct 2, 2023
fea50cc
refactor: 사용하지 않는 import 제거
Oct 2, 2023
223758e
fix: 잘못된 키값 수정
Oct 2, 2023
90e5826
feat: 타인 프로필 조회 api, 미션 브랜치 생성 api 추가
Oct 2, 2023
0bf07ff
feat: NoticePage react query 적용
Oct 2, 2023
8f7d94e
useOtherRunnerProfile, useOtherSupporterPost, useOtherSupporterProfil…
Oct 2, 2023
70cdc70
타인의 프로필 페이지 react query 적용
Oct 2, 2023
bd42219
style: 사용하지 않는 import 제거
Oct 2, 2023
929b704
fix: fetch 메서드 then catch 순서 변경
Oct 5, 2023
6a9fe51
fix: 에러가 제대로 포착되지 않는 오류 수정
Oct 5, 2023
bea2351
refactor: acync 제거
Oct 5, 2023
cb1cade
style: 중괄호 제거
Oct 5, 2023
ac0e1c4
refactor: 사용하지 않는 props 제거
Oct 5, 2023
c6a9aa6
feat: 최상위 suspend에 로딩 페이지 삽입
Oct 5, 2023
11897d0
style: 삼항 연산자 적용
Oct 5, 2023
e68d121
style: async 제거
Oct 5, 2023
e0aaad3
feat: 전역 staleTime 추가
Oct 5, 2023
d3a83f6
Merge remote-tracking branch 'upstream/dev/FE' into feat/599
Oct 5, 2023
aa97b71
fix: 누락된 muatation 함수 수정 반영
Oct 5, 2023
ab7feaf
feat: hook async 제거
Oct 5, 2023
d89b5f1
feat: 로딩페이지 추가
Oct 5, 2023
c8d4688
feat: 메인페이지 전체 필터 추가
Oct 6, 2023
8c90372
feat: api 인자 수정
Oct 6, 2023
38960e9
feat: 마이페이지, 타인의 서포터 프로필 페이지 페이지네이션 방식 수정
Oct 6, 2023
f17b892
Merge remote-tracking branch 'upstream/dev/FE' into feat/600
Oct 6, 2023
86d2bcf
fix: 전체 필터 더보기 버튼을 누를 시 다른 필터값 데이터와 겹쳐지는 문제 수정
Oct 10, 2023
fc1c6ea
refactor: reviewStatus 값이 없을경우 타입을 Null로 수정
Oct 10, 2023
477a729
Merge branch 'dev/FE' into feat/600
tkdrb12 Oct 10, 2023
77824f6
feat: 서포터 프로필 페이지 총 게시물 수 제거
Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions frontend/src/apis/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
GetDetailedRunnerPostResponse,
GetRunnerPostResponse,
ReviewStatus,
getRunnerPostRequestParams,
} from '@/types/runnerPost';
import { GetSearchTagResponse } from '@/types/tags';
import {
Expand All @@ -12,13 +13,14 @@ import {
GetSupporterProfileResponse,
PatchRunnerProfileRequest,
PatchSupporterProfileRequest,
getSupporterPostRequestParams,
} from '@/types/profile';
import { GetMyPagePostResponse } from '@/types/myPage';
import { GetMyPagePostResponse, getMyPostRequestParams } from '@/types/myPage';
import { PostFeedbackRequest } from '@/types/feedback';
import { GetSupporterCandidateResponse } from '@/types/supporterCandidate';
import { GetNotificationResponse } from '@/types/notification';

export const getRunnerPost = (limit: number, reviewStatus?: ReviewStatus, cursor?: number, tagName?: string) => {
export const getRunnerPost = ({ limit, reviewStatus, cursor, tagName }: getRunnerPostRequestParams) => {
const params = new URLSearchParams({
limit: limit.toString(),
...(cursor && { cursor: cursor.toString() }),
Expand All @@ -29,26 +31,37 @@ export const getRunnerPost = (limit: number, reviewStatus?: ReviewStatus, cursor
return request.get<GetRunnerPostResponse>(`/posts/runner?${params.toString()}`, false);
};

export const getMyRunnerPost = (size: number, page: number, reviewStatus?: ReviewStatus) => {
export const getMyRunnerPost = ({ limit, cursor, reviewStatus }: getMyPostRequestParams) => {
const params = new URLSearchParams({
size: size.toString(),
...(page && { page: page.toString() }),
limit: limit.toString(),
...(cursor && { cursor: cursor.toString() }),
...(reviewStatus && { reviewStatus }),
});

return request.get<GetMyPagePostResponse>(`/posts/runner/me/runner?${params.toString()}`, true);
};

export const getMySupporterPost = (size: number, page: number, reviewStatus?: ReviewStatus) => {
export const getMySupporterPost = ({ limit, cursor, reviewStatus }: getMyPostRequestParams) => {
const params = new URLSearchParams({
size: size.toString(),
...(page && { page: page.toString() }),
limit: limit.toString(),
...(cursor && { cursor: cursor.toString() }),
...(reviewStatus && { reviewStatus }),
});

return request.get<GetMyPagePostResponse>(`/posts/runner/me/supporter?${params.toString()}`, true);
};

export const getOtherSupporterPost = ({ limit, cursor, supporterId }: getSupporterPostRequestParams) => {
const params = new URLSearchParams({
limit: limit.toString(),
supporterId: supporterId.toString(),
reviewStatus: 'DONE',
...(cursor && { cursor: cursor.toString() }),
});

return request.get<GetRunnerPostResponse>(`/posts/runner/search?${params.toString()}`, false);
};

export const getSearchTag = (keyword: string) => {
return request.get<GetSearchTagResponse>(`/tags/search?tagName=${keyword}`, false);
};
Expand Down Expand Up @@ -85,15 +98,6 @@ export const getOtherSupporterProfile = (userId: number) => {
return request.get<GetRunnerProfileResponse>(`/profile/supporter/${userId}`, false);
};

export const getOtherSupporterPost = (supporterId: number) => {
const params = new URLSearchParams([
['supporterId', supporterId.toString()],
['reviewStatus', 'DONE'],
]);

return request.get<GetRunnerPostResponse>(`/posts/runner/search?${params.toString()}`, false);
};

export const postRunnerPostCreation = (formData: CreateRunnerPostRequest) => {
const body = JSON.stringify(formData);
return request.post<void>(`/posts/runner`, body);
Expand Down Expand Up @@ -147,4 +151,4 @@ export const deleteRunnerPost = (runnerPostId: number) => {

export const deleteNotification = (notificationsId: number) => {
return request.delete<void>(`/notifications/${notificationsId}`);
};
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { css, keyframes, styled } from 'styled-components';
import { REVIEW_STATUS_LABEL_TEXT } from '@/constants';
import { REVIEW_STATUS_FILTER_TEXT, REVIEW_STATUS_LABEL_TEXT } from '@/constants';

interface Props {
reviewStatus: string;
Expand All @@ -11,7 +11,7 @@ const RunnerPostFilter = ({ reviewStatus, handleClickRadioButton }: Props) => {
return (
<S.FilterContainer>
<S.LabelList>
{Object.entries(REVIEW_STATUS_LABEL_TEXT).map(([value, text]) => (
{Object.entries(REVIEW_STATUS_FILTER_TEXT).map(([value, text]) => (
<S.StatusLabel key={value}>
<S.RadioButton
type="radio"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, { useRef, useState } from 'react';
import TagIcon from '@/assets/tag-icon.svg';
import { styled } from 'styled-components';
import RunnerPostFilter from '../RunnerPostFilter/RunnerPostFilter';
import { ReviewStatus } from '@/types/runnerPost';
import { ReviewStatus, ReviewStatusFilter } from '@/types/runnerPost';
import { useSearchTag } from '@/hooks/query/useSearchTag';

interface Props {
reviewStatus: ReviewStatus;
setReviewStatus: React.Dispatch<React.SetStateAction<ReviewStatus>>;
reviewStatus: ReviewStatus | null;
setReviewStatus: React.Dispatch<React.SetStateAction<ReviewStatus | null>>;
setEnteredTag: React.Dispatch<React.SetStateAction<string>>;
}

Expand Down Expand Up @@ -39,11 +39,11 @@ const RunnerPostSearchBox = ({ reviewStatus, setReviewStatus, setEnteredTag }: P
};

const handleClickRadioButton = (e: React.ChangeEvent<HTMLInputElement>) => {
const clickedStatus = e.target.value as ReviewStatus;
const clickedStatus = e.target.value as ReviewStatusFilter;

if (clickedStatus === reviewStatus) return;

setReviewStatus(clickedStatus);
clickedStatus === 'ALL' ? setReviewStatus(null) : setReviewStatus(clickedStatus);
};

const handleInputFocus = () => {
Expand Down Expand Up @@ -118,7 +118,7 @@ const RunnerPostSearchBox = ({ reviewStatus, setReviewStatus, setEnteredTag }: P

return (
<S.SearchBoxContainer onSubmit={handleSubmit}>
<RunnerPostFilter reviewStatus={reviewStatus} handleClickRadioButton={handleClickRadioButton} />
<RunnerPostFilter reviewStatus={reviewStatus ?? 'ALL'} handleClickRadioButton={handleClickRadioButton} />
<S.InputContainer onFocus={handleInputFocus} onBlur={handleInputBlur} onKeyDown={handleKeyDown}>
<S.TagInput
placeholder="태그명 검색"
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReviewStatus } from '@/types/runnerPost';
import { ReviewStatus, ReviewStatusFilter } from '@/types/runnerPost';

export const BATON_BASE_URL =
process.env.NODE_ENV === 'development' ? 'https://baton-dev.n-e.kr' : process.env.REACT_APP_BASE_URL;
Expand All @@ -10,6 +10,11 @@ export const REVIEW_STATUS_LABEL_TEXT: { [key in ReviewStatus]: string } = {
OVERDUE: '기간 만료',
};

export const REVIEW_STATUS_FILTER_TEXT: Record<ReviewStatusFilter, string> = {
ALL: '전체',
...REVIEW_STATUS_LABEL_TEXT,
};

export const REVIEW_STATUS: ReviewStatus[] = Object.keys(REVIEW_STATUS_LABEL_TEXT) as ReviewStatus[];
export const RUNNER_POST_OPTIONS = ['대기중인 리뷰', '진행중인 리뷰', '완료된 리뷰'];
export const SUPPORTER_POST_OPTIONS = ['신청한 리뷰', '진행중인 리뷰', '완료된 리뷰'];
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/hooks/query/useMyPostList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export const useMyPostList = (isRunner: boolean, reviewStatus?: ReviewStatus) =>

queryFn: ({ pageParam }) => {
return isRunner
? getMyRunnerPost(PAGE_SIZE, pageParam, reviewStatus)
: getMySupporterPost(PAGE_SIZE, pageParam, reviewStatus);
? getMyRunnerPost({ limit: PAGE_SIZE, cursor: pageParam, reviewStatus })
: getMySupporterPost({ limit: PAGE_SIZE, cursor: pageParam, reviewStatus });
},

initialPageParam: 1,
initialPageParam: 0,

getNextPageParam: (nextPage) => {
if (nextPage.pageInfo.isLast) return undefined;

return nextPage.pageInfo.currentPage + 1;
return nextPage.pageInfo.nextCursor;
},

select: ({ pages }) => pages.reduce<MyPagePost[]>((acc, { data }) => acc.concat(data), []),
Expand Down
22 changes: 18 additions & 4 deletions frontend/src/hooks/query/useOtherSupporterPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@ import { getOtherSupporterPost } from '@/apis/apis';
import { ERROR_TITLE } from '@/constants/message';
import { ToastContext } from '@/contexts/ToastContext';
import { APIError } from '@/types/error';
import { GetRunnerPostResponse } from '@/types/runnerPost';
import { useQuery } from '@tanstack/react-query';
import { GetRunnerPostResponse, RunnerPost } from '@/types/runnerPost';
import { useInfiniteQuery, useQuery } from '@tanstack/react-query';
import { useContext, useEffect } from 'react';

const PAGE_LIMIT = 10;

export const useOtherSupporterPost = (userId: number) => {
const { showErrorToast } = useContext(ToastContext);

const queryResult = useQuery<GetRunnerPostResponse, APIError>({
const queryResult = useInfiniteQuery<GetRunnerPostResponse, APIError, RunnerPost[], [string, typeof userId], number>({
queryKey: ['otherSupporterPost', userId],
queryFn: () => getOtherSupporterPost(userId).then((res) => res),

queryFn: ({ pageParam }) => getOtherSupporterPost({ limit: PAGE_LIMIT, supporterId: userId, cursor: pageParam }),

initialPageParam: 0,

getNextPageParam: (nextPage) => {
if (nextPage.pageInfo.isLast) return undefined;

return nextPage.pageInfo.nextCursor;
},

select: ({ pages }) => pages.reduce<RunnerPost[]>((acc, { data }) => acc.concat(data), []),
});

useEffect(() => {
Expand All @@ -21,6 +34,7 @@ export const useOtherSupporterPost = (userId: number) => {
}, [queryResult.error]);

return {
...queryResult,
data: queryResult.data as NonNullable<typeof queryResult.data>,
};
};
21 changes: 13 additions & 8 deletions frontend/src/hooks/query/useRunnerPostList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,31 @@ import { useInfiniteQuery } from '@tanstack/react-query';
import { useContext, useEffect } from 'react';

const PAGE_LIMIT = 10;
const DEFAULT_REVIEW_STATUS = 'ALL';

export const useRunnerPostList = (reviewStatus?: ReviewStatus, tagName?: string) => {
export const useRunnerPostList = (reviewStatus: ReviewStatus | null, tagName?: string) => {
const { showErrorToast } = useContext(ToastContext);

const queryResult = useInfiniteQuery<
GetRunnerPostResponse,
APIError,
RunnerPost[],
[string, typeof reviewStatus, typeof tagName],
[string, string, typeof tagName],
number
>({
queryKey: ['runnerPost', reviewStatus, tagName],
queryFn: ({ pageParam }) => getRunnerPost(PAGE_LIMIT, reviewStatus, pageParam, tagName).then((res) => res),
queryKey: ['runnerPost', reviewStatus ?? DEFAULT_REVIEW_STATUS, tagName],

queryFn: ({ pageParam }) =>
getRunnerPost({ limit: PAGE_LIMIT, reviewStatus, cursor: pageParam, tagName }).then((res) => res),

initialPageParam: 0,

getNextPageParam: (nextPage) => {
if (!nextPage.pageInfo.isLast) {
return nextPage.pageInfo.nextCursor;
}
return undefined;
if (nextPage.pageInfo.isLast) return undefined;

return nextPage.pageInfo.nextCursor;
},

select: ({ pages }) => pages.reduce<RunnerPost[]>((acc, { data }) => acc.concat(data), []),
});

Expand Down
7 changes: 1 addition & 6 deletions frontend/src/mocks/data/myPagePost/myPagePostList.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@
}
],
"pageInfo": {
"isFirst": true,
"isLast": false,
"hasNext": true,
"totalPages": 4,
"totalElements": 40,
"currentPage": 1,
"currentSize": 12
"nextCursor": 1
}
}
6 changes: 0 additions & 6 deletions frontend/src/mocks/data/runnerPostList.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,7 @@
}
],
"pageInfo": {
"isFirst": true,
"isLast": false,
"hasNext": true,
"totalPages": 4,
"totalElements": 48,
"currentPage": 1,
"currentSize": 10,
"nextCursor": 1
}
}
6 changes: 5 additions & 1 deletion frontend/src/mocks/data/supporterProfilePost.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@
"applicantCount": 4,
"reviewStatus": "DONE"
}
]
],
"pageInfo": {
"isLast": false,
"nextCursor": 1
}
}
19 changes: 15 additions & 4 deletions frontend/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ export const handlers = [
const limit = req.url.searchParams.get('limit');
const cursor = req.url.searchParams.get('cursor');

if (!reviewStatus) {
return res(
ctx.delay(300),
ctx.status(200),
ctx.set('Content-Type', 'application/json'),
ctx.json(runnerPostList),
);
}

if (!limit)
return res(
ctx.status(400),
Expand Down Expand Up @@ -231,9 +240,10 @@ const handleRequest = (
ctx: RestContext,
) => {
const reviewStatus = req.url.searchParams.get('reviewStatus');
const page = req.url.searchParams.get('page');
const limit = req.url.searchParams.get('limit');
const cursor = req.url.searchParams.get('cursor');

if (!reviewStatus || !page)
if (!reviewStatus || !limit)
return res(
ctx.status(400),
ctx.set('Content-Type', 'application/json'),
Expand All @@ -245,11 +255,12 @@ const handleRequest = (
if (reviewStatus) {
CopiedMyPagePostList.data.forEach((post, idx) => {
post.runnerPostId = Date.now() + idx;
post.title = `${post.title} (${page})`;
post.title = `${post.title} (${cursor})`;
post.reviewStatus = reviewStatus;
});

CopiedMyPagePostList.pageInfo.currentPage = Number(page);
CopiedMyPagePostList.pageInfo.nextCursor = Number(cursor) + 1;
if (Number(cursor) === 3) CopiedMyPagePostList.pageInfo.isLast = true;

return res(
ctx.delay(300),
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { usePageRouter } from '@/hooks/usePageRouter';
import { useRunnerPostList } from '@/hooks/query/useRunnerPostList';
import useViewport from '@/hooks/useViewport';
import Layout from '@/layout/Layout';
import { ReviewStatus } from '@/types/runnerPost';
import { ReviewStatus, ReviewStatusFilter } from '@/types/runnerPost';
import React, { useContext, useState } from 'react';
import { styled } from 'styled-components';
import { isLogin } from '@/apis/auth';
Expand All @@ -20,7 +20,7 @@ const MainPage = () => {
const { isMobile } = useViewport();

const [enteredTag, setEnteredTag] = useState<string>('');
const [reviewStatus, setReviewStatus] = useState<ReviewStatus>('NOT_STARTED');
const [reviewStatus, setReviewStatus] = useState<ReviewStatus | null>(null);

const { data: runnerPostList, hasNextPage, fetchNextPage } = useRunnerPostList(reviewStatus, enteredTag);

Expand Down Expand Up @@ -49,7 +49,7 @@ const MainPage = () => {
<S.ControlPanelContainer>
<S.LeftSideContainer>
<RunnerPostSearchBox
reviewStatus={reviewStatus ?? 'NOT_STARTED'}
reviewStatus={reviewStatus}
setReviewStatus={setReviewStatus}
setEnteredTag={setEnteredTag}
/>
Expand Down
Loading