Refactor stop button in heading.blade.php to use modal confirmation component
This commit is contained in:
parent
84c7bd63f5
commit
e7e6c76b4e
@ -68,18 +68,22 @@
|
|||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
<x-forms.button wire:click='stop'>
|
<x-modal-confirmation @click="$wire.dispatch('stopEvent')">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
<x-slot:button-title>
|
||||||
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
stroke-linejoin="round">
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
stroke-linejoin="round">
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
</path>
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
</path>
|
||||||
</path>
|
<path
|
||||||
</svg>
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
Stop
|
</path>
|
||||||
</x-forms.button>
|
</svg>
|
||||||
|
Stop
|
||||||
|
</x-slot:button-title>
|
||||||
|
This application will be stopped. <br>Please think again.
|
||||||
|
</x-modal-confirmation>
|
||||||
@else
|
@else
|
||||||
<x-forms.button wire:click='deploy'>
|
<x-forms.button wire:click='deploy'>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
||||||
@ -94,4 +98,12 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
@script
|
||||||
|
<script>
|
||||||
|
$wire.$on('stopEvent', () => {
|
||||||
|
$wire.$dispatch('info', 'Stopping application.');
|
||||||
|
$wire.$call('stop');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endscript
|
||||||
</nav>
|
</nav>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user