Skip to content

Commit

Permalink
Merge pull request #69 from hyunyeee/feat/66
Browse files Browse the repository at this point in the history
feat: 기본 이미지 설정 - #66
  • Loading branch information
hyunyeee authored Jun 11, 2024
2 parents 2e4ae05 + f8f0ddb commit b332761
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/UI/market/ProductListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ const ProductListItem: React.FC<ProductListItemProps> = ({ product }) => {
isAlreadyLikedByMe,
createDate,
thumbnailUrl,
thumbnailId,
} = product;
const navigate = useNavigate();

const onItemClick = () => {
navigate(`/products/${id}`);
};

const parsedRelativeTime = calculateTime(createDate);

return (
<ItemBox onClick={onItemClick}>
<Content>
<Image src={thumbnailUrl || defaultImg} />
<Image src={thumbnailId === -1 ? defaultImg : thumbnailUrl} />
<Description>
<ProductInfo>
<Title>{title}</Title>
Expand Down
1 change: 1 addition & 0 deletions src/types/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface Product {
isAlreadyLikedByMe: boolean;
createDate: string;
thumbnailUrl: string;
thumbnailId: number;
}

export interface HistoryProps {
Expand Down

0 comments on commit b332761

Please sign in to comment.