mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 22:37:04 +08:00
feat: add toast for workspace deletion (#1825)
Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
@@ -38,7 +38,10 @@ const createToastContainer = (portal?: HTMLElement) => {
|
||||
flex-direction: column-reverse;
|
||||
align-items: center;
|
||||
`;
|
||||
const template = html`<div style="${styles}"></div>`;
|
||||
const template = html`<div
|
||||
style="${styles}"
|
||||
data-testid="affine-toast-container"
|
||||
></div>`;
|
||||
const element = htmlToElement<HTMLDivElement>(template);
|
||||
portal.appendChild(element);
|
||||
return element;
|
||||
@@ -80,7 +83,10 @@ export const toast = (
|
||||
opacity: 0;
|
||||
`;
|
||||
|
||||
const template = html`<div style="${styles}"></div>`;
|
||||
const template = html`<div
|
||||
style="${styles}"
|
||||
data-testid="affine-toast"
|
||||
></div>`;
|
||||
const element = htmlToElement<HTMLDivElement>(template);
|
||||
// message is not trusted
|
||||
element.textContent = message;
|
||||
|
||||
@@ -96,7 +96,7 @@ type SettingProps<Flavour extends keyof WorkspaceRegistry> =
|
||||
UIBaseProps<Flavour> & {
|
||||
currentTab: SettingPanel;
|
||||
onChangeTab: (tab: SettingPanel) => void;
|
||||
onDeleteWorkspace: () => void;
|
||||
onDeleteWorkspace: () => Promise<void>;
|
||||
onTransformWorkspace: <
|
||||
From extends keyof WorkspaceRegistry,
|
||||
To extends keyof WorkspaceRegistry
|
||||
|
||||
Reference in New Issue
Block a user