From 38125258079a283e6a414b4cb6d8e123c17d3788 Mon Sep 17 00:00:00 2001 From: seorinn Date: Mon, 11 May 2026 15:45:36 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20[TA-183]=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20lazy=20loading=20=EB=B0=8F=20onError=20=ED=8F=B4?= =?UTF-8?q?=EB=B0=B1=20=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PhotographerBox/index.tsx | 5 +++++ src/components/PromotionBox/index.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/components/PhotographerBox/index.tsx b/src/components/PhotographerBox/index.tsx index 6250a2c..92cff29 100644 --- a/src/components/PhotographerBox/index.tsx +++ b/src/components/PhotographerBox/index.tsx @@ -7,6 +7,7 @@ import { getPhotoType } from "../../hooks/getKorean"; import { useLoginGuard } from "../../hooks/useLoginGuard"; import icn_clipOff from "../../assets/svgs/icn_clip.svg"; import icn_clipOn from "../../assets/svgs/icn_clipOn.svg"; +import icn_noPhotographer from "../../assets/svgs/icn_no_photogrpher.svg"; import ModalCheck from "../ModalCheck"; interface postData { @@ -75,6 +76,10 @@ export default function PhotographerBox({ data }: Props) { src={data.profileImage.url} alt={data.profileImage.name} className="block object-cover min-w-full min-h-full" + loading="lazy" + onError={(e) => { + e.currentTarget.src = icn_noPhotographer; + }} />
diff --git a/src/components/PromotionBox/index.tsx b/src/components/PromotionBox/index.tsx index 50bf492..acaeebc 100644 --- a/src/components/PromotionBox/index.tsx +++ b/src/components/PromotionBox/index.tsx @@ -9,6 +9,7 @@ import icn_clipOff from "../../assets/svgs/icn_clip.svg"; import icn_clipOn from "../../assets/svgs/icn_clipOn.svg"; import icn_time from "../../assets/svgs/icn_event_home_clock.svg"; import icn_location from "../../assets/svgs/icn_event_home_location.svg"; +import icn_noPhotographer from "../../assets/svgs/icn_no_photogrpher.svg"; import ModalCheck from "../ModalCheck"; interface postData { @@ -108,6 +109,10 @@ export default function PromotionBox({ data }: Props) { className="object-cover min-w-full min-h-full" src={image.url} alt="이벤트 이미지" + loading="lazy" + onError={(e) => { + e.currentTarget.src = icn_noPhotographer; + }} /> From c7849304459e150e582f00c08940bf5c073272ee Mon Sep 17 00:00:00 2001 From: seorinn Date: Mon, 11 May 2026 15:48:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20[TA-183]=20onError=20=EB=AC=B4?= =?UTF-8?q?=ED=95=9C=EB=A3=A8=ED=94=84=20=EB=B0=A9=EC=A7=80=20=EB=B0=8F=20?= =?UTF-8?q?PromotionBox=20=ED=8F=B4=EB=B0=B1=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EA=B5=90=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PhotographerBox/index.tsx | 5 +++-- src/components/PromotionBox/index.tsx | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/PhotographerBox/index.tsx b/src/components/PhotographerBox/index.tsx index 92cff29..e78df1d 100644 --- a/src/components/PhotographerBox/index.tsx +++ b/src/components/PhotographerBox/index.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { - savePhotographer, + createSavedPhotographer, deleteSavedPhotographer, } from "../../api/photographer"; import { getPhotoType } from "../../hooks/getKorean"; @@ -49,7 +49,7 @@ export default function PhotographerBox({ data }: Props) { setIsClipped(!clipped); clipped ? await deleteSavedPhotographer(data.id) - : await savePhotographer(data.id); + : await createSavedPhotographer(data.id); } catch (e) { setIsClipped(clipped); setShowLoginModal(true); @@ -78,6 +78,7 @@ export default function PhotographerBox({ data }: Props) { className="block object-cover min-w-full min-h-full" loading="lazy" onError={(e) => { + e.currentTarget.onerror = null; e.currentTarget.src = icn_noPhotographer; }} /> diff --git a/src/components/PromotionBox/index.tsx b/src/components/PromotionBox/index.tsx index acaeebc..1a631c7 100644 --- a/src/components/PromotionBox/index.tsx +++ b/src/components/PromotionBox/index.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { useNavigate } from "react-router-dom"; -import { savePromotion, deleteSavedPromotion } from "../../api/promotion"; +import { createSavedPromotion, deleteSavedPromotion } from "../../api/promotion"; import { useLoginGuard } from "../../hooks/useLoginGuard"; import { getDDayText } from "../../utils/date"; import { Region } from "../../types/common"; @@ -9,7 +9,7 @@ import icn_clipOff from "../../assets/svgs/icn_clip.svg"; import icn_clipOn from "../../assets/svgs/icn_clipOn.svg"; import icn_time from "../../assets/svgs/icn_event_home_clock.svg"; import icn_location from "../../assets/svgs/icn_event_home_location.svg"; -import icn_noPhotographer from "../../assets/svgs/icn_no_photogrpher.svg"; +import icn_camera from "../../assets/svgs/icn_camera.svg"; import ModalCheck from "../ModalCheck"; interface postData { @@ -49,7 +49,7 @@ export default function PromotionBox({ data }: Props) { setSaveCount((prev) => (clipped ? prev - 1 : prev + 1)); clipped ? await deleteSavedPromotion(data.id) - : await savePromotion(data.id); + : await createSavedPromotion(data.id); } catch (e) { setIsClipped(clipped); setSaveCount((prev) => (clipped ? prev + 1 : prev - 1)); @@ -111,7 +111,8 @@ export default function PromotionBox({ data }: Props) { alt="이벤트 이미지" loading="lazy" onError={(e) => { - e.currentTarget.src = icn_noPhotographer; + e.currentTarget.onerror = null; + e.currentTarget.src = icn_camera; }} />