Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from pvdthings/issue/2
Browse files Browse the repository at this point in the history
Add placeholder image for things with no image
  • Loading branch information
dillonfagan authored Mar 12, 2023
2 parents db28ab5 + a59af09 commit 95ce6fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/icons/box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/lib/things/Thing.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { Card, Text } from "$lib/Foundation.svelte";
import BoxIcon from "$lib/icons/box.svg";
import { t } from "$lib/language/translate";
export let thing;
Expand All @@ -12,7 +13,7 @@

<div class="flex flex-col {className}">
<Card>
<img src={thing.image} alt={thing.name} class="h-full w-full object-contain" />
<img src={thing.image ?? BoxIcon} alt={thing.name} class="h-full w-full object-contain" />
</Card>
<div class="pl-1 pt-2 flex flex-col gap-2 justify-between flex-grow">
<Text display bold smallauto>{thing.name}</Text>
Expand Down

0 comments on commit 95ce6fc

Please sign in to comment.