Răsfoiți Sursa

add warning toast option

Shun Miyazawa 4 ani în urmă
părinte
comite
18900edf72
1 a modificat fișierele cu 9 adăugiri și 1 ștergeri
  1. 9 1
      src/client/js/util/apiNotification.js

+ 9 - 1
src/client/js/util/apiNotification.js

@@ -20,6 +20,14 @@ const toastrOption = {
     hideDuration: '100',
     hideDuration: '100',
     timeOut: '3000',
     timeOut: '3000',
   },
   },
+  warning: {
+    closeButton: true,
+    progressBar: true,
+    newestOnTop: false,
+    showDuration: '100',
+    hideDuration: '100',
+    timeOut: '6000',
+  },
 };
 };
 
 
 // accepts both a single error and an array of errors
 // accepts both a single error and an array of errors
@@ -36,6 +44,6 @@ export const toastSuccess = (body, header = 'Success', option = toastrOption.suc
   toastr.success(body, header, option);
   toastr.success(body, header, option);
 };
 };
 
 
-export const toastWarning = (body, header = 'Warning', option = toastrOption.success) => {
+export const toastWarning = (body, header = 'Warning', option = toastrOption.warning) => {
   toastr.warning(body, header, option);
   toastr.warning(body, header, option);
 };
 };