-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feat: #109 프로젝트 목록 조회 API를 위한 React Query 처리 추가 * Feat: #109 프로젝트 목록 조회 API MSW 처리 추가 * Feat: #109 프로젝트 목록 사이드바 노출 기능 구현 * Feat: #109 네트워크 통신 대기시 Spinner UI 노출 * Chore: #109 Spinner UI 변경으로 다른 설정 코드 수정
- Loading branch information
Showing
7 changed files
with
71 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export default function Spinner() { | ||
return <div className="box-border h-20 w-20 animate-spin rounded-full border-4 border-[#eee] border-t-main" />; | ||
return ( | ||
<section className="flex h-full w-full items-center justify-center"> | ||
<div className="box-border h-20 w-20 animate-spin rounded-full border-4 border-[#eee] border-t-main" /> | ||
</section> | ||
); | ||
} |
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,22 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { getProjectList } from '@services/projectService'; | ||
|
||
import type { Team } from '@/types/TeamType'; | ||
|
||
// Todo: Project Query CUD로직 작성하기 | ||
export default function useReadProjects(teamId: Team['teamId']) { | ||
const { | ||
data: projectList = [], | ||
isLoading: isProjectLoading, | ||
isError: isProjectError, | ||
error: projectError, | ||
} = useQuery({ | ||
queryKey: ['teams', teamId, 'projects'], | ||
queryFn: async () => { | ||
const { data } = await getProjectList(teamId); | ||
return data; | ||
}, | ||
}); | ||
|
||
return { projectList, isProjectLoading, isProjectError, projectError }; | ||
} |
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