diff --git a/frontend/src/component/common/HelpIcon/HelpIcon.tsx b/frontend/src/component/common/HelpIcon/HelpIcon.tsx index 502be077c5..09b12df9e8 100644 --- a/frontend/src/component/common/HelpIcon/HelpIcon.tsx +++ b/frontend/src/component/common/HelpIcon/HelpIcon.tsx @@ -1,24 +1,19 @@ -import { Tooltip } from '@mui/material'; +import { Tooltip, TooltipProps } from '@mui/material'; import { Info } from '@mui/icons-material'; import { useStyles } from 'component/common/HelpIcon/HelpIcon.styles'; import React from 'react'; interface IHelpIconProps { tooltip: string; - style?: React.CSSProperties; + placement?: TooltipProps['placement']; } -export const HelpIcon = ({ tooltip, style }: IHelpIconProps) => { +export const HelpIcon = ({ tooltip, placement }: IHelpIconProps) => { const { classes: styles } = useStyles(); return ( - - + + diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts deleted file mode 100644 index ec380403ff..0000000000 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { makeStyles } from 'tss-react/mui'; - -export const useStyles = makeStyles()(theme => ({ - container: { - borderRadius: theme.shape.borderRadiusLarge, - backgroundColor: '#fff', - display: 'flex', - flexDirection: 'column', - padding: '1.5rem', - maxWidth: '350px', - minWidth: '350px', - marginRight: '1rem', - marginTop: '1rem', - [theme.breakpoints.down(1000)]: { - marginBottom: '1rem', - width: '100%', - maxWidth: 'none', - minWidth: 'auto', - }, - }, - header: { - fontSize: theme.fontSizes.bodySize, - fontWeight: 'normal', - margin: 0, - marginBottom: '0.5rem', - }, -})); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx index f2aca60a51..7118c48757 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx @@ -1,14 +1,47 @@ -import { Tooltip } from '@mui/material'; import { useState } from 'react'; import useFeatureApi from 'hooks/api/actions/useFeatureApi/useFeatureApi'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import EnvironmentStrategyDialog from 'component/common/EnvironmentStrategiesDialog/EnvironmentStrategyDialog'; import FeatureOverviewEnvSwitch from './FeatureOverviewEnvSwitch/FeatureOverviewEnvSwitch'; -import { useStyles } from './FeatureOverviewEnvSwitches.styles'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; +import { HelpIcon } from 'component/common/HelpIcon/HelpIcon'; +import { styled } from '@mui/material'; + +const StyledContainer = styled('div')(({ theme }) => ({ + borderRadius: theme.shape.borderRadiusLarge, + backgroundColor: '#fff', + display: 'flex', + flexDirection: 'column', + padding: '1.5rem', + maxWidth: '350px', + minWidth: '350px', + marginRight: '1rem', + marginTop: '1rem', + [theme.breakpoints.down(1000)]: { + marginBottom: '1rem', + width: '100%', + maxWidth: 'none', + minWidth: 'auto', + }, +})); + +const StyledHeader = styled('h3')(({ theme }) => ({ + display: 'flex', + gap: theme.spacing(1), + alignItems: 'center', + fontSize: theme.fontSizes.bodySize, + fontWeight: 'normal', + margin: 0, + marginBottom: '0.5rem', + + // Make the help icon align with the text. + '& > :last-child': { + position: 'relative', + top: 1, + }, +})); const FeatureOverviewEnvSwitches = () => { - const { classes: styles } = useStyles(); const projectId = useRequiredPathParam('projectId'); const featureId = useRequiredPathParam('featureId'); const { feature } = useFeature(projectId, featureId); @@ -37,15 +70,14 @@ const FeatureOverviewEnvSwitches = () => { }; return ( -
- -

- Feature toggle status -

-
+ + + Feature toggle status + + {renderEnvironmentSwitches()} { featureId={featureId} environmentName={environmentName} /> -
+ ); };