Skip to content

Commit 3c80844

Browse files
youngminssclaude
andauthored
fix: 결과 페이지 맛집 이미지 기본 placeholder, 공유하기 toast 미노출 (#68)
* fix: 음식점 카드 이미지 placeholder 처리 개선 - 조건부 렌더링 대신 placeholder 이미지 사용으로 변경 - 배경색 bg-gray-200에서 bg-surface-lightgray로 통일 - placeholder 이미지 경로 통일 (/images/result/restaurant-image-placeholder.png) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: Pending/Result 페이지에 Toaster 컴포넌트 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d55dba1 commit 3c80844

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

app/gathering/[accessKey]/opinion/pending/PendingViewContainer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import { useParams, redirect } from "next/navigation";
1010
import { useGetGatheringCapacity } from "#/hooks/apis/gathering";
1111
import { share } from "#/utils/share";
12+
import { Toaster } from "#/components/toast";
1213

1314
export function PendingViewContainer() {
1415
const { accessKey } = useParams<{ accessKey: string }>();
@@ -52,6 +53,8 @@ export function PendingViewContainer() {
5253
</Button>
5354
</div>
5455
</Layout.Footer>
56+
57+
<Toaster offset={{ bottom: 96 }} mobileOffset={{ bottom: 96 }} />
5558
</Layout.Root>
5659
);
5760
}

app/gathering/[accessKey]/opinion/result/ResultViewContainer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useParams, redirect } from "next/navigation";
77
import { BackwardButton } from "#/components/backwardButton";
88
import { useGetGatheringCapacity } from "#/hooks/apis/gathering";
99
import { useGetRecommendResult } from "#/hooks/apis/recommendResult";
10+
import { Toaster } from "#/components/toast";
1011

1112
export function ResultViewContainer() {
1213
const { accessKey } = useParams<{ accessKey: string }>();
@@ -36,6 +37,8 @@ export function ResultViewContainer() {
3637
<ShareButton />
3738
</div>
3839
</Layout.Footer>
40+
41+
<Toaster offset={{ bottom: 96 }} mobileOffset={{ bottom: 96 }} />
3942
</Layout.Root>
4043
);
4144
}
30.4 KB
Loading

src/pageComponents/gathering/restaurantCard/OtherCandidateCard.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,16 @@ export const OtherCandidateCard = ({
2828
className="ygi:flex ygi:items-start ygi:overflow-hidden"
2929
aria-label={`${ranking}위 추천 음식점: ${restaurant.restaurantName}`}
3030
>
31-
<div className="ygi:relative ygi:h-20 ygi:w-20 ygi:shrink-0 ygi:overflow-clip ygi:rounded ygi:border ygi:border-border-default ygi:bg-gray-200">
32-
{restaurant.imageUrl ? (
33-
<Image
34-
src={restaurant.imageUrl}
35-
alt={restaurant.restaurantName}
36-
fill
37-
className="ygi:object-cover"
38-
/>
39-
) : (
40-
<div className="ygi:flex ygi:h-full ygi:items-center ygi:justify-center">
41-
<span className="ygi:text-text-tertiary ygi:text-xs">
42-
준비 중
43-
</span>
44-
</div>
45-
)}
31+
<div className="ygi:relative ygi:h-20 ygi:w-20 ygi:shrink-0 ygi:overflow-clip ygi:rounded ygi:border ygi:border-border-default ygi:bg-surface-lightgray">
32+
<Image
33+
src={
34+
restaurant.imageUrl ??
35+
"/images/result/restaurant-image-placeholder.png"
36+
}
37+
alt={restaurant.restaurantName ?? "준비 중"}
38+
fill
39+
className="ygi:object-cover"
40+
/>
4641
</div>
4742

4843
<div className="ygi:flex ygi:flex-1 ygi:flex-col ygi:justify-center ygi:gap-2 ygi:px-5">

src/pageComponents/gathering/restaurantCard/TopRecommendCard.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export interface TopRecommendCardProps {
1717

1818
export const TopRecommendCard = ({ restaurant }: TopRecommendCardProps) => {
1919
const handleImageError = (event: SyntheticEvent<HTMLImageElement>) => {
20-
event.currentTarget.src = "/public/images/placeholder/restaurant.png";
20+
event.currentTarget.src =
21+
"/images/result/restaurant-image-placeholder.png";
2122
};
2223

2324
const handleMapClick = () => {
@@ -29,16 +30,21 @@ export const TopRecommendCard = ({ restaurant }: TopRecommendCardProps) => {
2930
className="ygi:flex ygi:flex-col ygi:items-start"
3031
aria-label={`1위 추천 음식점: ${restaurant.restaurantName}`}
3132
>
32-
<div className="ygi:relative ygi:h-46.5 ygi:w-full ygi:overflow-hidden ygi:rounded-t-xl ygi:bg-gray-200">
33-
{restaurant.imageUrl && (
34-
<Image
35-
src={restaurant.imageUrl}
36-
alt={restaurant.restaurantName}
37-
fill
38-
className="ygi:object-cover"
39-
onError={handleImageError}
40-
/>
41-
)}
33+
<div className="ygi:relative ygi:h-46.5 ygi:w-full ygi:overflow-hidden ygi:rounded-t-xl ygi:bg-surface-lightgray">
34+
<Image
35+
src={
36+
restaurant.imageUrl ??
37+
"/images/result/restaurant-image-placeholder.png"
38+
}
39+
alt={restaurant.restaurantName ?? "준비 중"}
40+
fill
41+
className={
42+
restaurant.imageUrl
43+
? "ygi:object-cover"
44+
: "ygi:object-contain"
45+
}
46+
onError={handleImageError}
47+
/>
4248
</div>
4349

4450
<div className="ygi:flex ygi:w-full ygi:flex-col ygi:gap-3 ygi:rounded-b-xl ygi:bg-surface-white ygi:p-5">

0 commit comments

Comments
 (0)