Skip to content

Commit 1cd14b2

Browse files
committed
fix: Correctly align loading indicator
Use margin-left: auto to align badge to the right
1 parent acae8f2 commit 1cd14b2

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

app/configurator/components/chart-configurator.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
FormControlLabel,
1313
FormControlLabelProps,
1414
Badge,
15+
BadgeProps,
1516
} from "@mui/material";
1617
import { makeStyles } from "@mui/styles";
1718
import isEmpty from "lodash/isEmpty";
@@ -493,15 +494,15 @@ const InteractiveDataFilterCheckbox = ({
493494
);
494495
};
495496

496-
const FiltersBadge = () => {
497+
const FiltersBadge = ({ sx }: { sx?: BadgeProps["sx"] }) => {
497498
const ctx = useControlSectionContext();
498499
const [state] = useConfiguratorState(isConfiguring);
499500
return (
500501
<Badge
501502
invisible={ctx.isOpen}
502503
badgeContent={Object.values(state.chartConfig.filters).length}
503504
color="secondary"
504-
sx={{ display: "block", mr: 4 }}
505+
sx={{ display: "block", ...sx }}
505506
/>
506507
);
507508
};
@@ -576,19 +577,15 @@ export const ChartConfigurator = ({
576577
{filterDimensions.length === 0 &&
577578
addableDimensions.length === 0 ? null : (
578579
<ControlSection className={classes.filterSection} collapse>
579-
<SectionTitle
580-
titleId="controls-data"
581-
gutterBottom={false}
582-
sx={{ justifyContent: "space-between" }}
583-
>
580+
<SectionTitle titleId="controls-data" gutterBottom={false}>
584581
<Trans id="controls.section.data.filters">Filters</Trans>{" "}
585582
{fetching ? (
586583
<CircularProgress
587584
size={12}
588585
className={classes.loadingIndicator}
589586
/>
590587
) : null}
591-
<FiltersBadge />
588+
<FiltersBadge sx={{ ml: "auto", mr: 4 }} />
592589
</SectionTitle>
593590

594591
<ControlSectionContent

0 commit comments

Comments
 (0)