Add toasts to UI (#25449)

Fixes https://github.com/go-gitea/gitea/issues/24353

In some case like async success/error, it is useful to show toasts in UI.
This commit is contained in:
silverwind 2023-06-27 04:45:24 +02:00 committed by GitHub
parent 72c60f94c1
commit c71e8abbc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 220 additions and 20 deletions

View file

@ -0,0 +1,11 @@
import {showInfoToast, showWarningToast, showErrorToast} from '../modules/toast.js';
document.getElementById('info-toast').addEventListener('click', () => {
showInfoToast('success 😀');
});
document.getElementById('warning-toast').addEventListener('click', () => {
showWarningToast('warning 😐');
});
document.getElementById('error-toast').addEventListener('click', () => {
showErrorToast('error 🙁');
});