Skip to content

Commit

Permalink
Fix images path using VITE_BASE_URL from .env (Fix #70)
Browse files Browse the repository at this point in the history
  • Loading branch information
aivuk committed Aug 22, 2023
1 parent 6bb683e commit 397ae46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Item(props: FoodObject) {
<Box position="relative" flexGrow={1}>
<img
className="food-image"
src={`../images/${image}.png`}
src={`${import.meta.env.VITE_BASE_URL}images/${image}.png`}
alt={`image of ${image}`}
/>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/FoodPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function FoodPage() {
<ImgBox borderRadius={1}>
<img
className="food-image"
src={`../images/${image}.png`}
src={`${import.meta.env.VITE_BASE_URL}images/${image}.png`}
alt={`photo of ${image}`}
/>
</ImgBox>
Expand Down

0 comments on commit 397ae46

Please sign in to comment.