From 795c67306c498b5dfa3fc7b0d43096fb35e6b19a Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Tue, 5 Dec 2023 09:08:02 +0100 Subject: [PATCH] fix: features sidebar scroll (#5524) Feature toggle overview screen - the sidebar getting sticky was making it hard to see many environments --- .../FeatureOverviewSidePanel/FeatureOverviewSidePanel.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanel.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanel.tsx index 2b25870181..af21726f54 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanel.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanel.tsx @@ -1,4 +1,4 @@ -import { Divider, styled } from '@mui/material'; +import { Box, Divider, styled } from '@mui/material'; import { HelpIcon } from 'component/common/HelpIcon/HelpIcon'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; @@ -7,7 +7,7 @@ import { FeatureOverviewSidePanelEnvironmentSwitches } from './FeatureOverviewSi import { FeatureOverviewSidePanelTags } from './FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags'; import { Sticky } from 'component/common/Sticky/Sticky'; -const StyledContainer = styled(Sticky)(({ theme }) => ({ +const StyledContainer = styled(Box)(({ theme }) => ({ top: theme.spacing(2), borderRadius: theme.shape.borderRadiusLarge, backgroundColor: theme.palette.background.paper, @@ -52,9 +52,10 @@ export const FeatureOverviewSidePanel = ({ const projectId = useRequiredPathParam('projectId'); const featureId = useRequiredPathParam('featureId'); const { feature } = useFeature(projectId, featureId); + const isSticky = feature.environments?.length <= 3; return ( - +