Display reblogs

Made statuses a recursive component so we can display reblogs
correctly.
This commit is contained in:
St John Karp 2018-08-12 09:55:07 -07:00
parent b5f39c096a
commit 0143d70112
2 changed files with 35 additions and 15 deletions

View File

@ -0,0 +1,33 @@
<div class="status">
<div class="tooltip">
<a href="{{ $status['account']['url'] }}">
<img
src="{{ $status['account']['avatar'] }}"
alt="{{ $status['account']['acct'] }}"
class="avatar"
/>
{{ $status['account']['display_name'] }}
</a>
<span class="tooltiptext">{{ $status['account']['acct'] }}</span>
</div>
@if ($status['reblog'] === null)
<p>{!! $status['content'] !!}</p>
@foreach ($status['media_attachments'] as $attachment)
@if ($attachment['type'] === 'image')
<p>
<img
src="{{
$attachment['remote_url'] === null
? $attachment['url']
: $attachment['remote_url']
}}"
alt="{{ $attachment['description'] }}"
/>
</p>
@endif
@endforeach
@else
@component('status', ['status' => $status['reblog']])
@endcomponent
@endif
</div>

View File

@ -11,21 +11,8 @@
</head> </head>
<body> <body>
@foreach ($statuses as $status) @foreach ($statuses as $status)
<div class="status"> @component('status', ['status' => $status])
<div class="tooltip"> @endcomponent
<a href="{{ $status['account']['url'] }}">
<img src="{{ $status['account']['avatar'] }}" alt="{{ $status['account']['acct'] }}" class="avatar" />
{{ $status['account']['display_name'] }}
</a>
<span class="tooltiptext">{{ $status['account']['acct'] }}</span>
</div>
<p>{!! $status['content'] !!}</p>
@foreach ($status['media_attachments'] as $attachment)
@if ($attachment['type'] === 'image')
<p><img src="{{ $attachment['url'] }}" alt="{{ $attachment['description'] }}" /></p>
@endif
@endforeach
</div>
@endforeach @endforeach
</body> </body>
</html> </html>