|
1 | 1 | @props(['article'])
|
| 2 | + |
| 3 | +<article class="pb-8 border-b border-skin-base" aria-labelledby="post-title-{{ $article->id }}"> |
| 4 | + <div> |
| 5 | + <div class="flex space-x-3"> |
| 6 | + <div class="flex-shrink-0"> |
| 7 | + <img class="h-10 w-10 rounded-full" src="{{ $article->author->profile_photo_url }}" alt="{{ $article->author->name }}"> |
| 8 | + </div> |
| 9 | + <div class="min-w-0 flex-1"> |
| 10 | + <p class="text-sm font-medium text-skin-inverted"> |
| 11 | + <a href="{{ route('profile', $article->author->username) }}" class="hover:underline">{{ $article->author->name }}</a> |
| 12 | + </p> |
| 13 | + <p class="text-sm text-skin-base"> |
| 14 | + <a href="#" class="hover:underline"> |
| 15 | + <time datetime="{{ $article->publishedAt()->format('Y-m-d') }}">{{ $article->publishedAt()->format('j M, Y') }}</time> |
| 16 | + </a> |
| 17 | + </p> |
| 18 | + </div> |
| 19 | + </div> |
| 20 | + <h2 id="post-title-{{ $article->id }}" class="mt-4 text-lg leading-7 font-medium text-skin-inverted"> |
| 21 | + {{ $article->title }} |
| 22 | + </h2> |
| 23 | + </div> |
| 24 | + <a href="{{ route('articles.show', $article) }}" class="block mt-2 group space-y-4"> |
| 25 | + <p class="text-sm text-skin-inverted-muted/70"> |
| 26 | + {!! $article->excerpt(190) !!} |
| 27 | + </p> |
| 28 | + <div class="relative h-96 overflow-hidden"> |
| 29 | + <img class="w-full h-full object-cover shadow-lg rounded-lg group-hover:opacity-75" src="{{ $article->getFirstMediaUrl('media') }}" alt="{{ $article->title }}" /> |
| 30 | + </div> |
| 31 | + <div class="flex justify-between space-x-8"> |
| 32 | + <div class="flex space-x-6"> |
| 33 | + <span class="inline-flex items-center text-sm"> |
| 34 | + <button type="button" class="inline-flex space-x-2 text-skin-muted hover:text-skin-base"> |
| 35 | + <x-heroicon-o-thumb-up class="h-5 w-5" /> |
| 36 | + <span class="font-medium text-skin-inverted">{{ $article->reactions_count }}</span> |
| 37 | + <span class="sr-only">likes</span> |
| 38 | + </button> |
| 39 | + </span> |
| 40 | + <span class="inline-flex items-center text-sm"> |
| 41 | + <div class="inline-flex space-x-2 text-skin-muted"> |
| 42 | + <x-heroicon-o-eye class="h-5 w-5" /> |
| 43 | + <span class="font-medium text-skin-inverted">{{ $article->views_count }}</span> |
| 44 | + <span class="sr-only">views</span> |
| 45 | + </div> |
| 46 | + </span> |
| 47 | + </div> |
| 48 | + <div class="flex items-center space-x-3"> |
| 49 | + @if ($article->tags->isNotEmpty()) |
| 50 | + <div class="flex items-center space-x-2"> |
| 51 | + @foreach ($article->tags as $tag) |
| 52 | + <x-tag :tag="$tag" /> |
| 53 | + @endforeach |
| 54 | + </div> |
| 55 | + @endif |
| 56 | + |
| 57 | + <x-articles.sponsored :isSponsored="$article->isSponsored()" /> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </a> |
| 61 | +</article> |
0 commit comments