Skip to content

Commit d2a0083

Browse files
authored
Merge pull request #29 from CarToi/refactor/#26/progress-style
[design] 추천 결과 페이지 디자인 수정
2 parents 8d80add + e5150b2 commit d2a0083

4 files changed

Lines changed: 16 additions & 46 deletions

File tree

src/app/recommend/_components/MapView/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"use client";
22

3+
import { useState } from "react";
34
import { Map, MapMarker, Polyline, useKakaoLoader } from "react-kakao-maps-sdk";
45
import { RecommendationResponse } from "@/lib/type";
56
import { COORDINATE } from "@/constants/spaceData";
67
import { Coordinate, getMidpoint } from "@/utils/getMidpoint";
78
import { getDestination } from "@/utils/getDestination";
89
import RecommendationMarker from "./RecommendationMarker";
9-
import { useState } from "react";
10+
import ErrorScreen from "@/components/ErrorScreen";
1011

1112
export default function MapView({
1213
spaceData,
@@ -18,8 +19,9 @@ export default function MapView({
1819
});
1920
const [selectedSpace, setSelectedSpace] = useState<Coordinate | null>(null);
2021

21-
if (loading) return <div>Loading</div>;
22-
if (error) return <div>Error</div>;
22+
if (loading)
23+
return <div className="h-full w-full animate-pulse bg-slate-200" />;
24+
if (error) return <ErrorScreen />;
2325

2426
const origin = COORDINATE.SAEMANGEUM;
2527
const destination = getDestination();

src/app/recommend/_components/RecommendationPanel/SkeletonCard.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import Skeleton from "@/components/Loading/Skeleton";
2-
31
export default function SkeletonCard() {
42
return (
5-
<div className="flex h-full w-full animate-pulse gap-2 sm:flex-col sm:gap-3">
6-
<div className="size-40 rounded-[6px] sm:h-[180px] sm:w-full" />
3+
<div className="flex h-full w-full gap-2 sm:flex-col sm:gap-3">
4+
<div className="size-40 shrink-0 animate-pulse rounded-md bg-slate-200 sm:h-[180px] sm:w-full" />
75
<div className="flex flex-1 flex-col gap-2">
8-
<Skeleton width="80%" height="1rem" />
9-
<Skeleton width="60%" height="0.875rem" />
10-
<div className="mt-2 flex gap-2">
11-
<Skeleton width="60px" height="1.5rem" className="rounded-[6px]" />
12-
<Skeleton width="40px" height="1.5rem" className="rounded-[6px]" />
6+
<div className="h-[26px] w-4/5 animate-pulse rounded-md bg-slate-200" />
7+
<div className="h-[20px] w-3/5 animate-pulse rounded-md bg-slate-200" />
8+
<div className="mt-1 flex gap-2">
9+
<div className="h-[28px] w-12 animate-pulse rounded-md bg-slate-200" />
10+
<div className="h-[28px] w-12 animate-pulse rounded-md bg-slate-200" />
1311
</div>
1412
</div>
1513
</div>

src/app/recommend/_components/RecommendationPanel/SpaceCard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ export default function SpaceCard({
3030
/>
3131
<div>
3232
<div className="flex flex-col gap-1">
33-
<div className="flex items-center">
34-
<h2 className="text-title-small text-[#1F2229]">{title}</h2>
35-
</div>
33+
<h2 className="text-title-small text-left text-[#1F2229]">{title}</h2>
3634
<div className="flex items-start gap-1">
3735
<div className="size-4 py-0.5">
3836
<MapPin size={16} color="#616A80" />
3937
</div>
40-
<div className="text-body-small text-[#616A80]">{position}</div>
38+
<div className="text-body-small text-left text-[#616A80]">
39+
{position}
40+
</div>
4141
</div>
4242
</div>
4343
<div className="mt-[8px] flex gap-[8px]">

src/components/Loading/Skeleton.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)