From a8184c366acd8dda2cb2dd9055a84a3d53164cb4 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 31 May 2024 15:14:13 +0530 Subject: [PATCH] chore: priority dropdown accepts undefined (#4666) --- web/components/dropdowns/priority.tsx | 165 ++++++++++++++------------ 1 file changed, 90 insertions(+), 75 deletions(-) diff --git a/web/components/dropdowns/priority.tsx b/web/components/dropdowns/priority.tsx index 1bf0bc933..382911b08 100644 --- a/web/components/dropdowns/priority.tsx +++ b/web/components/dropdowns/priority.tsx @@ -1,7 +1,7 @@ import { Fragment, ReactNode, useRef, useState } from "react"; import { useTheme } from "next-themes"; import { usePopper } from "react-popper"; -import { Check, ChevronDown, Search } from "lucide-react"; +import { Check, ChevronDown, Search, SignalHigh } from "lucide-react"; import { Combobox } from "@headlessui/react"; // types import { TIssuePriorities } from "@plane/types"; @@ -26,7 +26,7 @@ type Props = TDropdownProps & { highlightUrgent?: boolean; onChange: (val: TIssuePriorities) => void; onClose?: () => void; - value: TIssuePriorities; + value: TIssuePriorities | undefined; }; type ButtonProps = { @@ -37,7 +37,8 @@ type ButtonProps = { hideText?: boolean; isActive?: boolean; highlightUrgent: boolean; - priority: TIssuePriorities; + placeholder: string; + priority: TIssuePriorities | undefined; showTooltip: boolean; }; @@ -49,6 +50,7 @@ const BorderButton = (props: ButtonProps) => { hideIcon = false, hideText = false, highlightUrgent, + placeholder, priority, showTooltip, } = props; @@ -75,7 +77,7 @@ const BorderButton = (props: ButtonProps) => { + ) : ( + + ))} + {!hideText && {priorityDetails?.title ?? placeholder}} {dropdownArrow && (