diff options
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r-- | ui/src/utils.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 2820bc48..570ea48c 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -487,6 +487,29 @@ export function toast(text: string, background: string = 'success') { }).showToast(); } +export function pictrsDeleteToast( + clickToDeleteText: string, + deletePictureText: string, + deleteUrl: string +) { + let backgroundColor = `var(--light)`; + let toast = Toastify({ + text: clickToDeleteText, + backgroundColor: backgroundColor, + gravity: 'top', + position: 'right', + duration: 0, + onClick: () => { + if (toast) { + window.location.replace(deleteUrl); + alert(deletePictureText); + toast.hideToast(); + } + }, + close: true, + }).showToast(); +} + export function messageToastify( creator: string, avatar: string, |