From 4b3028355db5d58601343bf8907116919d1c8f2c Mon Sep 17 00:00:00 2001 From: Ari Date: Sat, 23 Apr 2022 23:10:17 -0400 Subject: [PATCH] nicer edit style --- webapp/src/components/AutomationEditor/index.tsx | 9 +++++---- webapp/src/components/AutomationEditor/styles.ts | 11 +++++++++-- .../AutomationList/AutomationListBox.stories.tsx | 1 - 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/webapp/src/components/AutomationEditor/index.tsx b/webapp/src/components/AutomationEditor/index.tsx index ba31e98..53ed85b 100644 --- a/webapp/src/components/AutomationEditor/index.tsx +++ b/webapp/src/components/AutomationEditor/index.tsx @@ -39,7 +39,8 @@ export const AutomationEditor: FC = ({ const [modalState, setModalState] = useState(null); const { classes } = useEditorStyles({ closeInfo, - horizontalMode: ratioWbh < 0.75 + horizontalMode: ratioWbh < 0.75, + autoChanged, }); // alias @@ -95,7 +96,7 @@ export const AutomationEditor: FC = ({ onChange={z => setZoomLevel(z.target.valueAsNumber ?? 40)} /> - {autoChanged !== 'unchanged' && } + Save + (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" + }), })) diff --git a/webapp/src/components/AutomationList/AutomationListBox.stories.tsx b/webapp/src/components/AutomationList/AutomationListBox.stories.tsx index 711e585..8617b16 100644 --- a/webapp/src/components/AutomationList/AutomationListBox.stories.tsx +++ b/webapp/src/components/AutomationList/AutomationListBox.stories.tsx @@ -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 {