Skip to content

Commit

Permalink
fix:修复TitleMenuTooltip标题显示不正确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
昔梦 committed Jan 3, 2025
1 parent 9f6125d commit a41d12e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo } from 'react';
import createIconFont from '../../utils/createIconFont';

const TitleMenuTooltip = ({ icon, title, description, iconFontUrl, iconSvg }: any) => {
const TitleMenuTooltip = ({ icon, nodeSettingTitle, description, iconFontUrl, iconSvg }: any) => {
const IconBox = useMemo(() => createIconFont(iconFontUrl), [iconFontUrl]);

return (
Expand All @@ -11,7 +11,7 @@ const TitleMenuTooltip = ({ icon, title, description, iconFontUrl, iconSvg }: an
{iconSvg ? iconSvg :<IconBox type={icon?.type} style={{ color: '#fff', fontSize: 13, ...icon?.style }} />}
</div>
<div className='title'>
{title}
{nodeSettingTitle}
</div>
</div>
<div className='description'>
Expand Down
1 change: 1 addition & 0 deletions packages/x-flow/src/components/NodeContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default memo((props: any) => {
iconSvg,
hideTitleTips,
isSwitchBottom,
nodeSettingTitle
} = props;
const IconBox = useMemo(() => createIconFont(iconFontUrl), [iconFontUrl]);

Expand Down
1 change: 1 addition & 0 deletions packages/x-flow/src/nodes/node-common/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default memo((props: any) => {
description={nodeDescription} // 不允许用户更改的节点描述
iconSvg={nodeSetting?.iconSvg}
hideTitleTips={hideTitleTips}
nodeSettingTitle={nodeSetting.title}
/>
);
});
1 change: 1 addition & 0 deletions packages/x-flow/src/nodes/node-end/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default memo((props: any) => {
description={nodeDescription} // 不允许用户更改的节点描述
iconSvg={nodeSetting?.iconSvg}
hideTitleTips={hideTitleTips}
nodeSettingTitle={nodeSetting.title||'结束'}
/>
);
});
1 change: 1 addition & 0 deletions packages/x-flow/src/nodes/node-parallel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default memo((props: any) => {
iconSvg={nodeSetting?.iconSvg}
hideTitleTips={hideTitleTips}
isSwitchBottom={isSwitchBottom}
nodeSettingTitle={nodeSetting?.title || 'parallel'}
/>
);
});
1 change: 1 addition & 0 deletions packages/x-flow/src/nodes/node-start/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default memo((props: any) => {
description={nodeDescription} // 不允许用户更改的节点描述
iconSvg={nodeSetting?.iconSvg}
hideTitleTips={hideTitleTips}
nodeSettingTitle={nodeSetting?.title || '开始'}
/>
);
});
1 change: 1 addition & 0 deletions packages/x-flow/src/nodes/node-switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default memo((props: any) => {
iconSvg={nodeSetting?.iconSvg}
hideTitleTips={hideTitleTips}
isSwitchBottom={isSwitchBottom}
nodeSettingTitle={nodeSetting?.title || 'Switch'}
/>
);
});

0 comments on commit a41d12e

Please sign in to comment.