diff --git a/src/pages/ItemPage/components/ItemDetailsSection.jsx b/src/pages/ItemPage/components/ItemDetailsSection.jsx index 83a5fe1ea..171539547 100644 --- a/src/pages/ItemPage/components/ItemDetailsSection.jsx +++ b/src/pages/ItemPage/components/ItemDetailsSection.jsx @@ -162,11 +162,13 @@ function ItemDetailsSection({ item }) { return ( - {item.images && item.images.length > 0 ? ( - - ) : ( - - )} + 0 ? item.images[0] : defaultImage + } + alt={item.name} + onError={(e) => (e.target.src = defaultImage)} + /> diff --git a/src/pages/MarketPage/components/AllItemsSection.jsx b/src/pages/MarketPage/components/AllItemsSection.jsx index 0c8722f3b..d894222b1 100644 --- a/src/pages/MarketPage/components/AllItemsSection.jsx +++ b/src/pages/MarketPage/components/AllItemsSection.jsx @@ -92,11 +92,16 @@ function AllItemsSection() {
{itemList?.map((item) => ( - {item.images && item.images.length > 0 ? ( - {item.name} - ) : ( - {item.name} - )} + 0 + ? item.images[0] + : defaultImage + } + alt={item.name} + className="itemImage" + onError={(e) => (e.target.src = defaultImage)} + />

{item.name}

{item.price.toLocaleString()}원

diff --git a/src/pages/MarketPage/components/BestItemsSection.jsx b/src/pages/MarketPage/components/BestItemsSection.jsx index 60765d6f4..d98d01d88 100644 --- a/src/pages/MarketPage/components/BestItemsSection.jsx +++ b/src/pages/MarketPage/components/BestItemsSection.jsx @@ -43,11 +43,16 @@ function BestItemsSection() {
{itemList?.map((item) => ( - {item.images && item.images.length > 0 ? ( - {item.name} - ) : ( - {item.name} - )} + 0 + ? item.images[0] + : defaultImage + } + alt={item.name} + className="itemImage" + onError={(e) => (e.target.src = defaultImage)} + />

{item.name}

{item.price.toLocaleString()}원