fix: blocked and blocking in issue details sidebar (#641)

This commit is contained in:
Aaryan Khandelwal 2023-03-31 03:50:35 +05:30 committed by GitHub
parent 15ce3537ad
commit a8f125cfa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 14 deletions

View File

@ -113,17 +113,9 @@ export const SidebarBlockedSelect: React.FC<Props> = ({
<div className="flex flex-wrap gap-1">
{watch("blocked_list") && watch("blocked_list").length > 0
? watch("blocked_list").map((issue) => (
<span
<div
key={issue}
className="group flex cursor-pointer items-center gap-1 rounded-2xl border border-white px-1.5 py-0.5 text-xs text-red-500 duration-300 hover:border-red-500 hover:bg-red-50"
onClick={() => {
const updatedBlocked: string[] = watch("blocked_list").filter(
(i) => i !== issue
);
submitChanges({
blocks_list: updatedBlocked,
});
}}
>
<Link
href={`/${workspaceSlug}/projects/${projectId}/issues/${
@ -137,10 +129,21 @@ export const SidebarBlockedSelect: React.FC<Props> = ({
}`}
</a>
</Link>
<span className="opacity-0 duration-300 group-hover:opacity-100">
<button
type="button"
className="opacity-0 duration-300 group-hover:opacity-100"
onClick={() => {
const updatedBlocked: string[] = watch("blocked_list").filter(
(i) => i !== issue
);
submitChanges({
blocks_list: updatedBlocked,
});
}}
>
<XMarkIcon className="h-2 w-2" />
</span>
</span>
</button>
</div>
))
: null}
</div>

View File

@ -129,7 +129,8 @@ export const SidebarBlockerSelect: React.FC<Props> = ({
}`}
</a>
</Link>
<span
<button
type="button"
className="opacity-0 duration-300 group-hover:opacity-100"
onClick={() => {
const updatedBlockers: string[] = watch("blockers_list").filter(
@ -141,7 +142,7 @@ export const SidebarBlockerSelect: React.FC<Props> = ({
}}
>
<XMarkIcon className="h-2 w-2" />
</span>
</button>
</div>
))
: null}