From d13a4694f7eab6f4a2a17649409904a15f505de3 Mon Sep 17 00:00:00 2001 From: simke9445 Date: Fri, 22 Mar 2024 01:10:19 +0100 Subject: [PATCH] make variable drawer readonly + show it on job page (closed initially) for viewing all job vars --- .../VariableDrawer.module.sass | 1 + .../variable-drawer/VariableDrawer.tsx | 21 +++++++--- .../src/pages/job-page/JobPage.tsx | 33 +++++++++------- .../src/pages/variables/nav/Nav.tsx | 39 +++++++++++-------- yarn.lock | 14 +++---- 5 files changed, 65 insertions(+), 43 deletions(-) diff --git a/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.module.sass b/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.module.sass index 53cc64ab..8c4b3536 100644 --- a/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.module.sass +++ b/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.module.sass @@ -15,6 +15,7 @@ background: var(--section-background-color) transform: rotate(270deg) top: 240px + backdrop-filter: blur(50px) .variables width: 280px diff --git a/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.tsx b/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.tsx index 4f849201..bc8c1adb 100644 --- a/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.tsx +++ b/apps/warp-protocol/src/pages/job-new/variable-drawer/VariableDrawer.tsx @@ -7,11 +7,16 @@ import { useState } from 'react'; import styles from './VariableDrawer.module.sass'; import { variableName } from 'utils/variable'; import { useCachedVariables } from '../useCachedVariables'; +import { useVariableDisplayDialog } from 'pages/job-page/panels/Condition/typed-expressions/dialogs/useVariableDisplayDialog'; -type VariableDrawerProps = UIElementProps & {}; +type VariableDrawerProps = UIElementProps & { + readOnly?: boolean; + open?: boolean; +}; export const VariableDrawer = (props: VariableDrawerProps) => { - const [drawerOpen, setDrawerOpen] = useState(true); + const { readOnly, open = true } = props; + const [drawerOpen, setDrawerOpen] = useState(open); const onToggleDrawer = () => { setDrawerOpen((open) => !open); }; @@ -19,6 +24,7 @@ export const VariableDrawer = (props: VariableDrawerProps) => { const { variables, saveVariable, removeVariable, updateVariable } = useCachedVariables(); const openEditVariableDialog = useEditVariableDialog(); + const openVariableDisplayDialog = useVariableDisplayDialog(); return ( {