generated from dave/wails-template
Add toasts..... such as they are
This commit is contained in:
@@ -66,7 +66,22 @@ toast('Hello World', {
|
|||||||
<Toaster hotkey={['KeyC']} />
|
<Toaster hotkey={['KeyC']} />
|
||||||
-->
|
-->
|
||||||
<svelte:window on:keydown={keyDown} />
|
<svelte:window on:keydown={keyDown} />
|
||||||
<Toaster theme="dark" expand visibleToasts={9} />
|
<Toaster
|
||||||
|
theme="dark"
|
||||||
|
expand
|
||||||
|
visibleToasts={9}
|
||||||
|
position="bottom-center"
|
||||||
|
offset="40px"
|
||||||
|
closeButton
|
||||||
|
richColors
|
||||||
|
toastOptions={{
|
||||||
|
classes: {
|
||||||
|
toast: 'min-w-[600px] p-4',
|
||||||
|
title: 'text-lg font-bold',
|
||||||
|
description: 'text-base'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<template>
|
<template>
|
||||||
<Header />
|
<Header />
|
||||||
<main class="flex-1">
|
<main class="flex-1">
|
||||||
|
|||||||
@@ -21,15 +21,25 @@
|
|||||||
const res = await UpdateAddon(addon.name);
|
const res = await UpdateAddon(addon.name);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
console.error(res.error);
|
console.error(res.error);
|
||||||
toast.error(`Failed to update ${addon.name}`);
|
toast.error(`Failed to update ${addon.name}`, {
|
||||||
|
classes: {
|
||||||
|
toast: 'bg-red-600'
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
toast.warning(`${addon.name} updated with breaking changes!`, {
|
toast.error(`${addon.name} updated with breaking changes!`, {
|
||||||
duration: 5000
|
classes: {
|
||||||
|
toast: 'bg-red-600'
|
||||||
|
},
|
||||||
|
description: 'Please restart your game to apply the update.'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
toast.success(`${addon.name} updated successfully!`, {
|
toast.success(`${addon.name} updated successfully!`, {
|
||||||
duration: 3000
|
classes: {
|
||||||
|
toast: 'bg-green-600'
|
||||||
|
},
|
||||||
|
description: 'You may /reload ingame to apply the update.'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user