mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
refactor: hooks useConfirm (#998)
This commit is contained in:
@@ -21,7 +21,7 @@ const PopoverContent = () => {
|
||||
const { editor } = useAppState();
|
||||
const { toggleFavoritePage, toggleDeletePage } = usePageHelper();
|
||||
const { changePageMode } = usePageHelper();
|
||||
const { confirm } = useConfirm();
|
||||
const confirm = useConfirm(store => store.confirm);
|
||||
const { t } = useTranslation();
|
||||
const {
|
||||
mode = 'page',
|
||||
|
||||
@@ -10,7 +10,7 @@ export const TrashButtonGroup = () => {
|
||||
const { permanentlyDeletePage } = usePageHelper();
|
||||
const { currentWorkspace } = useAppState();
|
||||
const { toggleDeletePage } = usePageHelper();
|
||||
const { confirm } = useConfirm();
|
||||
const confirm = useConfirm(store => store.confirm);
|
||||
const router = useRouter();
|
||||
const { id = '' } = useCurrentPageMeta() || {};
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -19,7 +19,7 @@ export const OperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => {
|
||||
const { id, favorite } = pageMeta;
|
||||
const { openPage } = usePageHelper();
|
||||
const { toggleFavoritePage, toggleDeletePage } = usePageHelper();
|
||||
const { confirm } = useConfirm();
|
||||
const confirm = useConfirm(store => store.confirm);
|
||||
const { t } = useTranslation();
|
||||
const OperationMenu = (
|
||||
<>
|
||||
@@ -77,7 +77,7 @@ export const TrashOperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => {
|
||||
const { id } = pageMeta;
|
||||
const { openPage, getPageMeta } = usePageHelper();
|
||||
const { toggleDeletePage, permanentlyDeletePage } = usePageHelper();
|
||||
const { confirm } = useConfirm();
|
||||
const confirm = useConfirm(store => store.confirm);
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<FlexWrapper>
|
||||
|
||||
@@ -33,7 +33,7 @@ export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const { members, removeMember, loaded } = useMembers();
|
||||
const { triggerEnableWorkspaceModal } = useModal();
|
||||
const { t } = useTranslation();
|
||||
const { confirm } = useConfirm();
|
||||
const confirm = useConfirm(store => store.confirm);
|
||||
|
||||
if (workspace.provider === 'affine') {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user