-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: resize이벤트를 미디어 쿼리 감지로 변경 브라우저 더블클릭하여 전체화면으로 변경시에는 미디어쿼리만 변경되어 javascript가 감지하지 못하는 오류 발견 * refactor: 소속이 비어있는 목데이터 추가 * design: 기술 아이콘 크기 변경 * refactor: 소속 없을 시 빈 문자열로 반환하도록 변경 * refactor: 이벤트 내용 수정 * design: 랭킹 border-radius 적용 * feat: 게시물 개수 불러오는 기능 구현 * design: 반응형 디자인 변경 * refactor: 사이드 위젯 key 추가
- Loading branch information
Showing
14 changed files
with
121 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { useQueries } from '@tanstack/react-query'; | ||
import { getRunnerPost } from '@/apis/apis'; | ||
import { ReviewStatusFilter } from '@/types/runnerPost'; | ||
import { REVIEW_STATUS_FILTER } from '@/constants'; | ||
|
||
const useTotalCount = () => { | ||
const reviewStatuses = REVIEW_STATUS_FILTER; | ||
|
||
const queryResults = useQueries({ | ||
queries: reviewStatuses.map((status) => ({ | ||
queryKey: ['runnerPostTotalCount', status], | ||
|
||
queryFn: () => getRunnerPost({ limit: 0, reviewStatus: status }).then((res) => res.pageInfo.totalCount), | ||
})), | ||
}); | ||
|
||
const isLoaded = queryResults.map((data) => { | ||
return data.isLoading; | ||
}); | ||
|
||
const isAllLoaded = isLoaded.every((don) => don === false); | ||
|
||
const totalCounts = queryResults.reduce((acc, result, index) => { | ||
if (result.isSuccess) { | ||
acc[reviewStatuses[index]] = result.data; | ||
} | ||
|
||
return acc; | ||
}, {} as { [key in ReviewStatusFilter]?: number }); | ||
|
||
return { totalCounts, isAllLoaded }; | ||
}; | ||
|
||
export default useTotalCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,7 @@ | |
], | ||
"pageInfo": { | ||
"isLast": false, | ||
"nextCursor": 1 | ||
"nextCursor": 1, | ||
"totalCount": 129 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters