Skip to content

Commit

Permalink
つぶやきの匿名コンポーネント作成
Browse files Browse the repository at this point in the history
  • Loading branch information
maibaba committed Nov 10, 2022
1 parent 3109052 commit 1c65a25
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/resources/views/components/tweet/list.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@props([
'tweets' => []
])
<div class="bg-white rounded-md shadow-lg mt-5 md-5">
<ul>
@foreach($tweets as $tweet)
<li class="border-b list:broder-b-0 border-gray-200 p-4 flex items-start justify-detween">
<div>
<span class="inline-block rounded-full text-gray-600 bg-gray-100 px-2 py-1 text-xs mb-2">
{{ $tweet->user->name }}
</span>
<p class="text-gray-600">{!! nl2br(e($tweet->content)) !!}</p>
</div>
<div>
<!-- TODO 編集と削除 -->
</div>
</li>
@endforeach
</ul>
</div>
3 changes: 3 additions & 0 deletions src/resources/views/components/tweet/options.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<!-- Order your soul. Reduce your wants. - Augustine -->
</div>
1 change: 1 addition & 0 deletions src/resources/views/tweet/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
つぶやきアプリ
</h2>
<x-tweet.form.post></x-tweet.form.post>
<x-tweet.list :tweets="$tweets"></x-tweet.list>
</x-layout.single>
</x-layout>

0 comments on commit 1c65a25

Please sign in to comment.