Lib: Allow setting timeout in toast helpers
This commit is contained in:
@ -1,28 +1,28 @@
|
|||||||
import type { ToastSettings } from "@skeletonlabs/skeleton";
|
import type { ToastSettings } from "@skeletonlabs/skeleton";
|
||||||
|
|
||||||
export const get_info_toast = (message: string): ToastSettings => {
|
export const get_info_toast = (message: string, timeout: number = 2000): ToastSettings => {
|
||||||
return {
|
return {
|
||||||
message,
|
message,
|
||||||
hideDismiss: true,
|
hideDismiss: true,
|
||||||
timeout: 2000,
|
timeout,
|
||||||
background: "variant-filled-tertiary",
|
background: "variant-filled-tertiary",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const get_warning_toast = (message: string): ToastSettings => {
|
export const get_warning_toast = (message: string, timeout: number = 2000): ToastSettings => {
|
||||||
return {
|
return {
|
||||||
message,
|
message,
|
||||||
hideDismiss: true,
|
hideDismiss: true,
|
||||||
timeout: 2000,
|
timeout,
|
||||||
background: "variant-filled-secondary",
|
background: "variant-filled-secondary",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const get_error_toast = (message: string): ToastSettings => {
|
export const get_error_toast = (message: string, timeout: number = 2000): ToastSettings => {
|
||||||
return {
|
return {
|
||||||
message,
|
message,
|
||||||
hideDismiss: true,
|
hideDismiss: true,
|
||||||
timeout: 2000,
|
timeout,
|
||||||
background: "variant-filled-primary",
|
background: "variant-filled-primary",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user