mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: delete variant button tooltip (#3014)
Small fix on the tooltip for the "delete variant" button in the new environment variants form. ![image](https://user-images.githubusercontent.com/14320932/215116642-0e78a2a7-71d6-4fa1-9138-6133d71ef091.png)
This commit is contained in:
parent
897e97330a
commit
f8e34564aa
@ -10,6 +10,7 @@ import {
|
|||||||
InputAdornment,
|
InputAdornment,
|
||||||
styled,
|
styled,
|
||||||
Switch,
|
Switch,
|
||||||
|
Tooltip,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { IPayload } from 'interfaces/featureToggle';
|
import { IPayload } from 'interfaces/featureToggle';
|
||||||
@ -30,7 +31,7 @@ const StyledVariantForm = styled('div')(({ theme }) => ({
|
|||||||
borderRadius: theme.shape.borderRadiusLarge,
|
borderRadius: theme.shape.borderRadiusLarge,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledDeleteButton = styled(IconButton)(({ theme }) => ({
|
const StyledDeleteButtonTooltip = styled(Tooltip)(({ theme }) => ({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: theme.spacing(2),
|
top: theme.spacing(2),
|
||||||
right: theme.spacing(2),
|
right: theme.spacing(2),
|
||||||
@ -293,12 +294,23 @@ export const VariantForm = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledVariantForm>
|
<StyledVariantForm>
|
||||||
<StyledDeleteButton
|
<StyledDeleteButtonTooltip
|
||||||
onClick={() => removeVariant(variant.id)}
|
arrow
|
||||||
disabled={isProtectedVariant(variant)}
|
title={
|
||||||
|
isProtectedVariant(variant)
|
||||||
|
? 'You need to have at least one variable variant'
|
||||||
|
: 'Delete variant'
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Delete />
|
<div>
|
||||||
</StyledDeleteButton>
|
<IconButton
|
||||||
|
onClick={() => removeVariant(variant.id)}
|
||||||
|
disabled={isProtectedVariant(variant)}
|
||||||
|
>
|
||||||
|
<Delete />
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
|
</StyledDeleteButtonTooltip>
|
||||||
<StyledTopRow>
|
<StyledTopRow>
|
||||||
<StyledNameContainer>
|
<StyledNameContainer>
|
||||||
<StyledLabel>Variant name</StyledLabel>
|
<StyledLabel>Variant name</StyledLabel>
|
||||||
|
Loading…
Reference in New Issue
Block a user