Skip to content

Commit

Permalink
fix: 🐛 fix path for image in shopping-item
Browse files Browse the repository at this point in the history
  • Loading branch information
kavabunga committed Jan 26, 2024
1 parent 46b64f9 commit 33881b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/product-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
<img
className={styles.image}
src={
cardImage !== undefined && cardImage !== null
cardImage
? cardImage.startsWith('/')
? `${BASE_URL}${cardImage}`
: cardImage
Expand Down
3 changes: 2 additions & 1 deletion src/components/shopping-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styles from './shopping-item.module.scss';
import { Link } from 'react-router-dom';
import { useCart } from '@hooks/use-cart-context.ts';
import { translateMeasureUnit } from '@utils/utils';
import { BASE_URL } from '@data/constants';

type ShoppingItemProps = {
product: {
Expand Down Expand Up @@ -44,7 +45,7 @@ const ShoppingItem: React.FC<ShoppingItemProps> = (props) => {
<Link to={`/catalog/${product.category}/${product.id}`}>
<img
className={styles.item__image}
src={`https://goodfood.acceleratorpracticum.ru/media/${product.photo}`}
src={`${BASE_URL}/media/${product.photo}`}
alt={product.name}
/>
</Link>
Expand Down

0 comments on commit 33881b4

Please sign in to comment.