Skip to content

Commit c35bd43

Browse files
author
昔梦
committed
fix:Icon兼容svg补充弹窗中的Icon
1 parent 7799ad9 commit c35bd43

File tree

1 file changed

+10
-6
lines changed
  • packages/x-flow/src/components/PanelContainer

1 file changed

+10
-6
lines changed

packages/x-flow/src/components/PanelContainer/index.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
3939
const isDisabled = ['Input', 'Output'].includes(nodeType) || disabled;
4040
const [descVal, setDescVal] = useState(data?.desc);
4141
const [titleVal, setTitleVal] = useState(data?.title || nodeSetting?.title);
42-
const { hideDesc, nodeConfigPanelWidth } = nodeSetting;
42+
const { hideDesc, nodeConfigPanelWidth, iconSvg } = nodeSetting;
4343

4444
// const description = getDescription(nodeType, props.description);
4545
const handleNodeValueChange = debounce((data: any) => {
@@ -82,12 +82,16 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
8282
<div style={{ display: 'flex', alignItems: 'center', flex: 1 }}>
8383
<span
8484
className="icon-box"
85-
style={{ background: nodeSetting?.icon?.bgColor }}
85+
style={{ background: nodeSetting?.icon?.bgColor || '#F79009'}}
8686
>
87-
<Icon
88-
style={{ fontSize: 14, color: '#fff' }}
89-
type={nodeSetting?.icon?.type}
90-
/>
87+
{iconSvg ? (
88+
iconSvg
89+
) : (
90+
<Icon
91+
style={{ fontSize: 14, color: '#fff' }}
92+
type={nodeSetting?.icon?.type}
93+
/>
94+
)}
9195
</span>
9296
{isDisabled ? (
9397
<span style={{ marginLeft: '11px' }}>{nodeSetting?.title}</span>

0 commit comments

Comments
 (0)