-
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.
feat(member): add QueryErrorBoundary component
- Loading branch information
Showing
10 changed files
with
223 additions
and
247 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { type ComponentProps, type ReactNode } from 'react'; | ||
|
||
import { useQueryErrorResetBoundary } from '@tanstack/react-query'; | ||
|
||
import { ErrorBoundary } from '@suspensive/react'; | ||
|
||
interface Props { | ||
fallback: ComponentProps<typeof ErrorBoundary>['fallback']; | ||
children: ReactNode; | ||
} | ||
|
||
export default function QueryErrorBoundary({ fallback, children }: Props) { | ||
const { reset } = useQueryErrorResetBoundary(); | ||
|
||
return ( | ||
<ErrorBoundary onReset={reset} fallback={fallback}> | ||
{children} | ||
</ErrorBoundary> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,28 +1,34 @@ | ||
import { Suspense } from 'react'; | ||
|
||
import Content from '@components/common/Content/Content'; | ||
import ErrorSection from '@components/common/ErrorSection/ErrorSection'; | ||
import Header from '@components/common/Header/Header'; | ||
import QueryErrorBoundary from '@components/common/QueryErrorBoundary'; | ||
|
||
import CalendarSection from './components/CalendarSection'; | ||
import { StatusSection } from './components/StatusSection'; | ||
import { TableSection } from './components/TableSection'; | ||
|
||
export default function CalendarPage() { | ||
return ( | ||
<Content> | ||
<Header title="일정" /> | ||
<QueryErrorBoundary | ||
fallback={({ reset }) => <ErrorSection reset={reset} />} | ||
> | ||
<Content> | ||
<Header title="일정" /> | ||
|
||
<Suspense> | ||
<StatusSection /> | ||
</Suspense> | ||
<Suspense> | ||
<StatusSection /> | ||
</Suspense> | ||
|
||
<Suspense> | ||
<CalendarSection /> | ||
</Suspense> | ||
<Suspense> | ||
<CalendarSection /> | ||
</Suspense> | ||
|
||
<Suspense> | ||
<TableSection /> | ||
</Suspense> | ||
</Content> | ||
<Suspense> | ||
<TableSection /> | ||
</Suspense> | ||
</Content> | ||
</QueryErrorBoundary> | ||
); | ||
} |
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
Oops, something went wrong.