refactor(toast): implemented toast.js refactored 'showToast' and updated pages accordingly
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
function showToast(options) {
|
||||
if (!options) return;
|
||||
|
||||
const toast = document.getElementById("toast");
|
||||
const tMsg = document.getElementById("toast-msg");
|
||||
const tIcon = document.getElementById("toast-icon");
|
||||
|
||||
tMsg.textContent = options.title;
|
||||
tIcon.textContent = options.icon;
|
||||
|
||||
toast.classList.add("show");
|
||||
|
||||
setTimeout(() => {
|
||||
toast.classList.remove("show");
|
||||
}, 3500);
|
||||
}
|
||||
Reference in New Issue
Block a user