Skip to content

Commit b48e5ca

Browse files
committed
feat: add back up image to article on user summary
1 parent b2ddd58 commit b48e5ca

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

resources/views/components/articles/user-summary.blade.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
<div class="h-full rounded-lg shadow-lg bg-white">
66
<div class="flex flex-col h-full gap-x-8">
77
<a href="{{ route('articles.show', $article->slug()) }}" class="block">
8-
<div
9-
class="w-full h-32 rounded-t-lg bg-center {{ $article->hasHeroImage() ? 'bg-cover' : '' }} bg-gray-800 lg:h-40"
10-
style="background-image: url({{ $article->heroImage() }});"
8+
<img class="w-full h-32 rounded-t-lg bg-center bg-gray-800 lg:h-40 object-cover"
9+
src="{{ $article->heroImage() }}"
10+
alt="Article Hero Image"
11+
onerror="
12+
this.onerror=null;
13+
this.src='{{ asset('images/default-background.svg') }}'"
1114
>
12-
</div>
1315
</a>
1416

1517
<div class="flex flex-col h-full gap-y-3 p-4">

0 commit comments

Comments
 (0)