diff --git a/01-frontend/src/assets/HTW.jpg b/01-frontend/src/assets/HTW.jpg deleted file mode 100644 index 09b319c..0000000 Binary files a/01-frontend/src/assets/HTW.jpg and /dev/null differ diff --git a/01-frontend/src/assets/default.jpg b/01-frontend/src/assets/default.jpg new file mode 100644 index 0000000..b685bfb Binary files /dev/null and b/01-frontend/src/assets/default.jpg differ diff --git a/01-frontend/src/helper/homepage/ItemCard.tsx b/01-frontend/src/helper/homepage/ItemCard.tsx index 14cd554..735ee78 100644 --- a/01-frontend/src/helper/homepage/ItemCard.tsx +++ b/01-frontend/src/helper/homepage/ItemCard.tsx @@ -5,7 +5,6 @@ import Item from "../../components/Item"; import { useBasket } from "../BasketProvider"; import "../helper.css"; import { useTranslation } from 'react-i18next'; -import HTWImage from '../../assets/HTW.jpg'; export default function ItemCard({ item }: { item: Item }) { @@ -22,6 +21,8 @@ export default function ItemCard({ item }: { item: Item }) { navigate(`/product/${item.id}`, { state: { item } }); } + const imageUrl = `http://localhost:8085/image?articleId=${item.id}`; + return ( @@ -29,8 +30,11 @@ export default function ItemCard({ item }: { item: Item }) { { + event.currentTarget.src = "/src/assets/default.jpg"; // Standardbild setzen + }} /> diff --git a/01-frontend/src/helper/productpage/ProductInfo.tsx b/01-frontend/src/helper/productpage/ProductInfo.tsx index 7650070..7050168 100644 --- a/01-frontend/src/helper/productpage/ProductInfo.tsx +++ b/01-frontend/src/helper/productpage/ProductInfo.tsx @@ -53,6 +53,8 @@ export default function ProductInfo({ item }: { item: Item }) { setImageDimensions({ width: naturalWidth, height: naturalHeight }); }; + const imageUrl = `http://localhost:8085/image?articleId=${item.id}`; + return ( {/* Left Column - Image */} @@ -60,9 +62,12 @@ export default function ProductInfo({ item }: { item: Item }) { { + event.currentTarget.src = "/src/assets/default.jpg"; // Standardbild setzen + }} sx={{ maxWidth: imageDimensions.width > imageDimensions.height ? "100%" : "auto", maxHeight: imageDimensions.height >= imageDimensions.width ? 400 : "auto",