This commit is contained in:
Andras Bacsai 2023-05-03 14:40:58 +02:00
parent 0aff193e17
commit d5c1e1d3f4
2 changed files with 3 additions and 2 deletions

View File

@ -12,5 +12,5 @@ input, select, textarea {
@apply border-none p-2 bg-neutral-800 text-white disabled:text-neutral-600; @apply border-none p-2 bg-neutral-800 text-white disabled:text-neutral-600;
} }
button { button {
@apply border-none px-2 rounded cursor-pointer; @apply border-none px-2 p-1 cursor-pointer;
} }

View File

@ -1,10 +1,11 @@
@props([ @props([
'class' => null,
'defaultClass' => 'text-white bg-violet-500 hover:bg-violet-600', 'defaultClass' => 'text-white bg-violet-500 hover:bg-violet-600',
'confirm' => null, 'confirm' => null,
'confirmAction' => null, 'confirmAction' => null,
]) ])
<button {{ $attributes }} {{ $attributes->merge(['class' => $defaultClass]) }} <button {{ $attributes }} {{ $attributes->merge(['class' => "$defaultClass $class"]) }}
@if ($attributes->whereStartsWith('wire:click')) wire:target="{{ $attributes->whereStartsWith('wire:click')->first() }}" @if ($attributes->whereStartsWith('wire:click')) wire:target="{{ $attributes->whereStartsWith('wire:click')->first() }}"
wire:loading.class="text-black bg-green-500" wire:loading.attr="disabled" wire:loading.class.remove="{{ $defaultClass }} {{ $attributes->whereStartsWith('class')->first() }}" @endif wire:loading.class="text-black bg-green-500" wire:loading.attr="disabled" wire:loading.class.remove="{{ $defaultClass }} {{ $attributes->whereStartsWith('class')->first() }}" @endif
@isset($confirm) x-on:click="toggleConfirmModal('{{ $confirm }}')" @endisset @isset($confirm) x-on:click="toggleConfirmModal('{{ $confirm }}')" @endisset