From 6a757e3cc320ee396624e04df888e0324f1e66c8 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Sun, 1 Dec 2024 20:50:50 +0100 Subject: [PATCH] show icon if help text defined --- .../components/Flow/components/Checklist.tsx | 10 +++++++++- .../FlowEditor/components/Flow/components/Question.tsx | 10 +++++++++- .../components/FlowEditor/ToggleHelpTextButton.tsx | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Checklist.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Checklist.tsx index b56db2325c..54742247a9 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Checklist.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Checklist.tsx @@ -1,3 +1,4 @@ +import Help from "@mui/icons-material/Help"; import Box from "@mui/material/Box"; import { ComponentType as TYPES, @@ -25,10 +26,11 @@ type Props = { } & NodeTags; const Checklist: React.FC = React.memo((props) => { - const [isClone, childNodes, copyNode] = useStore((state) => [ + const [isClone, childNodes, copyNode, showHelpText] = useStore((state) => [ state.isClone, state.childNodesOf(props.id), state.copyNode, + state.showHelpText, ]); const parent = getParentId(props.parent); @@ -76,6 +78,9 @@ const Checklist: React.FC = React.memo((props) => { const Icon = ICONS[props.type]; + const hasHelpText = + props.data.policyRef || props.data.info || props.data.howMeasured; + return ( <>