Improve collaboration and notification UX

This commit is contained in:
brufdev
2025-03-29 17:20:34 +00:00
parent dd5652dfed
commit 410e803ee8
4 changed files with 8 additions and 2 deletions
@@ -42,6 +42,7 @@ final class CollaborationInvite extends Component
$user = $this->vault->user;
$user->notify(new CollaborationAccepted($currentUser));
$this->dispatch('notifications-refresh');
$this->dispatch('vaults-refresh');
$this->closeModal();
$this->dispatch('toast', message: __('Invite accepted'), type: 'success');
}
+2
View File
@@ -12,10 +12,12 @@ use App\Models\Vault;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Builder;
use Livewire\Attributes\On;
use Livewire\Component;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Throwable;
#[On('vaults-refresh')]
final class Index extends Component
{
public VaultForm $form;
@@ -2,7 +2,10 @@
<x-menu wide>
<x-menu.button>
<x-icons.bell class="w-5 h-5" />
<span class="animate-ping absolute top-1 right-0.5 block h-1 w-1 rounded-full ring-2 ring-error-400 bg-error-600"></span>
@if (count($notifications))
<span class="animate-ping absolute top-1 right-0.5 block h-1 w-1 rounded-full ring-2 ring-error-400 bg-error-600"></span>
@endif
</x-menu.button>
<x-menu.items>
@@ -51,7 +51,7 @@
<td class="text-right">
<button title="{{ __('Delete') }}"
wire:click="delete({{ $collaborator->id }})"
wire:confirm="Are you sure you want to delete this invite?"
wire:confirm="Are you sure you want to delete this collaborator?"
>
<x-icons.trash class="w-4 h-4" />
</button>