feat(flowEditor): 添加 useDefault 属性控制 actionBar 显示

master
钟良源 4 months ago
parent 354ae04092
commit f61fdf2b28

@ -7,6 +7,7 @@ import { useSelector, useDispatch } from 'react-redux';
const ButtonGroup = Button.Group;
interface ActionBarProps {
useDefault: boolean;
onSave?: () => void;
onUndo?: () => void;
onRedo?: () => void;
@ -17,6 +18,7 @@ interface ActionBarProps {
}
const ActionBar: React.FC<ActionBarProps> = ({
useDefault,
onSave,
onUndo,
onRedo,
@ -39,6 +41,8 @@ const ActionBar: React.FC<ActionBarProps> = ({
return (
<div className="action-bar">
<Button onClick={onSave} type="primary" shape="round" icon={<IconSave />}></Button>
{useDefault && (
<>
<ButtonGroup style={{ marginLeft: 8 }}>
<Button
type="outline"
@ -67,7 +71,7 @@ const ActionBar: React.FC<ActionBarProps> = ({
icon={<IconUndo />}
onClick={onUndo}
disabled={!canUndo}
status='danger'
status="danger"
style={{ padding: '0 8px', backgroundColor: '#fff' }}
>
@ -83,6 +87,8 @@ const ActionBar: React.FC<ActionBarProps> = ({
</Button>
</ButtonGroup>
</>
)}
</div>
);
};

Loading…
Cancel
Save