nicer edit style

This commit is contained in:
ari committed 2022-04-23 23:10:17 -04:00
1 parent 46209564f0
commit 4b3028355d
3 files changed
+14 -7

No files matched your search

@@ -39,7 +39,8 @@ export const AutomationEditor: FC<Props> = ({
const [modalState, setModalState] = useState<null | TriggerEditorModalState>(null);
const { classes } = useEditorStyles({
closeInfo,
horizontalMode: ratioWbh < 0.75
horizontalMode: ratioWbh < 0.75,
autoChanged,
});
// alias
@@ -95,7 +96,7 @@ export const AutomationEditor: FC<Props> = ({
onChange={z => setZoomLevel(z.target.valueAsNumber ?? 40)}
/>
</div>
{autoChanged !== 'unchanged' && <Button
<Button
className={classes.saveBtn}
onClick={() => {
if (autoChanged === 'changed') {
@@ -105,8 +106,8 @@ export const AutomationEditor: FC<Props> = ({
}}
disabled={autoChanged !== 'changed'}
>
Save <CheckMarkIcon />
</Button>}
Save <CheckMarkIcon color="#bf4" />
</Button>
</div>
<SequenceNodes
zoomLevel={zoomLevel * 200 / 100 + 50}
@@ -4,6 +4,7 @@ import { createAppUseStyles } from "styles/theme";
export const useEditorStyles = createAppUseStyles<{
closeInfo: boolean;
horizontalMode: boolean;
autoChanged: string;
}>(theme => ({
wrapper: {
display: 'flex',
@@ -44,12 +45,18 @@ export const useEditorStyles = createAppUseStyles<{
flexDirection: "row",
justifyContent: 'space-between',
alignItems: "center",
padding: "0.5em",
},
saveBtn: {
saveBtn: ({ autoChanged }) => ({
display: "flex",
opacity: autoChanged === "changed" ? 1 : 0,
height: autoChanged === "changed" ? undefined : 0,
fontSize: autoChanged === "changed" ? undefined : 0,
gap: '0.5em',
maxHeight: '1em',
justifyContent: 'center',
alignItems: 'center',
}
borderColor: "#bf4 !important",
color: "#bf4 !important"
}),
}))
@@ -1,7 +1,6 @@
import { ComponentMeta, ComponentStory } from "@storybook/react";
import { useState } from "react";
import { AutomationListBox } from "./AutomationListBox";
import { NODE_HEIGHT, NODE_WIDTH, ADD_HEIGHT, ADD_WIDTH, CIRCLE_SIZE, DISTANCE_FACTOR } from 'components/DAGSvgs/constants';
import { createMockAuto } from "utils/mocks";
export default {