diff --git a/apps/member/src/components/common/QueryErrorBoundary.tsx b/apps/member/src/components/common/QueryErrorBoundary.tsx new file mode 100644 index 00000000..3c54e646 --- /dev/null +++ b/apps/member/src/components/common/QueryErrorBoundary.tsx @@ -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['fallback']; + children: ReactNode; +} + +export default function QueryErrorBoundary({ fallback, children }: Props) { + const { reset } = useQueryErrorResetBoundary(); + + return ( + + {children} + + ); +} diff --git a/apps/member/src/pages/ApplicationPage/index.tsx b/apps/member/src/pages/ApplicationPage/index.tsx index 4f9d3f2f..1a6e88d0 100644 --- a/apps/member/src/pages/ApplicationPage/index.tsx +++ b/apps/member/src/pages/ApplicationPage/index.tsx @@ -1,14 +1,12 @@ import { Suspense } from 'react'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - 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 { ROLE_LEVEL } from '@constants/state'; import { useMyProfile } from '@hooks/queries'; -import { ErrorBoundary } from '@suspensive/react'; import { ApplicationListSection } from './components/ApplicationListSection'; @@ -20,21 +18,16 @@ export default function ApplicationPage() { } return ( - - {({ reset }) => ( - } - > - -
- - - - - - - )} - + } + > + +
+ + + + + + ); } diff --git a/apps/member/src/pages/BlogPage/index.tsx b/apps/member/src/pages/BlogPage/index.tsx index e36f8daf..8c50a4b4 100644 --- a/apps/member/src/pages/BlogPage/index.tsx +++ b/apps/member/src/pages/BlogPage/index.tsx @@ -1,8 +1,10 @@ import { useParams } from 'react-router-dom'; import Content from '@components/common/Content/Content'; +import ErrorSection from '@components/common/ErrorSection/ErrorSection'; import Header from '@components/common/Header/Header'; import Image from '@components/common/Image/Image'; +import QueryErrorBoundary from '@components/common/QueryErrorBoundary'; import { Section } from '@components/common/Section'; import Share from '@components/common/Share/Share'; @@ -24,26 +26,30 @@ export default function BlogPage() { data; return ( - -
-
- {title} -
-

{title}

-
-

{subTitle}

-

- {name} ({memberId}) • {formattedDate(createdAt)} -

+ } + > + +
+
+ {title} +
+

{title}

+
+

{subTitle}

+

+ {name} ({memberId}) • {formattedDate(createdAt)} +

+
+
- -
-
{content}
-
- +
{content}
+ + + ); } diff --git a/apps/member/src/pages/CalendarPage/index.tsx b/apps/member/src/pages/CalendarPage/index.tsx index bcab2aa5..c2f1dcc1 100644 --- a/apps/member/src/pages/CalendarPage/index.tsx +++ b/apps/member/src/pages/CalendarPage/index.tsx @@ -1,7 +1,9 @@ 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'; @@ -9,20 +11,24 @@ import { TableSection } from './components/TableSection'; export default function CalendarPage() { return ( - -
+ } + > + +
- - - + + + - - - + + + - - - - + + + + + ); } diff --git a/apps/member/src/pages/LibraryDetailPage/index.tsx b/apps/member/src/pages/LibraryDetailPage/index.tsx index ced7441f..9256a5e6 100644 --- a/apps/member/src/pages/LibraryDetailPage/index.tsx +++ b/apps/member/src/pages/LibraryDetailPage/index.tsx @@ -1,15 +1,13 @@ import { Suspense } from 'react'; import { useParams } from 'react-router-dom'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - 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 { LIBRARY_MESSAGE } from '@constants/message'; import { PATH, PATH_NAME } from '@constants/path'; -import { ErrorBoundary } from '@suspensive/react'; import { DetailsSection } from './components/BookDetailSection'; import { LoanHistorySection } from './components/BookLoanHistorySection'; @@ -22,24 +20,19 @@ export default function LibraryDetailPage() { } return ( - - {({ reset }) => ( - } - > - -
- - - - - - - - - - )} - + } + > + +
+ + + + + + + + + ); } diff --git a/apps/member/src/pages/LibraryPage/index.tsx b/apps/member/src/pages/LibraryPage/index.tsx index a3b84701..b51cfc7e 100644 --- a/apps/member/src/pages/LibraryPage/index.tsx +++ b/apps/member/src/pages/LibraryPage/index.tsx @@ -1,16 +1,14 @@ import { Suspense } from 'react'; import { useNavigate } from 'react-router-dom'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - import { Button } from '@clab-platforms/design-system'; 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 { PATH } from '@constants/path'; -import { ErrorBoundary } from '@suspensive/react'; import BookExplorerSection from './components/BookExplorerSection'; import NewBooksSection from './components/NewBooksSection'; @@ -19,29 +17,24 @@ export default function LibraryPage() { const navigate = useNavigate(); return ( - - {({ reset }) => ( - } - > - -
- -
- - - - - - - - -
-
- )} -
+ } + > + +
+ +
+ + + + + + + + +
+
); } diff --git a/apps/member/src/pages/MainPage/index.tsx b/apps/member/src/pages/MainPage/index.tsx index 69bfad34..0268728b 100644 --- a/apps/member/src/pages/MainPage/index.tsx +++ b/apps/member/src/pages/MainPage/index.tsx @@ -1,10 +1,9 @@ import { Suspense } from 'react'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - import ActivityPhotoBanner from '@components/common/ActivityPhotoBanner/ActivityPhotoBanner'; import Content from '@components/common/Content/Content'; import ErrorSection from '@components/common/ErrorSection/ErrorSection'; +import QueryErrorBoundary from '@components/common/QueryErrorBoundary'; import { HireBoard, NewsBoard, @@ -13,8 +12,6 @@ import { } from '@components/community/Board'; import { BoardSection } from '@components/community/BoardSection'; -import { ErrorBoundary } from '@suspensive/react'; - import { BirthdaySection } from './components/BirthdaySection'; import { BlogSection } from './components/BlogSection'; import { NoticeSection } from './components/NoticeSection'; @@ -22,49 +19,44 @@ import { OrganizationNewsSection } from './components/OrganizationNewsSection'; export default function MainPage() { return ( - - {({ reset }) => ( - } - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - )} - + } + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); } diff --git a/apps/member/src/pages/ManagePage/index.tsx b/apps/member/src/pages/ManagePage/index.tsx index 541df012..9af806d4 100644 --- a/apps/member/src/pages/ManagePage/index.tsx +++ b/apps/member/src/pages/ManagePage/index.tsx @@ -1,15 +1,13 @@ import { Suspense } from 'react'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - 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 { SupportHistorySection } from '@components/support/SupportHistorySection'; import { ROLE_LEVEL } from '@constants/state'; import { useMyProfile } from '@hooks/queries'; -import { ErrorBoundary } from '@suspensive/react'; import { ActivitySection } from './components/ActivitySection'; import { AlertSection } from './components/AlertSection'; @@ -26,52 +24,43 @@ export default function ManagePage() { } return ( - - {({ reset }) => ( - } - > - -
- - - + } + > + +
+ + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - )} - + + + + + ); } diff --git a/apps/member/src/pages/MyPage/index.tsx b/apps/member/src/pages/MyPage/index.tsx index af5645ea..255f802d 100644 --- a/apps/member/src/pages/MyPage/index.tsx +++ b/apps/member/src/pages/MyPage/index.tsx @@ -1,15 +1,12 @@ import { Suspense } from 'react'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - import { Grid } from '@clab-platforms/design-system'; import Content from '@components/common/Content/Content'; import ErrorSection from '@components/common/ErrorSection/ErrorSection'; +import QueryErrorBoundary from '@components/common/QueryErrorBoundary'; import { Section } from '@components/common/Section'; -import { ErrorBoundary } from '@suspensive/react'; - import { ActivityGroupSection } from './components/ActivityGroupSection'; import { HistorySection } from './components/HistorySection'; import { MembershipHistorySection } from './components/MembershipHistorySection'; @@ -17,42 +14,37 @@ import { ProfileSection } from './components/ProfileSection'; export default function MyPage() { return ( - - {({ reset }) => ( - } - > - }> - - - - + } + > + }> + + + + - - - + + + - - - - + + + + - - - + + + - - - - - - - + + + + + - - )} - + + + ); } diff --git a/apps/member/src/pages/SupportPage/index.tsx b/apps/member/src/pages/SupportPage/index.tsx index 59820a3f..db22d593 100644 --- a/apps/member/src/pages/SupportPage/index.tsx +++ b/apps/member/src/pages/SupportPage/index.tsx @@ -1,39 +1,31 @@ import { Suspense } from 'react'; -import { QueryErrorResetBoundary } from '@tanstack/react-query'; - 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 { SupportHistorySection, SupportHistorySectionSkeleton, } from '@components/support/SupportHistorySection'; -import { ErrorBoundary } from '@suspensive/react'; - import { IntroduceSection } from './components/IntroduceSection'; import { RequestSection } from './components/RequestSection'; export default function SupportPage() { return ( - - {({ reset }) => ( - } - > - -
- - + } + > + +
+ + - }> - - - - - )} - + }> + + + + ); }