Skip to content

Commit

Permalink
feat: 유저 프로필 페이지에 ErrorBoundary 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyugeon committed Jul 30, 2024
1 parent ff37432 commit 2e64603
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/profile/[userId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use client';

import { APIUser } from '@/types/user';
import { notFound } from 'next/navigation';
import { ErrorBoundary } from 'react-error-boundary';

import type { APIUser } from '@/types/user';

import BackButton from '@/components/common/BackButton';
import ShareButton from '@/components/common/ShareButton';
import TopNavigation from '@/components/common/TopNavigation';
Expand All @@ -13,7 +17,7 @@ const UserProfilePage = ({
params: { userId: APIUser['userId'] };
}) => {
return (
<>
<ErrorBoundary fallbackRender={notFound}>
<TopNavigation>
<TopNavigation.LeftItem>
<BackButton />
Expand All @@ -26,7 +30,7 @@ const UserProfilePage = ({
<ProfileInfo userId={userId} />
<ProfileBookShelf userId={userId} />
</div>
</>
</ErrorBoundary>
);
};

Expand Down

0 comments on commit 2e64603

Please sign in to comment.