feat: refactor the usage of toast (#1699)

This commit is contained in:
Qi
2023-03-27 13:24:14 +08:00
committed by GitHub
parent 66dec34209
commit 449ffbc73f
14 changed files with 60 additions and 44 deletions
+12
View File
@@ -0,0 +1,12 @@
import type { ToastOptions } from '@affine/component';
import { toast as basicToast } from '@affine/component';
export const toast = (message: string, options?: ToastOptions) => {
const mainContainer = document.querySelector(
'.main-container'
) as HTMLElement;
return basicToast(message, {
portal: mainContainer || document.body,
...options,
});
};