mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
bug fix
This commit is contained in:
parent
5feee0d2d8
commit
47c33e62e1
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ConditionallyRender } from '../../ConditionallyRender/ConditionallyRender';
|
|
||||||
import { IconButton, Tooltip } from '@mui/material';
|
import { IconButton, Tooltip } from '@mui/material';
|
||||||
import { Delete, Edit } from '@mui/icons-material';
|
import { Delete, Edit } from '@mui/icons-material';
|
||||||
import { useStyles } from '../ConstraintAccordion.styles';
|
import { useStyles } from '../ConstraintAccordion.styles';
|
||||||
@ -7,13 +6,11 @@ import { useStyles } from '../ConstraintAccordion.styles';
|
|||||||
interface ConstraintAccordionHeaderActionsProps {
|
interface ConstraintAccordionHeaderActionsProps {
|
||||||
onDelete?: () => void;
|
onDelete?: () => void;
|
||||||
onEdit?: () => void;
|
onEdit?: () => void;
|
||||||
disableEdit?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConstraintAccordionHeaderActions = ({
|
export const ConstraintAccordionHeaderActions = ({
|
||||||
onEdit,
|
onEdit,
|
||||||
onDelete,
|
onDelete,
|
||||||
disableEdit = false,
|
|
||||||
}: ConstraintAccordionHeaderActionsProps) => {
|
}: ConstraintAccordionHeaderActionsProps) => {
|
||||||
const { classes: styles } = useStyles();
|
const { classes: styles } = useStyles();
|
||||||
const onEditClick =
|
const onEditClick =
|
||||||
@ -32,34 +29,24 @@ export const ConstraintAccordionHeaderActions = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.headerActions}>
|
<div className={styles.headerActions}>
|
||||||
<ConditionallyRender
|
<Tooltip title="Edit constraint" arrow>
|
||||||
condition={Boolean(onEditClick) && !disableEdit}
|
<IconButton
|
||||||
show={() => (
|
type="button"
|
||||||
<Tooltip title="Edit constraint" arrow>
|
onClick={onEditClick}
|
||||||
<IconButton
|
disabled={!Boolean(onEditClick)}
|
||||||
type="button"
|
>
|
||||||
onClick={onEditClick}
|
<Edit />
|
||||||
disabled={!onEdit}
|
</IconButton>
|
||||||
>
|
</Tooltip>
|
||||||
<Edit />
|
<Tooltip title="Delete constraint" arrow>
|
||||||
</IconButton>
|
<IconButton
|
||||||
</Tooltip>
|
type="button"
|
||||||
)}
|
onClick={onDeleteClick}
|
||||||
/>
|
disabled={!Boolean(onDeleteClick)}
|
||||||
<ConditionallyRender
|
>
|
||||||
condition={Boolean(onDeleteClick)}
|
<Delete />
|
||||||
show={() => (
|
</IconButton>
|
||||||
<Tooltip title="Delete constraint" arrow>
|
</Tooltip>
|
||||||
<IconButton
|
|
||||||
type="button"
|
|
||||||
onClick={onDeleteClick}
|
|
||||||
disabled={!onDelete}
|
|
||||||
>
|
|
||||||
<Delete />
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user