Skip to content

Commit 795c673

Browse files
authored
fix: features sidebar scroll (#5524)
Feature toggle overview screen - the sidebar getting sticky was making it hard to see many environments
1 parent 20ebe8f commit 795c673

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanel.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Divider, styled } from '@mui/material';
1+
import { Box, Divider, styled } from '@mui/material';
22
import { HelpIcon } from 'component/common/HelpIcon/HelpIcon';
33
import { useFeature } from 'hooks/api/getters/useFeature/useFeature';
44
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
@@ -7,7 +7,7 @@ import { FeatureOverviewSidePanelEnvironmentSwitches } from './FeatureOverviewSi
77
import { FeatureOverviewSidePanelTags } from './FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags';
88
import { Sticky } from 'component/common/Sticky/Sticky';
99

10-
const StyledContainer = styled(Sticky)(({ theme }) => ({
10+
const StyledContainer = styled(Box)(({ theme }) => ({
1111
top: theme.spacing(2),
1212
borderRadius: theme.shape.borderRadiusLarge,
1313
backgroundColor: theme.palette.background.paper,
@@ -52,9 +52,10 @@ export const FeatureOverviewSidePanel = ({
5252
const projectId = useRequiredPathParam('projectId');
5353
const featureId = useRequiredPathParam('featureId');
5454
const { feature } = useFeature(projectId, featureId);
55+
const isSticky = feature.environments?.length <= 3;
5556

5657
return (
57-
<StyledContainer>
58+
<StyledContainer as={isSticky ? Sticky : Box}>
5859
<FeatureOverviewSidePanelEnvironmentSwitches
5960
header={
6061
<StyledHeader data-loading>

0 commit comments

Comments
 (0)