Skip to content

Commit 11522c1

Browse files
committed
refactor: my page body skeleton add (#191)
1 parent 6ad4ea8 commit 11522c1

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/app/mypage/page.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ServerFetchBoundary } from "@/apis/ServerFetchBoundary";
44

55
import Gnb from "@/components/common/Gnb/Gnb";
66
import MyPageBody from "@/components/MyPage/MypageBody/MyPageBody";
7+
import MyPageBodySkeleton from "@/components/MyPage/MypageBody/MyPageBodySkeleton";
78
import MyPageHeader from "@/components/MyPage/MyPageHeader/MyPageHeader";
89

910
import { userInfoQueryOptions } from "@/hooks/api/userInfo/useUserInfoQuery";
@@ -14,20 +15,7 @@ export default function MyPage() {
1415
<>
1516
<MyPageHeader />
1617

17-
<Suspense
18-
fallback={
19-
// TODO: loading 컴포넌트로 변경
20-
<div className="flex justify-between mt-[60px] px-4 animate-pulse">
21-
<div className="flex gap-4 items-center">
22-
<div className="w-[60px] h-[60px] rounded-full bg-gray-50" />
23-
<div className="flex flex-col gap-1 items-start">
24-
<div className="w-20 h-4 rounded bg-gray-50" />
25-
<div className="w-14 h-5 rounded bg-gray-50" />
26-
</div>
27-
</div>
28-
</div>
29-
}
30-
>
18+
<Suspense fallback={<MyPageBodySkeleton />}>
3119
<ServerFetchBoundary fetchOptions={serverFetchOptions}>
3220
<MyPageBody />
3321
</ServerFetchBoundary>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Skeleton from "@/components/common/Skeleton/Skeleton";
2+
3+
const MyPageBodySkeleton = () => {
4+
return (
5+
<div className="px-4">
6+
<Skeleton className="w-full h-[60px] mt-14" />
7+
<Skeleton className="w-full h-8 mt-9" />
8+
<Skeleton className="w-full h-[150px] mt-3" />
9+
<Skeleton className="w-full h-8 mt-8" />
10+
<Skeleton className="w-full h-[134px] mt-7" />
11+
<Skeleton className="w-full h-8 mt-20" />
12+
<Skeleton className="w-full h-[104px] mt-6" />
13+
</div>
14+
);
15+
};
16+
17+
export default MyPageBodySkeleton;

0 commit comments

Comments
 (0)