Skip to content

Commit 374fa09

Browse files
committed
fix: Shared filter layout configurator collapses correctly
Wrap shared filter content inside ControlSectionContent for it to collapse correctly
1 parent fb4614e commit 374fa09

1 file changed

Lines changed: 51 additions & 49 deletions

File tree

app/configurator/components/layout-configurator.tsx

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -200,57 +200,59 @@ const LayoutSharedFiltersConfigurator = () => {
200200
>
201201
<Trans id="controls.section.shared-filters">Shared filters</Trans>
202202
</SubsectionTitle>
203-
<Stack gap="0.5rem" px="1rem">
204-
{potentialSharedFilters.map((filter) => {
205-
const dimension = dimensionsByIri[filter.componentIri];
206-
const sharedFilter = sharedFiltersByIri[filter.componentIri];
203+
<ControlSectionContent>
204+
<Stack gap="0.5rem">
205+
{potentialSharedFilters.map((filter) => {
206+
const dimension = dimensionsByIri[filter.componentIri];
207+
const sharedFilter = sharedFiltersByIri[filter.componentIri];
207208

208-
if (!dimension || !isTemporalDimension(dimension)) {
209-
return null;
210-
}
211-
return (
212-
<>
213-
<Box
214-
display="flex"
215-
alignItems="center"
216-
justifyContent="space-between"
217-
width="100%"
218-
key={filter.componentIri}
219-
>
220-
<Typography variant="body2" flexGrow={1}>
221-
{dimension.label || filter.componentIri}
222-
</Typography>
223-
<FormControlLabel
224-
sx={{ mr: 0 }}
225-
labelPlacement="start"
226-
disableTypography
227-
label={
228-
<Typography variant="body2">
229-
<Trans id="controls.section.shared-filters.shared-switch">
230-
Shared
231-
</Trans>
232-
</Typography>
233-
}
234-
control={
235-
<Switch
236-
checked={!!sharedFilter}
237-
onChange={handleToggle}
238-
inputProps={{
239-
// @ts-expect-error ts(2322) - data-component-iri is not considered a valid attribute, while it is
240-
"data-component-iri": filter.componentIri,
241-
}}
242-
/>
243-
}
209+
if (!dimension || !isTemporalDimension(dimension)) {
210+
return null;
211+
}
212+
return (
213+
<>
214+
<Box
215+
display="flex"
216+
alignItems="center"
217+
justifyContent="space-between"
218+
width="100%"
219+
key={filter.componentIri}
220+
>
221+
<Typography variant="body2" flexGrow={1}>
222+
{dimension.label || filter.componentIri}
223+
</Typography>
224+
<FormControlLabel
225+
sx={{ mr: 0 }}
226+
labelPlacement="start"
227+
disableTypography
228+
label={
229+
<Typography variant="body2">
230+
<Trans id="controls.section.shared-filters.shared-switch">
231+
Shared
232+
</Trans>
233+
</Typography>
234+
}
235+
control={
236+
<Switch
237+
checked={!!sharedFilter}
238+
onChange={handleToggle}
239+
inputProps={{
240+
// @ts-expect-error ts(2322) - data-component-iri is not considered a valid attribute, while it is
241+
"data-component-iri": filter.componentIri,
242+
}}
243+
/>
244+
}
245+
/>
246+
</Box>
247+
<SharedFilterOptions
248+
sharedFilter={sharedFilter}
249+
dimension={dimension}
244250
/>
245-
</Box>
246-
<SharedFilterOptions
247-
sharedFilter={sharedFilter}
248-
dimension={dimension}
249-
/>
250-
</>
251-
);
252-
})}
253-
</Stack>
251+
</>
252+
);
253+
})}
254+
</Stack>
255+
</ControlSectionContent>
254256
</ControlSection>
255257
);
256258
default:

0 commit comments

Comments
 (0)