chore: show message if dragging unjoined project (#1763)

This commit is contained in:
Aaryan Khandelwal 2023-08-02 12:09:53 +05:30 committed by GitHub
parent 78095e3823
commit 7434800999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,21 +137,30 @@ export const SingleSidebarProject: React.FC<Props> = ({
{({ open }) => ( {({ open }) => (
<> <>
<div <div
className={`group relative text-custom-sidebar-text-10 px-2 py-1 ml-1.5 w-full flex items-center hover:bg-custom-sidebar-background-80 rounded-md ${ className={`group relative text-custom-sidebar-text-10 px-2 py-1 w-full flex items-center hover:bg-custom-sidebar-background-80 rounded-md ${
snapshot?.isDragging ? "opacity-60" : "" snapshot?.isDragging ? "opacity-60" : ""
}`} }`}
> >
{provided && ( {provided && (
<button <Tooltip
type="button" tooltipContent={
className={`absolute top-1/2 -translate-y-1/2 -left-4 hidden rounded p-0.5 ${ project.sort_order === null
sidebarCollapse ? "" : "group-hover:!flex" ? "Join the project to rearrange"
}`} : "Drag to rearrange"
{...provided?.dragHandleProps} }
position="top-right"
> >
<EllipsisVerticalIcon className="h-4" /> <button
<EllipsisVerticalIcon className="-ml-5 h-4" /> type="button"
</button> className={`absolute top-1/2 -translate-y-1/2 -left-4 hidden rounded p-0.5 ${
sidebarCollapse ? "" : "group-hover:!flex"
} ${project.sort_order === null ? "opacity-60 cursor-not-allowed" : ""}`}
{...provided?.dragHandleProps}
>
<EllipsisVerticalIcon className="h-4" />
<EllipsisVerticalIcon className="-ml-5 h-4" />
</button>
</Tooltip>
)} )}
<Tooltip <Tooltip
tooltipContent={`${project.name}`} tooltipContent={`${project.name}`}