add duration to toast

show until closed for batch users
This commit is contained in:
Davor 2022-07-27 13:44:00 +02:00
parent e830a095b8
commit d57fe9f488
2 changed files with 6 additions and 6 deletions

View file

@ -9,7 +9,7 @@ export enum ToastType {
Error = 'error',
}
export const showToast = (text: string, type?: ToastType) => {
export const showToast = (text: string, type?: ToastType, duration?: number) => {
switch (type) {
case ToastType.Error:
toast.custom(
@ -47,7 +47,7 @@ export const showToast = (text: string, type?: ToastType) => {
</div>
</Transition>
),
{ position: 'top-right' },
{ position: 'top-right', duration },
);
break;
default:
@ -86,7 +86,7 @@ export const showToast = (text: string, type?: ToastType) => {
</div>
</Transition>
),
{ position: 'top-right' },
{ position: 'top-right', duration },
);
}
};