mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-16 00:32:36 +03:00
d412635f6b
new exports from `@affine/component`: ```ts import { ConfirmModalProvider, useConfirmModal } from "@affine/component" ``` Open confirm modal with hook: ```ts const Component = () => { const { openConfirmModal } = useConformModal(); const open = () => { openConfirmModal({ // props of ConfirmModal /** * will show loading state when confirm clicked, and close after onConfirm finished */ onConfirm: async () => { await new Promise((r) => setTimeout(r, 2000)); }, }); } return <Button onClick={open}>Open</Button> } ``` |
||
---|---|---|
.. | ||
component | ||
core | ||
electron | ||
electron-api | ||
graphql | ||
i18n | ||
native | ||
templates | ||
web | ||
workspace-impl |