-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#18] useQuery, useInfiniteQuery -> useSuspenseQuery, useSuspenseInfi…
…niteQuery 교체 (#19) * 🔨 refactor: useQuery를 useSuspenseQuery로 교체 및 error 처러 코드 삭제 * 🔨 refactor: 로딩 UI 및 에러 처리 코드 삭제 * 🔨 refactor: suspense 적용 및 error boundy fallback에 workspace 에러 페이지 설정 * 🔨 refactor: useInfinityQuery -> useSuspenseQuery로 교체 * 🙀 chore: 400 에러와 404에러의 에러 코드 및 상태 메세지가 잘못 설정 되어 있어 올바르게 수정 * 🐛 fix: 기존 에러 발생 시 500 에러로만 응답하는 문제 해결 * 🔨 refactor: workspaceContainer에서 워크스페이스 데이터를 렌더링하고 페칭하는 부분을 분리함 * 🙀 chore: 컴포넌트 분리에 따른 코드 수정 * 🙀 chore: github action 에서 파일명 변경을 감지하지 못한 문제로 인해 파일명 변경 * 🙀 chore: 불필요한 console.log 삭제
- Loading branch information
1 parent
b33616e
commit 0163d1f
Showing
14 changed files
with
116 additions
and
63 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
14 changes: 14 additions & 0 deletions
14
apps/client/src/pages/WorkspaceErrorPage/WorkspaceErrorPage.tsx
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,14 @@ | ||
import { ErrorPage, NotFound } from '@/pages'; | ||
|
||
import toast from 'react-hot-toast'; | ||
import { useRouteError } from 'react-router-dom'; | ||
|
||
export const WorkspaceErrorPage = () => { | ||
const error: any = useRouteError(); | ||
const statusCode = error?.response?.statusCode || error?.status; | ||
if (statusCode === 404) { | ||
toast.error('워크스페이스 정보 불러오기 실패'); | ||
return <NotFound />; | ||
} | ||
return <ErrorPage />; | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export { HomePage } from './HomePage/HomePage'; | ||
export { NotFound } from './NotFound/NotFound'; | ||
export { WorkspacePage } from './Workspacepage/WorkspacePage'; | ||
export { ErrorPage } from './ErrorPage/ErrorPage'; | ||
export { WorkspaceErrorPage } from './WorkspaceErrorPage/WorkspaceErrorPage'; |
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
22 changes: 22 additions & 0 deletions
22
apps/client/src/widgets/home/WorkspaceSection/WorkspaceSection.stories.tsx
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 { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { WorkspaceSection } from './WorkspaceSection'; | ||
|
||
const meta: Meta<typeof WorkspaceSection> = { | ||
title: 'widgets/home/WorkspaceSection', | ||
component: WorkspaceSection, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof WorkspaceSection>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
// propsname: value, | ||
}, | ||
}; |
20 changes: 20 additions & 0 deletions
20
apps/client/src/widgets/home/WorkspaceSection/WorkspaceSection.tsx
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,20 @@ | ||
import { WorkspaceContainer, WorkspaceHeader } from '@/widgets'; | ||
|
||
import { SkeletonWorkspaceList } from '@/shared/ui'; | ||
import { Suspense } from 'react'; | ||
|
||
/** | ||
* | ||
* @description | ||
* 워크스페이스 헤더와 컨테이너를 합친 섹션 컴포넌트 | ||
*/ | ||
export const WorkspaceSection = () => { | ||
return ( | ||
<section className="w-full max-w-[1152px] px-3 pb-48"> | ||
<WorkspaceHeader /> | ||
<Suspense fallback={<SkeletonWorkspaceList skeletonNum={8} />}> | ||
<WorkspaceContainer /> | ||
</Suspense> | ||
</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