feat: add toast for workspace deletion (#1825)

Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
Aditya Sharma
2023-04-05 19:17:14 +05:30
committed by GitHub
parent 116caff3c7
commit 0c87bf36ca
6 changed files with 23 additions and 7 deletions

View File

@@ -1,10 +1,14 @@
import type { ToastOptions } from '@affine/component';
import { toast as basicToast } from '@affine/component';
import { DebugLogger } from '@affine/debug';
const logger = new DebugLogger('toast');
export const toast = (message: string, options?: ToastOptions) => {
const mainContainer = document.querySelector(
'.main-container'
) as HTMLElement;
logger.debug(`toast with message: "${message}"`, options);
return basicToast(message, {
portal: mainContainer || document.body,
...options,