From 7488ecc3aedb566f7c5dee6f7c19b85d122796a0 Mon Sep 17 00:00:00 2001 From: Ari Date: Wed, 29 Jun 2022 21:43:46 -0400 Subject: [PATCH] onSave --- .../ConditionEditor/ConditionNodeBase.tsx | 2 +- .../ConditionEditor/ConditionNodeSettings.css | 11 +++++++- .../ConditionEditor/ConditionNodeSettings.tsx | 27 ++++++++----------- webapp/src/components/NodeEditor/index.tsx | 1 + 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/webapp/src/components/ConditionEditor/ConditionNodeBase.tsx b/webapp/src/components/ConditionEditor/ConditionNodeBase.tsx index e6d3ee8..ed6114b 100644 --- a/webapp/src/components/ConditionEditor/ConditionNodeBase.tsx +++ b/webapp/src/components/ConditionEditor/ConditionNodeBase.tsx @@ -54,7 +54,7 @@ export const ConditionNodeBase: FC = (props) => { childrenConditions = ( ); diff --git a/webapp/src/components/ConditionEditor/ConditionNodeSettings.css b/webapp/src/components/ConditionEditor/ConditionNodeSettings.css index 74ae867..81a65f0 100644 --- a/webapp/src/components/ConditionEditor/ConditionNodeSettings.css +++ b/webapp/src/components/ConditionEditor/ConditionNodeSettings.css @@ -1,5 +1,10 @@ .condition-node--settings { - width: 3em; + width: 4em; + display: flex; + gap: 0.5em; + flex-direction: column; + justify-content: center; + align-items: center; } .condition-node--settings--icons { @@ -21,6 +26,10 @@ cursor: not-allowed; } +.condition-node--settings .speed-dial, .condition-node--settings .speed-dial--icon { + min-height: 2.5em; + height: 2.5em; +} .condition-node--settings .speed-dial--button { max-width: 4em; diff --git a/webapp/src/components/ConditionEditor/ConditionNodeSettings.tsx b/webapp/src/components/ConditionEditor/ConditionNodeSettings.tsx index 4452002..b627784 100644 --- a/webapp/src/components/ConditionEditor/ConditionNodeSettings.tsx +++ b/webapp/src/components/ConditionEditor/ConditionNodeSettings.tsx @@ -24,9 +24,6 @@ export type ConditionNodeViewMode = "edit" | "yaml" | "view"; export const ConditionNodeSettings: FC = ( props ) => { - // state - const { isMobile } = useWindowSize(); - // alias const showDelete = !props.disableDelete && !!props.onDelete; const createModeSwitch = (m: ConditionNodeViewMode) => () => { @@ -48,12 +45,6 @@ export const ConditionNodeSettings: FC = ( onClick: createModeSwitch("yaml"), color: "info", }, - { - color: "success", - icon: , - disabled: !props.isEdited, - onClick: props.onSave, - }, ]; if (showDelete) { buttons.push({ @@ -66,23 +57,27 @@ export const ConditionNodeSettings: FC = ( return (
} - color={props.isEdited ? "success" : "default"} - /> - } + icon={} />} direction="left" > {buttons.map((opt, i) => ( ))} + {props.isEdited && ( + } + color="success" + disabled={!props.isEdited} + onClick={props.onSave} + /> + )}
); }; diff --git a/webapp/src/components/NodeEditor/index.tsx b/webapp/src/components/NodeEditor/index.tsx index 4539519..e7f7e34 100644 --- a/webapp/src/components/NodeEditor/index.tsx +++ b/webapp/src/components/NodeEditor/index.tsx @@ -133,6 +133,7 @@ export const NodeEditor: FC = ({