Skip to content

Commit

Permalink
adds loading placeholder back in at /monitors/:id/contributions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfroeller committed Jan 9, 2025
1 parent 31e3e75 commit cd3339b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
9 changes: 9 additions & 0 deletions app/Livewire/Monitors/ContributionsView.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,13 @@ public function render()
{
return view('livewire.monitors.contributions-view');
}

public function placeholder()
{
return <<<'HTML'
<div class="flex justify-center mt-64">
<div class="loader"></div>
</div>
HTML;
}
}
19 changes: 0 additions & 19 deletions resources/views/livewire/monitors/contributions-view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,6 @@
</div>
@endif

<!-- Loading Indicator -->
<div
x-data="{ loading: false }"
x-on:livewire-loading.window="loading = true"
x-on:livewire-loading-finish.window="loading = false"
x-show="loading"
class="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50"
style="display: none;"
>
<div class="p-6 bg-white rounded-lg shadow-xl">
<div class="flex items-center space-x-4">
<div class="w-10 h-10 border-4 border-blue-500 rounded-full animate-spin"></div>
<span class="text-lg text-gray-700">
Loading {{ $currentRepositoryName ? 'commits from ' . $currentRepositoryName : 'repositories' }}...
</span>
</div>
</div>
</div>

<!-- Contribution List Section -->
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3" wire:loading.class="opacity-50">
@forelse($contributions as $contribution)
Expand Down

0 comments on commit cd3339b

Please sign in to comment.