mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
fix(core): add toast message (#3847)
This commit is contained in:
@@ -11,6 +11,7 @@ import { useCallback, useState } from 'react';
|
|||||||
import { useBlockSuiteMetaHelper } from '../../../hooks/affine/use-block-suite-meta-helper';
|
import { useBlockSuiteMetaHelper } from '../../../hooks/affine/use-block-suite-meta-helper';
|
||||||
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
|
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
|
||||||
import { useNavigateHelper } from '../../../hooks/use-navigate-helper';
|
import { useNavigateHelper } from '../../../hooks/use-navigate-helper';
|
||||||
|
import { toast } from '../../../utils';
|
||||||
import { buttonContainer, group } from './styles.css';
|
import { buttonContainer, group } from './styles.css';
|
||||||
|
|
||||||
export const TrashButtonGroup = () => {
|
export const TrashButtonGroup = () => {
|
||||||
@@ -37,6 +38,7 @@ export const TrashButtonGroup = () => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
restoreFromTrash(pageId);
|
restoreFromTrash(pageId);
|
||||||
|
toast(t['restored']({ title: pageMeta.title || 'Untitled' }));
|
||||||
}}
|
}}
|
||||||
size="large"
|
size="large"
|
||||||
>
|
>
|
||||||
@@ -63,7 +65,8 @@ export const TrashButtonGroup = () => {
|
|||||||
onConfirm={useCallback(() => {
|
onConfirm={useCallback(() => {
|
||||||
jumpToSubPath(workspace.id, WorkspaceSubPath.ALL);
|
jumpToSubPath(workspace.id, WorkspaceSubPath.ALL);
|
||||||
blockSuiteWorkspace.removePage(pageId);
|
blockSuiteWorkspace.removePage(pageId);
|
||||||
}, [blockSuiteWorkspace, jumpToSubPath, pageId, workspace.id])}
|
toast(t['Permanently deleted']());
|
||||||
|
}, [blockSuiteWorkspace, jumpToSubPath, pageId, workspace.id, t])}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user