mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
bug fix
This commit is contained in:
parent
9a13c5c489
commit
70e8df83b5
@ -147,7 +147,7 @@ export const ConstraintAccordionEditHeader = ({
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
<ConstraintAccordionHeaderActions onDelete={onDelete} />
|
||||
<ConstraintAccordionHeaderActions onDelete={onDelete} disableEdit/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -2,15 +2,20 @@ import React from 'react';
|
||||
import { IconButton, Tooltip } from '@mui/material';
|
||||
import { Delete, Edit } from '@mui/icons-material';
|
||||
import { useStyles } from '../ConstraintAccordion.styles';
|
||||
import {ConditionallyRender} from "../../ConditionallyRender/ConditionallyRender";
|
||||
|
||||
interface ConstraintAccordionHeaderActionsProps {
|
||||
onDelete?: () => void;
|
||||
onEdit?: () => void;
|
||||
disableEdit?: boolean;
|
||||
disableDelete?: boolean
|
||||
}
|
||||
|
||||
export const ConstraintAccordionHeaderActions = ({
|
||||
onEdit,
|
||||
onDelete,
|
||||
disableDelete = false,
|
||||
disableEdit = false
|
||||
}: ConstraintAccordionHeaderActionsProps) => {
|
||||
const { classes: styles } = useStyles();
|
||||
const onEditClick =
|
||||
@ -29,24 +34,26 @@ export const ConstraintAccordionHeaderActions = ({
|
||||
|
||||
return (
|
||||
<div className={styles.headerActions}>
|
||||
<ConditionallyRender condition={Boolean(onEditClick) && !disableEdit} show={
|
||||
<Tooltip title="Edit constraint" arrow>
|
||||
<IconButton
|
||||
type="button"
|
||||
onClick={onEditClick}
|
||||
disabled={!Boolean(onEditClick)}
|
||||
disabled={disableEdit}
|
||||
>
|
||||
<Edit />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</Tooltip>} />
|
||||
<ConditionallyRender condition={Boolean(onDeleteClick) && !disableDelete} show={
|
||||
<Tooltip title="Delete constraint" arrow>
|
||||
<IconButton
|
||||
type="button"
|
||||
onClick={onDeleteClick}
|
||||
disabled={!Boolean(onDeleteClick)}
|
||||
disabled={disableDelete}
|
||||
>
|
||||
<Delete />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</Tooltip>} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user