Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/api/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async function authorizedFetch(method, url, options = {}) {
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'ngrok-skip-browser-warning': 'true',
...options.headers,
};
if (accessToken) {
Expand Down
20 changes: 6 additions & 14 deletions src/pages/MainPage/components/ProductCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ function ProductCard({ item, hidePrice = false, originalPrice, discountRate }) {
return (
<div
onClick={handleItemClick}
className={`relative flex flex-col rounded-[12px] bg-white p-2 shadow-sm transition-shadow ${
isEmpty ? "opacity-0 pointer-events-none" : "cursor-pointer hover:shadow-md"
}`}
className={`relative flex flex-col rounded-[12px] bg-white p-2 shadow-sm transition-shadow ${isEmpty ? "opacity-0 pointer-events-none" : "cursor-pointer hover:shadow-md"
}`}
>
{/* 순위 아이콘 (rank가 있을 때만 표시) */}
{item?.rank && (
Expand Down Expand Up @@ -65,17 +64,10 @@ function ProductCard({ item, hidePrice = false, originalPrice, discountRate }) {
{item?.price ? `${formatPrice(item.price)}원` : ""}
</p>
)}
{hidePrice && originalPrice && (
<>
<p className="text-[11px] text-[#9ca3af] line-through">
{formatPrice(originalPrice)}원
</p>
{discountRate !== undefined && item?.price && (
<p className="text-[12px] font-bold text-black">
<span className="text-[var(--color-red)]">{discountRate}%</span> {formatPrice(item.price)}원
</p>
)}
</>
{hidePrice && discountRate !== undefined && item?.price && (
<p className="text-[12px] font-bold text-black">
<span className="text-[var(--color-red)]">{discountRate}%</span> {formatPrice(item.price)}원
</p>
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MainPage/components/RecommendTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function RecommendTab() {
const mapped = list.map((item) => ({
id: item.id,
image: item.image || null, // 이미지 없으면 빈 자리 유지
sellerName: item.seller_id ? `판매자 ${item.seller_id}` : "",
sellerName: item.seller_nickname ? `${item.seller_nickname}` : "",
description: item.title || "",
price: item.price || 0,
}));
Expand Down