Skip to content

Commit

Permalink
Merge pull request #1592 from visualize-admin/feat/no-label
Browse files Browse the repository at this point in the history
feat: Allow a tab not to have a label
  • Loading branch information
ptbrowne authored Jun 11, 2024
2 parents 3c7315d + 1a6fb84 commit e9bf51f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions app/components/chart-selection-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const ChartSelectionTabs = () => {
? d.meta.title[locale]
: d.meta.title[defaultLocale] !== ""
? d.meta.title[defaultLocale]
: t({ id: "annotation.add.title" }),
: undefined,
};
});

Expand Down Expand Up @@ -356,7 +356,7 @@ type TabDatum = {
key: string;
chartType: ChartType;
active: boolean;
label: string;
label?: string | undefined;
};

type TabsFixedProps = {
Expand Down Expand Up @@ -757,7 +757,7 @@ const TabsInner = (props: TabsInnerProps) => {
sx={{
px: 0,
flexShrink: 1,
minWidth: 180,
minWidth: d.label ? 180 : 0,
flexBasis: "100%",
}}
label={
Expand Down Expand Up @@ -936,14 +936,16 @@ const TabContent = (props: TabContentProps) => {
</Button>

{label ? (
<Button
variant="text"
color="primary"
className={classes.label}
onClick={onSwitchClick}
>
{label}
</Button>
<Tooltip title={label} enterDelay={750}>
<Button
variant="text"
color="primary"
className={classes.label}
onClick={onSwitchClick}
>
{label}
</Button>
</Tooltip>
) : null}
{editable && (
<Button
Expand Down

0 comments on commit e9bf51f

Please sign in to comment.