1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 22:39:18 +01:00

feat: improves toasts for mobile (#3547)

This commit is contained in:
Amir Raminfar
2025-01-13 11:16:17 -08:00
committed by GitHub
parent 691a89660e
commit 368646a7a3
11 changed files with 159 additions and 130 deletions

View File

@@ -2,7 +2,7 @@
<div class="toast toast-end whitespace-normal max-md:m-0 max-md:w-full">
<div
class="alert max-w-xl max-md:rounded-none"
v-for="toast in toasts"
v-for="{ toast, options: { timed } } in toasts"
:key="toast.id"
:class="{
'alert-error': toast.type === 'error',
@@ -18,7 +18,21 @@
<div v-html="toast.message" class="[&>a]:underline"></div>
</div>
<div>
<button class="btn btn-circle btn-xs" @click="removeToast(toast.id)"><mdi:close /></button>
<TimedButton
v-if="timed"
class="btn-primary btn-sm"
:duration="timed"
@finished="
removeToast(toast.id);
toast.action?.handler();
"
@cancelled="removeToast(toast.id)"
>
{{ toast.action?.label }}
</TimedButton>
<button class="btn btn-circle btn-xs" @click="removeToast(toast.id)" v-else>
<mdi:close />
</button>
</div>
</div>
</div>