Skip to content

Commit 0878802

Browse files
committed
✨ Feat: 나의 약속 로딩 스켈레톤 추가
1 parent e0e83ee commit 0878802

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

src/app/(crew)/my-gathering/hosted/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import { useGetHostedGatheringListQuery } from '@/src/_queries/my-gathering/host
66
import { formatDateToRequest } from '@/src/utils/format-date';
77
import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date';
88
import PopOverCalendar from '@/src/components/common/input/pop-over-calendar';
9+
import MyGatheringSkeletonList from '@/src/components/common/skeleton/my-gathering-skeleton-list';
910
import { GatheringCardProps } from '@/src/types/gathering-data';
1011

1112
export default function MyGatheringHostedPage() {
1213
const [selectedDate, setSelectedDate] = useState(new Date());
1314
const [hostedGatheringList, setHostedGatheringList] = useState<GatheringCardProps[]>();
1415

15-
const { data, refetch } = useQuery(
16+
const { data, isLoading, refetch } = useQuery(
1617
useGetHostedGatheringListQuery(formatDateToRequest(selectedDate)),
1718
);
1819

@@ -29,6 +30,7 @@ export default function MyGatheringHostedPage() {
2930
<div className="py-4 md:py-6">
3031
<PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
3132
</div>
33+
{isLoading && <MyGatheringSkeletonList num={6} />}
3234
{hostedGatheringList && <GatheringListWithDate gatheringList={hostedGatheringList} />}
3335
</div>
3436
);

src/app/(crew)/my-gathering/joined/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import { useGetJoinedGatheringListQuery } from '@/src/_queries/my-gathering/join
66
import { formatDateToRequest } from '@/src/utils/format-date';
77
import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date';
88
import PopOverCalendar from '@/src/components/common/input/pop-over-calendar';
9+
import MyGatheringSkeletonList from '@/src/components/common/skeleton/my-gathering-skeleton-list';
910
import { GatheringCardProps } from '@/src/types/gathering-data';
1011

1112
export default function MyGatheringJoinedPage() {
1213
const [selectedDate, setSelectedDate] = useState(new Date());
1314
const [joinedGatheringList, setJoinedGatheringList] = useState<GatheringCardProps[]>();
1415

15-
const { data, refetch } = useQuery(
16+
const { data, isLoading, refetch } = useQuery(
1617
useGetJoinedGatheringListQuery(formatDateToRequest(selectedDate)),
1718
);
1819

@@ -29,6 +30,7 @@ export default function MyGatheringJoinedPage() {
2930
<div className="py-4 md:py-6">
3031
<PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
3132
</div>
33+
{isLoading && <MyGatheringSkeletonList num={6} />}
3234
{joinedGatheringList && <GatheringListWithDate gatheringList={joinedGatheringList} />}
3335
</div>
3436
);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Skeleton } from '@mantine/core';
2+
import MyGatheringSkeleton from '../my-gathering-skeleton';
3+
4+
interface MyGatheringSkeletonListProps {
5+
num: number;
6+
}
7+
8+
export default function MyGatheringSkeletonList({ num }: MyGatheringSkeletonListProps) {
9+
return (
10+
<div>
11+
{[...Array(num)].map((_, index) => (
12+
// eslint-disable-next-line react/no-array-index-key
13+
<div key={index} className="md:flex">
14+
<div className="w-1/6">
15+
<div className="flex flex-col gap-2">
16+
<Skeleton className="h-4 w-36" />
17+
<Skeleton className="h-4 w-20" />
18+
</div>
19+
</div>
20+
<div className="relative -mb-3.5 w-0.5 bg-gray-200">
21+
<div className="md:corner-dot" />
22+
</div>
23+
<div className="flex-1 pb-6 md:pl-8">
24+
<MyGatheringSkeleton />
25+
</div>
26+
</div>
27+
))}
28+
</div>
29+
);
30+
}

0 commit comments

Comments
 (0)