Skip to content

Commit

Permalink
fix: issue parent select (#3267)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia authored Dec 29, 2023
1 parent 62b9b25 commit 1d5a3a0
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions web/components/issues/sidebar-select/parent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,34 @@ export const SidebarParentSelect: React.FC<Props> = ({ onChange, issueDetails, p
issueId={issueId as string}
projectId={projectId as string}
/>

<button
type="button"
className={`flex items-center gap-2 rounded bg-custom-background-80 px-2.5 py-0.5 text-xs max-w-max" ${
<div
className={`flex items-center gap-2 rounded bg-custom-background-80 px-2.5 py-0.5 text-xs w-max max-w-max" ${
disabled ? "cursor-not-allowed" : "cursor-pointer "
}`}
onClick={() => {
if (issueDetails?.parent) {
onChange("");
setSelectedParentIssue(null);
} else {
setIsParentModalOpen(true);
}
}}
disabled={disabled}
>
{selectedParentIssue && issueDetails?.parent ? (
`${selectedParentIssue.project__identifier}-${selectedParentIssue.sequence_id}`
) : !selectedParentIssue && issueDetails?.parent ? (
`${issueDetails.parent_detail?.project_detail.identifier}-${issueDetails.parent_detail?.sequence_id}`
) : (
<span className="text-custom-text-200">Select issue</span>
<button type="button" className="flex-shrink-0" onClick={() => setIsParentModalOpen(true)} disabled={disabled}>
{selectedParentIssue && issueDetails?.parent ? (
`${selectedParentIssue.project__identifier}-${selectedParentIssue.sequence_id}`
) : !selectedParentIssue && issueDetails?.parent ? (
`${issueDetails.parent_detail?.project_detail.identifier}-${issueDetails.parent_detail?.sequence_id}`
) : (
<span className="text-custom-text-200">Select issue</span>
)}
</button>

{issueDetails?.parent && (
<button
type="button"
className="flex-shrink-0"
onClick={() => {
onChange("");
setSelectedParentIssue(null);
}}
>
<X className="h-2.5 w-2.5" />
</button>
)}
{issueDetails?.parent && <X className="h-2.5 w-2.5" />}
</button>
</div>
</>
);
};

0 comments on commit 1d5a3a0

Please sign in to comment.