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,
|
||||
styled,
|
||||
Switch,
|
||||
Tooltip,
|
||||
} from '@mui/material';
|
||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
import { IPayload } from 'interfaces/featureToggle';
|
||||
@ -30,7 +31,7 @@ const StyledVariantForm = styled('div')(({ theme }) => ({
|
||||
borderRadius: theme.shape.borderRadiusLarge,
|
||||
}));
|
||||
|
||||
const StyledDeleteButton = styled(IconButton)(({ theme }) => ({
|
||||
const StyledDeleteButtonTooltip = styled(Tooltip)(({ theme }) => ({
|
||||
position: 'absolute',
|
||||
top: theme.spacing(2),
|
||||
right: theme.spacing(2),
|
||||
@ -293,12 +294,23 @@ export const VariantForm = ({
|
||||
|
||||
return (
|
||||
<StyledVariantForm>
|
||||
<StyledDeleteButton
|
||||
onClick={() => removeVariant(variant.id)}
|
||||
disabled={isProtectedVariant(variant)}
|
||||
<StyledDeleteButtonTooltip
|
||||
arrow
|
||||
title={
|
||||
isProtectedVariant(variant)
|
||||
? 'You need to have at least one variable variant'
|
||||
: 'Delete variant'
|
||||
}
|
||||
>
|
||||
<Delete />
|
||||
</StyledDeleteButton>
|
||||
<div>
|
||||
<IconButton
|
||||
onClick={() => removeVariant(variant.id)}
|
||||
disabled={isProtectedVariant(variant)}
|
||||
>
|
||||
<Delete />
|
||||
</IconButton>
|
||||
</div>
|
||||
</StyledDeleteButtonTooltip>
|
||||
<StyledTopRow>
|
||||
<StyledNameContainer>
|
||||
<StyledLabel>Variant name</StyledLabel>
|
||||
|
Loading…
Reference in New Issue
Block a user