nicer styling for editor close/open
This commit is contained in:
1 parent
cc591f854f
commit
039c0631de
6 files changed
+65
-49
No files matched your search
@@ -0,0 +1,18 @@
|
|||||||
|
.automation-editor--info-box {
|
||||||
|
min-width : 25px;
|
||||||
|
padding-left : 10px;
|
||||||
|
padding-right : 10px;
|
||||||
|
display : flex;
|
||||||
|
flex-direction : column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
overflow : auto;
|
||||||
|
padding-top : 5;
|
||||||
|
padding-bottom : 10;
|
||||||
|
position : relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .automation-editor--info-box.hide {} */
|
||||||
|
|
||||||
|
.automation-editor--info-box.hide>.automation-editor--info-box-inner {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "./AutoInfoBox.css";
|
||||||
import { AutomationMetadata } from "types/automations";
|
import { AutomationMetadata } from "types/automations";
|
||||||
import InputList from "components/Inputs/InputList";
|
import InputList from "components/Inputs/InputList";
|
||||||
import InputText from "components/Inputs/InputText";
|
import InputText from "components/Inputs/InputText";
|
||||||
@@ -23,21 +24,23 @@ export const AutoInfoBox: FC<Props> = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// render
|
// render
|
||||||
return <div className={className}>
|
return <div className={`automation-editor--info-box ${className}`}>
|
||||||
<InputText label="ID" value={metadata.id} onChange={onUpdateMetadata('id')} />
|
<div className="automation-editor--info-box-inner">
|
||||||
<InputText label="Name" value={metadata.alias} onChange={onUpdateMetadata('alias')} />
|
<InputText label="ID" value={metadata.id} onChange={onUpdateMetadata('id')} />
|
||||||
<InputTextArea label="Description" value={metadata.description} onChange={onUpdateMetadata('description')} />
|
<InputText label="Name" value={metadata.alias} onChange={onUpdateMetadata('alias')} />
|
||||||
<InputList
|
<InputTextArea label="Description" value={metadata.description} onChange={onUpdateMetadata('description')} />
|
||||||
label="Mode"
|
<InputList
|
||||||
current={metadata.mode}
|
label="Mode"
|
||||||
onChange={onUpdateMetadata('mode')}
|
current={metadata.mode}
|
||||||
options={[
|
onChange={onUpdateMetadata('mode')}
|
||||||
'parallel',
|
options={[
|
||||||
'single',
|
'parallel',
|
||||||
'queued',
|
'single',
|
||||||
'restart'
|
'queued',
|
||||||
]}
|
'restart'
|
||||||
/>
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.automation-editor--info-icon {
|
||||||
|
position: absolute;
|
||||||
|
right : 10px;
|
||||||
|
z-index : 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.automation-editor--info-box.hide>.automation-editor--info-icon {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
|
import "./index.css";
|
||||||
import { DAGBoardElmDims } from "components/DAGSvgs/DAGBoard";
|
import { DAGBoardElmDims } from "components/DAGSvgs/DAGBoard";
|
||||||
import { InfoIcon } from "components/Icons";
|
import { ArrowIcon } from "components/Icons";
|
||||||
import { SequenceNodes } from "components/SequenceNodes";
|
import { SequenceNodes } from "components/SequenceNodes";
|
||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import { AutomationData, AutomationSequenceNode } from "types/automations";
|
import { AutomationData, AutomationSequenceNode } from "types/automations";
|
||||||
@@ -11,6 +12,7 @@ import { chain } from "utils/iter";
|
|||||||
import { AutomationTrigger } from 'types/automations/triggers';
|
import { AutomationTrigger } from 'types/automations/triggers';
|
||||||
import { Modal } from "components/Modal";
|
import { Modal } from "components/Modal";
|
||||||
import { NodeEditor } from "components/NodeEditor";
|
import { NodeEditor } from "components/NodeEditor";
|
||||||
|
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||||
|
|
||||||
interface TriggerEditorModalState {
|
interface TriggerEditorModalState {
|
||||||
trigger: AutomationTrigger;
|
trigger: AutomationTrigger;
|
||||||
@@ -56,15 +58,16 @@ export const AutomationEditor: FC<Props> = ({
|
|||||||
/>}
|
/>}
|
||||||
</Modal>
|
</Modal>
|
||||||
<AutoInfoBox
|
<AutoInfoBox
|
||||||
className={classes.infoBox}
|
className={closeInfo ? "hide" : "show"}
|
||||||
metadata={automation.metadata}
|
metadata={automation.metadata}
|
||||||
onUpdate={metadata => onUpdate({ ...automation, metadata })}
|
onUpdate={metadata => onUpdate({ ...automation, metadata })}
|
||||||
/>
|
>
|
||||||
<InfoIcon
|
<ButtonIcon
|
||||||
className={classes.infoIcon}
|
className={`${classes.infoIcon} automation-editor--info-icon`}
|
||||||
onClick={() => setCloseInfo(!closeInfo)}
|
onClick={() => setCloseInfo(!closeInfo)}
|
||||||
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
||||||
/>
|
>{ArrowIcon}</ButtonIcon>
|
||||||
|
</AutoInfoBox>
|
||||||
|
|
||||||
<SequenceNodes
|
<SequenceNodes
|
||||||
zoomLevel={1.5}
|
zoomLevel={1.5}
|
||||||
|
|||||||
@@ -18,28 +18,7 @@ export const useEditorStyles = createAppUseStyles<{
|
|||||||
borderColor: theme.secondaryAccent,
|
borderColor: theme.secondaryAccent,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
},
|
},
|
||||||
infoBox: ({closeInfo}) => ({
|
infoIcon: ({horizontalMode}) => ({
|
||||||
width: closeInfo ? 0 : 'auto',
|
bottom: horizontalMode ? '90%' : 10
|
||||||
paddingLeft: '10px',
|
|
||||||
paddingRight: '10px',
|
|
||||||
display: closeInfo ? 'none' : 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
justifyContent: 'flex-start',
|
|
||||||
overflow: 'auto',
|
|
||||||
paddingTop: 5,
|
|
||||||
paddingBottom: 10,
|
|
||||||
position: 'relative',
|
|
||||||
}),
|
|
||||||
infoIcon: ({closeInfo, horizontalMode}) => ({
|
|
||||||
position: 'absolute',
|
|
||||||
top: horizontalMode ? '90%' : 10,
|
|
||||||
left: horizontalMode ? "3%" : closeInfo ? "2.5%" :"20%",
|
|
||||||
zIndex: 10,
|
|
||||||
background: theme.secondary,
|
|
||||||
"&:hover": {
|
|
||||||
background: theme.secondaryAccent,
|
|
||||||
borderRadius: 100,
|
|
||||||
cursor: 'pointer',
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
@@ -23,6 +23,10 @@ const useButtonIconStyles = createAppUseStyles(theme => ({
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
export const ButtonIcon: FC<ButtonIconProps> = props => <props.children
|
export const ButtonIcon: FC<ButtonIconProps> = ({
|
||||||
className={useButtonIconStyles({}).classes.buttonIcon}
|
children: Child,
|
||||||
/>
|
className,
|
||||||
|
...props
|
||||||
|
}) => <Child
|
||||||
|
className={`${useButtonIconStyles({}).classes.buttonIcon} ${className}`} {...props}
|
||||||
|
/>
|
||||||
Reference in new issue
Block a user