Skip to content

Commit

Permalink
fixed a bug due to which the NoResults component wasn't shown if the …
Browse files Browse the repository at this point in the history
…product url was incorrect
  • Loading branch information
sheva10barca committed Aug 5, 2023
1 parent 0fa317b commit be14c3b
Show file tree
Hide file tree
Showing 3 changed files with 318 additions and 297 deletions.
12 changes: 9 additions & 3 deletions src/components/ProductCard/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ export const ProductCard: React.FC<Props> = React.memo(({ product }) => {
/>
) : (
<>
<Link to={`/${productType}/${id}`} state={productWithDetails} className="ProductCard__photo">
<img src={imageUrl} alt="product" className="ProductCard__img" />
</Link>
{productWithDetails && (
<Link to={`/${productType}/${id}`} state={productWithDetails} className="ProductCard__photo">
<img
src={imageUrl}
alt="product"
className="ProductCard__img"
/>
</Link>
)}

<div className="ProductCard__title">{name}</div>

Expand Down
Loading

0 comments on commit be14c3b

Please sign in to comment.