forked from github/plane
chore: cannot have empty state group
This commit is contained in:
parent
3c6752807d
commit
522952fa59
@ -181,20 +181,29 @@ export const SingleState: React.FC<Props> = ({
|
||||
</button>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className={`${state.default ? "cursor-not-allowed" : ""} grid place-items-center`}
|
||||
onClick={handleDeleteState}
|
||||
disabled={state.default}
|
||||
>
|
||||
<Tooltip tooltipContent="Cannot delete the default state." disabled={!state.default}>
|
||||
<TrashIcon className="h-4 w-4 text-red-400" />
|
||||
</Tooltip>
|
||||
</button>
|
||||
|
||||
<button type="button" className="grid place-items-center" onClick={handleEditState}>
|
||||
<PencilSquareIcon className="h-4 w-4 text-gray-400" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`${
|
||||
state.default || groupLength === 1 ? "cursor-not-allowed" : ""
|
||||
} grid place-items-center`}
|
||||
onClick={handleDeleteState}
|
||||
disabled={state.default || groupLength === 1}
|
||||
>
|
||||
{state.default ? (
|
||||
<Tooltip tooltipContent="Cannot delete the default state.">
|
||||
<TrashIcon className="h-4 w-4 text-red-400" />
|
||||
</Tooltip>
|
||||
) : groupLength === 1 ? (
|
||||
<Tooltip tooltipContent="Cannot have an empty group.">
|
||||
<TrashIcon className="h-4 w-4 text-red-400" />
|
||||
</Tooltip>
|
||||
) : (
|
||||
<TrashIcon className="h-4 w-4 text-red-400" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -38,7 +38,7 @@ export const Tooltip: React.FC<Props> = ({
|
||||
disabled={disabled}
|
||||
content={
|
||||
<div
|
||||
className={`flex flex-col justify-center items-start gap-1 max-w-[600px] text-xs rounded-md bg-white p-2 shadow-md capitalize text-left ${className}`}
|
||||
className={`flex flex-col justify-center items-start gap-1 max-w-[600px] text-xs rounded-md bg-white p-2 shadow-md text-left ${className}`}
|
||||
>
|
||||
{tooltipHeading ? (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user