Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat: modify the type of animation that appears for the pendant Add button

QiShaoXuan727c7428890b
diff --git a/libs/components/editor-core/src/block-pendant/pendant-render/PandentRender.tsx b/libs/components/editor-core/src/block-pendant/pendant-render/PandentRender.tsx
index 8b6c9bb53f..76ed0d4e32 100644
--- a/libs/components/editor-core/src/block-pendant/pendant-render/PandentRender.tsx
+++ b/libs/components/editor-core/src/block-pendant/pendant-render/PandentRender.tsx
@@ -1,5 +1,5 @@
import {
- MuiZoom,
+ MuiFade,
Popover,
PopperHandler,
styled,
@@ -100,16 +100,15 @@ export const PendantRender = ({ block }: { block: AsyncBlock }) => {
);
})}
{hasAddBtn ? (
- <MuiZoom in={showAddBtn}>
+ <MuiFade in={showAddBtn}>
<div>
<AddPendantPopover
block={block}
iconStyle={{ marginTop: 4 }}
container={blockRenderContainerRef.current}
- trigger="click"
/>
</div>
- </MuiZoom>
+ </MuiFade>
) : null}
</BlockPendantContainer>
);
diff --git a/libs/components/ui/src/mui.ts b/libs/components/ui/src/mui.ts
index 94025c5f5b..b0658ad526 100644
--- a/libs/components/ui/src/mui.ts
+++ b/libs/components/ui/src/mui.ts
@@ -51,6 +51,7 @@ import {
tooltipClasses,
Typography,
Zoom,
+ Fade,
} from '@mui/material';
export { alpha } from '@mui/system';
@@ -233,6 +234,11 @@ export const MuiInput = Input;
*/
export const MuiZoom = Zoom;
+/**
+ * @deprecated It is not recommended to use Mui directly, because the design will not refer to Mui's interaction logic.
+ */
+export const MuiFade = Fade;
+
/**
* @deprecated It is not recommended to use Mui directly, because the design will not refer to Mui's interaction logic.
*/