Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhanced the delete confirmation of the question. #664

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions resources/views/livewire/questions/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ class="flex items-center gap-1.5"
@if (! $question->is_ignored && auth()->user()->can('ignore', $question))
<x-dropdown-button
data-navigate-ignore="true"
wire:click="ignore"
wire:confirm="Are you sure you want to delete this question?"
x-on:click="$dispatch('open-modal', 'question.delete.{{ $questionId }}.confirmation')"
class="flex items-center gap-1.5"
>
<x-heroicon-o-trash class="h-4 w-4" />
Expand Down Expand Up @@ -354,6 +353,30 @@ class="text-slate-500 transition-colors dark:hover:text-slate-400 hover:text-sla
</div>
</x-modal>
@endif

<x-modal
max-width="md"
name="question.delete.{{ $questionId }}.confirmation"
>
<div class="p-8">
<h2 class="text-lg font-medium dark:text-slate-50 text-slate-950">Delete Question</h2>
<div class="mt-4 text-slate-500 dark:text-slate-400">
<p>Are you sure you want to delete this question?</p>
</div>
<div class="mt-4 flex items-center justify-between">
<x-secondary-button
x-on:click="$dispatch('close-modal', 'question.delete.{{ $questionId }}.confirmation')"
>
Cancel
</x-secondary-button>
<x-primary-button
wire:click="ignore"
>
Delete
</x-primary-button>
</div>
</div>
</x-modal>
@elseif (auth()->user()?->is($user))
<livewire:questions.edit
:questionId="$question->id"
Expand Down