From b46aaa5726ebe477636a4364a05fbe5f96f3b871 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 9 Sep 2024 16:53:31 +0200 Subject: [PATCH 01/11] fix: Tab labels --- app/components/chart-selection-tabs.tsx | 78 +++++++++++++------------ 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/app/components/chart-selection-tabs.tsx b/app/components/chart-selection-tabs.tsx index f49edea46..d0a883e65 100644 --- a/app/components/chart-selection-tabs.tsx +++ b/app/components/chart-selection-tabs.tsx @@ -6,7 +6,7 @@ import { Stack, tabClasses, Theme, - Typography + Typography, } from "@mui/material"; import { makeStyles } from "@mui/styles"; import clsx from "clsx"; @@ -145,13 +145,12 @@ const TabsEditable = (props: TabsEditableProps) => { const addNewDatasetFlag = useFlag("configurator.add-dataset.new"); - const switchChart = (key: string) => { dispatch({ type: "SWITCH_ACTIVE_CHART", value: key, }); - } + }; return ( <> @@ -276,20 +275,23 @@ const TabsEditable = (props: TabsEditableProps) => { }} onClose={handleClose} > - {isConfiguringChart && Edit tab label} - onClick={() => { + {isConfiguringChart && ( + Edit tab label + } + onClick={() => { switchChart(tabsState.activeChartKey); dispatch({ type: "CHART_ACTIVE_FIELD_CHANGED", - value: 'label' + value: "label", }); - }} - - />} + }} + /> + )} (d.active ? palette.primary.main : palette.secondary.active), }, @@ -652,28 +654,32 @@ const TabContent = (props: { }); return ( - {label || showAddLabel ? ( - - ) : null} + }} + > + + + label || !editable + ? "inherit" + : `${t.palette.grey[500]} !important`, + }} + > + {label || showAddLabel ? label || `[ ${addLabel} ]` : null} + + {editable && (