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 InputList from "components/Inputs/InputList";
|
||||
import InputText from "components/Inputs/InputText";
|
||||
@@ -23,21 +24,23 @@ export const AutoInfoBox: FC<Props> = ({
|
||||
})
|
||||
|
||||
// render
|
||||
return <div className={className}>
|
||||
<InputText label="ID" value={metadata.id} onChange={onUpdateMetadata('id')} />
|
||||
<InputText label="Name" value={metadata.alias} onChange={onUpdateMetadata('alias')} />
|
||||
<InputTextArea label="Description" value={metadata.description} onChange={onUpdateMetadata('description')} />
|
||||
<InputList
|
||||
label="Mode"
|
||||
current={metadata.mode}
|
||||
onChange={onUpdateMetadata('mode')}
|
||||
options={[
|
||||
'parallel',
|
||||
'single',
|
||||
'queued',
|
||||
'restart'
|
||||
]}
|
||||
/>
|
||||
return <div className={`automation-editor--info-box ${className}`}>
|
||||
<div className="automation-editor--info-box-inner">
|
||||
<InputText label="ID" value={metadata.id} onChange={onUpdateMetadata('id')} />
|
||||
<InputText label="Name" value={metadata.alias} onChange={onUpdateMetadata('alias')} />
|
||||
<InputTextArea label="Description" value={metadata.description} onChange={onUpdateMetadata('description')} />
|
||||
<InputList
|
||||
label="Mode"
|
||||
current={metadata.mode}
|
||||
onChange={onUpdateMetadata('mode')}
|
||||
options={[
|
||||
'parallel',
|
||||
'single',
|
||||
'queued',
|
||||
'restart'
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
{children}
|
||||
</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 { InfoIcon } from "components/Icons";
|
||||
import { ArrowIcon } from "components/Icons";
|
||||
import { SequenceNodes } from "components/SequenceNodes";
|
||||
import { FC, useState } from "react";
|
||||
import { AutomationData, AutomationSequenceNode } from "types/automations";
|
||||
@@ -11,6 +12,7 @@ import { chain } from "utils/iter";
|
||||
import { AutomationTrigger } from 'types/automations/triggers';
|
||||
import { Modal } from "components/Modal";
|
||||
import { NodeEditor } from "components/NodeEditor";
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
|
||||
interface TriggerEditorModalState {
|
||||
trigger: AutomationTrigger;
|
||||
@@ -56,15 +58,16 @@ export const AutomationEditor: FC<Props> = ({
|
||||
/>}
|
||||
</Modal>
|
||||
<AutoInfoBox
|
||||
className={classes.infoBox}
|
||||
className={closeInfo ? "hide" : "show"}
|
||||
metadata={automation.metadata}
|
||||
onUpdate={metadata => onUpdate({ ...automation, metadata })}
|
||||
/>
|
||||
<InfoIcon
|
||||
className={classes.infoIcon}
|
||||
onClick={() => setCloseInfo(!closeInfo)}
|
||||
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
||||
/>
|
||||
>
|
||||
<ButtonIcon
|
||||
className={`${classes.infoIcon} automation-editor--info-icon`}
|
||||
onClick={() => setCloseInfo(!closeInfo)}
|
||||
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
||||
>{ArrowIcon}</ButtonIcon>
|
||||
</AutoInfoBox>
|
||||
|
||||
<SequenceNodes
|
||||
zoomLevel={1.5}
|
||||
|
||||
@@ -18,28 +18,7 @@ export const useEditorStyles = createAppUseStyles<{
|
||||
borderColor: theme.secondaryAccent,
|
||||
width: '100%',
|
||||
},
|
||||
infoBox: ({closeInfo}) => ({
|
||||
width: closeInfo ? 0 : 'auto',
|
||||
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',
|
||||
}
|
||||
infoIcon: ({horizontalMode}) => ({
|
||||
bottom: horizontalMode ? '90%' : 10
|
||||
})
|
||||
}))
|
||||
@@ -23,6 +23,10 @@ const useButtonIconStyles = createAppUseStyles(theme => ({
|
||||
}))
|
||||
|
||||
|
||||
export const ButtonIcon: FC<ButtonIconProps> = props => <props.children
|
||||
className={useButtonIconStyles({}).classes.buttonIcon}
|
||||
/>
|
||||
export const ButtonIcon: FC<ButtonIconProps> = ({
|
||||
children: Child,
|
||||
className,
|
||||
...props
|
||||
}) => <Child
|
||||
className={`${useButtonIconStyles({}).classes.buttonIcon} ${className}`} {...props}
|
||||
/>
|
||||
Reference in new issue
Block a user