mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: toggle strategies ui adjustments (#2030)
* fix: toggle strategies ui adjustments * fix dark theme type ts issue
This commit is contained in:
parent
5f3af07e43
commit
c64f9a0e20
@ -110,6 +110,9 @@ export const FeatureStrategyEmpty = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const canCopyFromOtherEnvironment =
|
||||||
|
otherAvailableEnvironments && otherAvailableEnvironments.length > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
@ -136,12 +139,10 @@ export const FeatureStrategyEmpty = ({
|
|||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
environmentId={environmentId}
|
environmentId={environmentId}
|
||||||
|
matchWidth={canCopyFromOtherEnvironment}
|
||||||
/>
|
/>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={
|
condition={canCopyFromOtherEnvironment}
|
||||||
otherAvailableEnvironments &&
|
|
||||||
otherAvailableEnvironments.length > 0
|
|
||||||
}
|
|
||||||
show={
|
show={
|
||||||
<CopyButton
|
<CopyButton
|
||||||
environmentId={environmentId}
|
environmentId={environmentId}
|
||||||
|
@ -12,6 +12,7 @@ interface IFeatureStrategyMenuProps {
|
|||||||
featureId: string;
|
featureId: string;
|
||||||
environmentId: string;
|
environmentId: string;
|
||||||
variant?: IPermissionButtonProps['variant'];
|
variant?: IPermissionButtonProps['variant'];
|
||||||
|
matchWidth?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FeatureStrategyMenu = ({
|
export const FeatureStrategyMenu = ({
|
||||||
@ -20,6 +21,7 @@ export const FeatureStrategyMenu = ({
|
|||||||
featureId,
|
featureId,
|
||||||
environmentId,
|
environmentId,
|
||||||
variant,
|
variant,
|
||||||
|
matchWidth,
|
||||||
}: IFeatureStrategyMenuProps) => {
|
}: IFeatureStrategyMenuProps) => {
|
||||||
const [anchor, setAnchor] = useState<Element>();
|
const [anchor, setAnchor] = useState<Element>();
|
||||||
const isPopoverOpen = Boolean(anchor);
|
const isPopoverOpen = Boolean(anchor);
|
||||||
@ -42,6 +44,7 @@ export const FeatureStrategyMenu = ({
|
|||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
aria-labelledby={popoverId}
|
aria-labelledby={popoverId}
|
||||||
variant={variant}
|
variant={variant}
|
||||||
|
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
</PermissionButton>
|
</PermissionButton>
|
||||||
|
@ -3,7 +3,7 @@ import { makeStyles } from 'tss-react/mui';
|
|||||||
export const useStyles = makeStyles()(theme => ({
|
export const useStyles = makeStyles()(theme => ({
|
||||||
item: {
|
item: {
|
||||||
padding: theme.spacing(2),
|
padding: theme.spacing(2),
|
||||||
background: theme.palette.featureMetricsBackground,
|
background: 'transparent',
|
||||||
borderRadius: theme.spacing(2),
|
borderRadius: theme.spacing(2),
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
[theme.breakpoints.up('md')]: {
|
[theme.breakpoints.up('md')]: {
|
||||||
|
@ -4,7 +4,6 @@ export const useStyles = makeStyles()(theme => ({
|
|||||||
featureOverviewEnvironment: {
|
featureOverviewEnvironment: {
|
||||||
borderRadius: theme.shape.borderRadiusLarge,
|
borderRadius: theme.shape.borderRadiusLarge,
|
||||||
marginBottom: theme.spacing(2),
|
marginBottom: theme.spacing(2),
|
||||||
padding: '0.2rem',
|
|
||||||
backgroundColor: theme.palette.background.paper,
|
backgroundColor: theme.palette.background.paper,
|
||||||
},
|
},
|
||||||
accordion: {
|
accordion: {
|
||||||
|
@ -139,7 +139,6 @@ export default createTheme({
|
|||||||
formSidebarTextColor: themeColors.textColor,
|
formSidebarTextColor: themeColors.textColor,
|
||||||
checkmarkBadge: themeColors.secondary,
|
checkmarkBadge: themeColors.secondary,
|
||||||
inputLabelBackground: 'transparent',
|
inputLabelBackground: 'transparent',
|
||||||
featureMetricsBackground: themeColors.secondary,
|
|
||||||
grey: colors.grey,
|
grey: colors.grey,
|
||||||
text: {
|
text: {
|
||||||
primary: themeColors.textColor,
|
primary: themeColors.textColor,
|
||||||
|
@ -138,7 +138,6 @@ export default createTheme({
|
|||||||
},
|
},
|
||||||
checkmarkBadge: colors.purple[800],
|
checkmarkBadge: colors.purple[800],
|
||||||
inputLabelBackground: colors.white,
|
inputLabelBackground: colors.white,
|
||||||
featureMetricsBackground: colors.grey[100],
|
|
||||||
featureStrategySegmentChipBackground: colors.purple[800],
|
featureStrategySegmentChipBackground: colors.purple[800],
|
||||||
featureSegmentSearchBackground: colors.purple[800],
|
featureSegmentSearchBackground: colors.purple[800],
|
||||||
dialogHeaderBackground: colors.purple[800],
|
dialogHeaderBackground: colors.purple[800],
|
||||||
|
@ -66,7 +66,6 @@ declare module '@mui/material/styles' {
|
|||||||
from: string;
|
from: string;
|
||||||
to: string;
|
to: string;
|
||||||
};
|
};
|
||||||
featureMetricsBackground: string;
|
|
||||||
constraintAccordion: {
|
constraintAccordion: {
|
||||||
editBackground: string;
|
editBackground: string;
|
||||||
background: string;
|
background: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user