show hide metadata dim
This commit is contained in:
1 parent
997c793c36
commit
3cfb8151eb
7 files changed
+78
-49
No files matched your search
@@ -2,17 +2,19 @@ import { AutomationMetadata } from "types/automations";
|
||||
import InputList from "components/Inputs/InputList";
|
||||
import InputText from "components/Inputs/InputText";
|
||||
import InputTextArea from "components/Inputs/InputTextArea";
|
||||
import { FC } from "react";
|
||||
|
||||
interface Props {
|
||||
className: string;
|
||||
metadata: AutomationMetadata;
|
||||
onUpdate: (m: AutomationMetadata) => void;
|
||||
}
|
||||
export function AutoInfoBox({
|
||||
export const AutoInfoBox: FC<Props> = ({
|
||||
metadata,
|
||||
onUpdate,
|
||||
className,
|
||||
}: Props) {
|
||||
children,
|
||||
}) => {
|
||||
|
||||
// aliases
|
||||
const onUpdateMetadata = <K extends keyof AutomationMetadata>(k: K) => (update: AutomationMetadata[K]) => onUpdate({
|
||||
@@ -36,5 +38,6 @@ export function AutoInfoBox({
|
||||
'restart'
|
||||
]}
|
||||
/>
|
||||
{children}
|
||||
</div>
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import { DAGBoardElmDims } from "components/DAGSvgs/DAGBoard";
|
||||
import { InfoIcon } from "components/Icons";
|
||||
import { Button } from "components/Inputs/Button";
|
||||
import { SequenceNodes } from "components/SequenceNodes";
|
||||
import { FC } from "react";
|
||||
import { FC, useState } from "react";
|
||||
import { AutomationData, AutomationSequenceNode } from "types/automations";
|
||||
import useWindowSize from "utils/useWindowSize";
|
||||
import { AutoInfoBox } from "./AutoInfoBox";
|
||||
@@ -19,7 +21,11 @@ export const AutomationEditor: FC<Props> = ({
|
||||
}) => {
|
||||
// state
|
||||
const { ratioWbh } = useWindowSize();
|
||||
const { classes } = useEditorStyles({});
|
||||
const [closeInfo, setCloseInfo] = useState(false);
|
||||
const { classes } = useEditorStyles({
|
||||
closeInfo,
|
||||
horizontalMode: ratioWbh < 0.75
|
||||
});
|
||||
|
||||
// alias
|
||||
const updateSequence = (sequence: AutomationSequenceNode[]) => onUpdate({
|
||||
@@ -28,14 +34,18 @@ export const AutomationEditor: FC<Props> = ({
|
||||
});
|
||||
|
||||
// render
|
||||
return <div className={classes.root} style={{
|
||||
flexDirection: ratioWbh >= 0.75 ? 'row' : 'column'
|
||||
}}>
|
||||
return <div className={classes.root}>
|
||||
<AutoInfoBox
|
||||
className={classes.infoBox}
|
||||
metadata={automation.metadata}
|
||||
onUpdate={metadata => onUpdate({ ...automation, metadata })}
|
||||
/>
|
||||
<InfoIcon
|
||||
className={classes.infoIcon}
|
||||
onClick={() => setCloseInfo(!closeInfo)}
|
||||
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
||||
/>
|
||||
|
||||
<SequenceNodes
|
||||
zoomLevel={1.5}
|
||||
startPoint={[0.5, 0.5]}
|
||||
|
||||
@@ -1,26 +1,45 @@
|
||||
import { createAppUseStyles } from "styles/theme";
|
||||
|
||||
|
||||
export const useEditorStyles = createAppUseStyles(theme => ({
|
||||
root: {
|
||||
export const useEditorStyles = createAppUseStyles<{
|
||||
closeInfo: boolean;
|
||||
horizontalMode: boolean;
|
||||
}>(theme => ({
|
||||
root: ({horizontalMode}) => ({
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
color: theme.primaryAccent,
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
},
|
||||
flexDirection: horizontalMode ? 'column' : 'row',
|
||||
}),
|
||||
dag: {
|
||||
borderWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
borderColor: theme.secondaryAccent,
|
||||
width: '100%',
|
||||
},
|
||||
infoBox: {
|
||||
infoBox: ({closeInfo}) => ({
|
||||
width: closeInfo ? 0 : 'auto',
|
||||
paddingLeft: '10px',
|
||||
paddingRight: '10px',
|
||||
display: 'flex',
|
||||
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',
|
||||
}
|
||||
})
|
||||
}))
|
||||
@@ -86,9 +86,7 @@ export const useStyles = createAppUseStyles<{
|
||||
transform: "rotate(90deg)"
|
||||
}
|
||||
}),
|
||||
icon: {
|
||||
transition: "200ms ease-out"
|
||||
},
|
||||
icon: {},
|
||||
deleteBtn,
|
||||
children: ({hasChildren}) => ({
|
||||
flex: 1,
|
||||
|
||||
@@ -66,7 +66,6 @@ export const useNodeStyles = createAppUseStyles<{
|
||||
height: '15px',
|
||||
width: '15px',
|
||||
cursor: 'pointer',
|
||||
transition: "500ms east-out",
|
||||
}
|
||||
return {
|
||||
root: {
|
||||
|
||||
@@ -53,7 +53,6 @@ export const useInputWrapperStyles = createAppUseStyles<{
|
||||
left: labelSize === 'normal' ? '0.75em' : '1em',
|
||||
top: labelSize === 'normal' ? '0.5em' : '0.25em',
|
||||
fontWeight: 'bold',
|
||||
transition: 'all 200ms',
|
||||
color: theme.primaryAccent,
|
||||
})
|
||||
}
|
||||
@@ -177,7 +176,6 @@ export const useInputBubblesStyles = createAppUseStyles<{}>(theme => ({
|
||||
backgroundColor: theme.secondary,
|
||||
color: theme.secondaryAccent,
|
||||
padding: "3px 7px",
|
||||
transition: "200ms ease-out",
|
||||
"&:hover": {
|
||||
borderRadius: 100,
|
||||
backgroundColor: Color(theme.primary).set('rgb.g', 150).alpha(0.35).hex(),
|
||||
|
||||
+31
-29
@@ -1,45 +1,47 @@
|
||||
|
||||
:root {
|
||||
--primary: #111111;
|
||||
--secondary: #1c1c1c;
|
||||
--primaryAccent: #bbbbbb;
|
||||
--primary : #111111;
|
||||
--secondary : #1c1c1c;
|
||||
--primaryAccent : #bbbbbb;
|
||||
--secondaryAccent: #929191;
|
||||
touch-action: pan-x pan-y;
|
||||
height: 100%;
|
||||
touch-action : pan-x pan-y;
|
||||
height : 100%;
|
||||
}
|
||||
|
||||
|
||||
html,
|
||||
body,
|
||||
#root {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden !important;
|
||||
font-family: Tahoma, Geneva, sans-serif;
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
margin : 0 !important;
|
||||
padding : 0 !important;
|
||||
height : 100vh;
|
||||
width : 100vw;
|
||||
overflow : hidden !important;
|
||||
font-family : Tahoma, Geneva, sans-serif;
|
||||
display : flex !important;
|
||||
align-items : center;
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: var(--secondary);
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--secondary-accent);
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--primary-accent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
* {
|
||||
transition: all 200ms ease-out;
|
||||
}
|
||||
Reference in new issue
Block a user