chore: added optional tooltip to dropdowns (#3462)

This commit is contained in:
Aaryan Khandelwal 2024-01-25 13:29:56 +05:30 committed by GitHub
parent 7fd625e0e3
commit eae32593cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 673 additions and 420 deletions

View File

@ -128,7 +128,7 @@ export const IssuesByPriorityWidget: React.FC<WidgetProps> = observer((props) =>
}; };
return ( return (
<div className="bg-custom-background-100 rounded-xl border-[0.5px] border-custom-border-200 w-full py-6 hover:shadow-custom-shadow-4xl duration-300 overflow-hidden min-h-96"> <div className="bg-custom-background-100 rounded-xl border-[0.5px] border-custom-border-200 w-full py-6 hover:shadow-custom-shadow-4xl duration-300 overflow-hidden min-h-96 flex flex-col">
<div className="flex items-start justify-between gap-2 pl-7 pr-6"> <div className="flex items-start justify-between gap-2 pl-7 pr-6">
<div> <div>
<Link <Link

View File

@ -127,7 +127,7 @@ export const IssuesByStateGroupWidget: React.FC<WidgetProps> = observer((props)
}; };
return ( return (
<div className="bg-custom-background-100 rounded-xl border-[0.5px] border-custom-border-200 w-full py-6 hover:shadow-custom-shadow-4xl duration-300 overflow-hidden min-h-96"> <div className="bg-custom-background-100 rounded-xl border-[0.5px] border-custom-border-200 w-full py-6 hover:shadow-custom-shadow-4xl duration-300 overflow-hidden min-h-96 flex flex-col">
<div className="flex items-start justify-between gap-2 pl-7 pr-6"> <div className="flex items-start justify-between gap-2 pl-7 pr-6">
<div> <div>
<Link <Link

View File

@ -8,7 +8,7 @@ import { useApplication, useCycle } from "hooks/store";
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// icons // icons
import { ContrastIcon } from "@plane/ui"; import { ContrastIcon, Tooltip } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
// types // types
@ -32,6 +32,7 @@ type ButtonProps = {
dropdownArrow: boolean; dropdownArrow: boolean;
dropdownArrowClassName: string; dropdownArrowClassName: string;
placeholder: string; placeholder: string;
tooltip: boolean;
}; };
type DropdownOptions = type DropdownOptions =
@ -51,9 +52,11 @@ const BorderButton = (props: ButtonProps) => {
hideIcon = false, hideIcon = false,
hideText = false, hideText = false,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Cycle" tooltipContent={cycle?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
@ -66,6 +69,7 @@ const BorderButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -78,11 +82,16 @@ const BackgroundButton = (props: ButtonProps) => {
hideIcon = false, hideIcon = false,
hideText = false, hideText = false,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Cycle" tooltipContent={cycle?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
> >
{!hideIcon && <ContrastIcon className="h-3 w-3 flex-shrink-0" />} {!hideIcon && <ContrastIcon className="h-3 w-3 flex-shrink-0" />}
{!hideText && <span className="flex-grow truncate">{cycle?.name ?? placeholder}</span>} {!hideText && <span className="flex-grow truncate">{cycle?.name ?? placeholder}</span>}
@ -90,6 +99,7 @@ const BackgroundButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -102,9 +112,11 @@ const TransparentButton = (props: ButtonProps) => {
hideIcon = false, hideIcon = false,
hideText = false, hideText = false,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Cycle" tooltipContent={cycle?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -117,6 +129,7 @@ const TransparentButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -135,8 +148,9 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
placeholder = "Cycle", placeholder = "Cycle",
placement, placement,
projectId, projectId,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -254,6 +268,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -264,6 +279,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
<BackgroundButton <BackgroundButton
@ -273,6 +289,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -283,6 +300,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
<TransparentButton <TransparentButton
@ -292,6 +310,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -302,6 +321,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : null} ) : null}
</button> </button>

View File

@ -6,6 +6,8 @@ import { CalendarDays, X } from "lucide-react";
// hooks // hooks
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// ui
import { Tooltip } from "@plane/ui";
// helpers // helpers
import { renderFormattedDate } from "helpers/date-time.helper"; import { renderFormattedDate } from "helpers/date-time.helper";
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
@ -33,6 +35,7 @@ type ButtonProps = {
hideText?: boolean; hideText?: boolean;
onClear: () => void; onClear: () => void;
placeholder: string; placeholder: string;
tooltip: boolean;
}; };
const BorderButton = (props: ButtonProps) => { const BorderButton = (props: ButtonProps) => {
@ -46,9 +49,15 @@ const BorderButton = (props: ButtonProps) => {
hideText = false, hideText = false,
onClear, onClear,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip
tooltipHeading={placeholder}
tooltipContent={date ? renderFormattedDate(date) : "None"}
disabled={!tooltip}
>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
@ -67,6 +76,7 @@ const BorderButton = (props: ButtonProps) => {
/> />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -81,11 +91,20 @@ const BackgroundButton = (props: ButtonProps) => {
hideText = false, hideText = false,
onClear, onClear,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip
tooltipHeading={placeholder}
tooltipContent={date ? renderFormattedDate(date) : "None"}
disabled={!tooltip}
>
<div <div
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
> >
{!hideIcon && icon} {!hideIcon && icon}
{!hideText && <span className="flex-grow truncate">{date ? renderFormattedDate(date) : placeholder}</span>} {!hideText && <span className="flex-grow truncate">{date ? renderFormattedDate(date) : placeholder}</span>}
@ -99,6 +118,7 @@ const BackgroundButton = (props: ButtonProps) => {
/> />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -113,9 +133,15 @@ const TransparentButton = (props: ButtonProps) => {
hideText = false, hideText = false,
onClear, onClear,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip
tooltipHeading={placeholder}
tooltipContent={date ? renderFormattedDate(date) : "None"}
disabled={!tooltip}
>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -134,6 +160,7 @@ const TransparentButton = (props: ButtonProps) => {
/> />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -144,6 +171,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
buttonVariant, buttonVariant,
className = "", className = "",
clearIconClassName = "", clearIconClassName = "",
closeOnSelect = true,
disabled = false, disabled = false,
hideIcon = false, hideIcon = false,
icon = <CalendarDays className="h-3 w-3 flex-shrink-0" />, icon = <CalendarDays className="h-3 w-3 flex-shrink-0" />,
@ -153,9 +181,9 @@ export const DateDropdown: React.FC<Props> = (props) => {
onChange, onChange,
placeholder = "Date", placeholder = "Date",
placement, placement,
value,
closeOnSelect = true,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
// refs // refs
@ -218,6 +246,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
placeholder={placeholder} placeholder={placeholder}
isClearable={isClearable && isDateSelected} isClearable={isClearable && isDateSelected}
onClear={() => onChange(null)} onClear={() => onChange(null)}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -229,6 +258,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
placeholder={placeholder} placeholder={placeholder}
isClearable={isClearable && isDateSelected} isClearable={isClearable && isDateSelected}
onClear={() => onChange(null)} onClear={() => onChange(null)}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
@ -241,6 +271,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
placeholder={placeholder} placeholder={placeholder}
isClearable={isClearable && isDateSelected} isClearable={isClearable && isDateSelected}
onClear={() => onChange(null)} onClear={() => onChange(null)}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -252,6 +283,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
placeholder={placeholder} placeholder={placeholder}
isClearable={isClearable && isDateSelected} isClearable={isClearable && isDateSelected}
onClear={() => onChange(null)} onClear={() => onChange(null)}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
@ -264,6 +296,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
placeholder={placeholder} placeholder={placeholder}
isClearable={isClearable && isDateSelected} isClearable={isClearable && isDateSelected}
onClear={() => onChange(null)} onClear={() => onChange(null)}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -275,6 +308,7 @@ export const DateDropdown: React.FC<Props> = (props) => {
placeholder={placeholder} placeholder={placeholder}
isClearable={isClearable && isDateSelected} isClearable={isClearable && isDateSelected}
onClear={() => onChange(null)} onClear={() => onChange(null)}
tooltip={tooltip}
hideText hideText
/> />
) : null} ) : null}

View File

@ -8,6 +8,8 @@ import sortBy from "lodash/sortBy";
import { useApplication, useEstimate } from "hooks/store"; import { useApplication, useEstimate } from "hooks/store";
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// ui
import { Tooltip } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
// types // types
@ -30,6 +32,7 @@ type ButtonProps = {
hideIcon?: boolean; hideIcon?: boolean;
hideText?: boolean; hideText?: boolean;
placeholder: string; placeholder: string;
tooltip: boolean;
}; };
type DropdownOptions = type DropdownOptions =
@ -49,9 +52,15 @@ const BorderButton = (props: ButtonProps) => {
hideIcon = false, hideIcon = false,
hideText = false, hideText = false,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip
tooltipHeading="Estimate"
tooltipContent={estimatePoint !== null ? estimatePoint : placeholder}
disabled={!tooltip}
>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
@ -59,11 +68,14 @@ const BorderButton = (props: ButtonProps) => {
)} )}
> >
{!hideIcon && <Triangle className="h-3 w-3 flex-shrink-0" />} {!hideIcon && <Triangle className="h-3 w-3 flex-shrink-0" />}
{!hideText && <span className="flex-grow truncate">{estimatePoint !== null ? estimatePoint : placeholder}</span>} {!hideText && (
<span className="flex-grow truncate">{estimatePoint !== null ? estimatePoint : placeholder}</span>
)}
{dropdownArrow && ( {dropdownArrow && (
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -76,18 +88,30 @@ const BackgroundButton = (props: ButtonProps) => {
hideIcon = false, hideIcon = false,
hideText = false, hideText = false,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip
tooltipHeading="Estimate"
tooltipContent={estimatePoint !== null ? estimatePoint : placeholder}
disabled={!tooltip}
>
<div <div
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
> >
{!hideIcon && <Triangle className="h-3 w-3 flex-shrink-0" />} {!hideIcon && <Triangle className="h-3 w-3 flex-shrink-0" />}
{!hideText && <span className="flex-grow truncate">{estimatePoint !== null ? estimatePoint : placeholder}</span>} {!hideText && (
<span className="flex-grow truncate">{estimatePoint !== null ? estimatePoint : placeholder}</span>
)}
{dropdownArrow && ( {dropdownArrow && (
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -100,9 +124,15 @@ const TransparentButton = (props: ButtonProps) => {
hideIcon = false, hideIcon = false,
hideText = false, hideText = false,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip
tooltipHeading="Estimate"
tooltipContent={estimatePoint !== null ? estimatePoint : placeholder}
disabled={!tooltip}
>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -110,11 +140,14 @@ const TransparentButton = (props: ButtonProps) => {
)} )}
> >
{!hideIcon && <Triangle className="h-3 w-3 flex-shrink-0" />} {!hideIcon && <Triangle className="h-3 w-3 flex-shrink-0" />}
{!hideText && <span className="flex-grow truncate">{estimatePoint !== null ? estimatePoint : placeholder}</span>} {!hideText && (
<span className="flex-grow truncate">{estimatePoint !== null ? estimatePoint : placeholder}</span>
)}
{dropdownArrow && ( {dropdownArrow && (
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -133,8 +166,9 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
placeholder = "Estimate", placeholder = "Estimate",
placement, placement,
projectId, projectId,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -242,6 +276,7 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -252,6 +287,7 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
<BackgroundButton <BackgroundButton
@ -261,6 +297,7 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -271,6 +308,7 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
<TransparentButton <TransparentButton
@ -280,6 +318,7 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -290,6 +329,7 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : null} ) : null}
</button> </button>

View File

@ -3,7 +3,7 @@ import { ChevronDown } from "lucide-react";
// hooks // hooks
import { useMember } from "hooks/store"; import { useMember } from "hooks/store";
// ui // ui
import { Avatar, AvatarGroup, UserGroupIcon } from "@plane/ui"; import { Avatar, AvatarGroup, Tooltip, UserGroupIcon } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
@ -14,16 +14,17 @@ type ButtonProps = {
placeholder: string; placeholder: string;
hideIcon?: boolean; hideIcon?: boolean;
hideText?: boolean; hideText?: boolean;
tooltip: boolean;
userIds: string | string[] | null; userIds: string | string[] | null;
}; };
const ButtonAvatars = observer(({ userIds }: { userIds: string | string[] | null }) => { const ButtonAvatars = observer(({ tooltip, userIds }: { tooltip: boolean; userIds: string | string[] | null }) => {
const { getUserDetails } = useMember(); const { getUserDetails } = useMember();
if (Array.isArray(userIds)) { if (Array.isArray(userIds)) {
if (userIds.length > 0) if (userIds.length > 0)
return ( return (
<AvatarGroup size="md"> <AvatarGroup size="md" showTooltip={!tooltip}>
{userIds.map((userId) => { {userIds.map((userId) => {
const userDetails = getUserDetails(userId); const userDetails = getUserDetails(userId);
@ -35,7 +36,7 @@ const ButtonAvatars = observer(({ userIds }: { userIds: string | string[] | null
} else { } else {
if (userIds) { if (userIds) {
const userDetails = getUserDetails(userIds); const userDetails = getUserDetails(userIds);
return <Avatar src={userDetails?.avatar} name={userDetails?.display_name} size="md" />; return <Avatar src={userDetails?.avatar} name={userDetails?.display_name} size="md" showTooltip={!tooltip} />;
} }
} }
@ -51,6 +52,7 @@ export const BorderButton = observer((props: ButtonProps) => {
hideText = false, hideText = false,
placeholder, placeholder,
userIds, userIds,
tooltip,
} = props; } = props;
// store hooks // store hooks
const { getUserDetails } = useMember(); const { getUserDetails } = useMember();
@ -58,13 +60,18 @@ export const BorderButton = observer((props: ButtonProps) => {
const isMultiple = Array.isArray(userIds); const isMultiple = Array.isArray(userIds);
return ( return (
<Tooltip
tooltipHeading={placeholder}
tooltipContent={`${userIds?.length ?? 0} assignee${userIds?.length !== 1 ? "s" : ""}`}
disabled={!tooltip}
>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
className className
)} )}
> >
{!hideIcon && <ButtonAvatars userIds={userIds} />} {!hideIcon && <ButtonAvatars tooltip={tooltip} userIds={userIds} />}
{!hideText && ( {!hideText && (
<span className="flex-grow truncate"> <span className="flex-grow truncate">
{userIds ? (isMultiple ? placeholder : getUserDetails(userIds)?.display_name) : placeholder} {userIds ? (isMultiple ? placeholder : getUserDetails(userIds)?.display_name) : placeholder}
@ -74,6 +81,7 @@ export const BorderButton = observer((props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}); });
@ -86,6 +94,7 @@ export const BackgroundButton = observer((props: ButtonProps) => {
hideText = false, hideText = false,
placeholder, placeholder,
userIds, userIds,
tooltip,
} = props; } = props;
// store hooks // store hooks
const { getUserDetails } = useMember(); const { getUserDetails } = useMember();
@ -93,10 +102,18 @@ export const BackgroundButton = observer((props: ButtonProps) => {
const isMultiple = Array.isArray(userIds); const isMultiple = Array.isArray(userIds);
return ( return (
<div <Tooltip
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} tooltipHeading={placeholder}
tooltipContent={`${userIds?.length ?? 0} assignee${userIds?.length !== 1 ? "s" : ""}`}
disabled={!tooltip}
> >
{!hideIcon && <ButtonAvatars userIds={userIds} />} <div
className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
>
{!hideIcon && <ButtonAvatars tooltip={tooltip} userIds={userIds} />}
{!hideText && ( {!hideText && (
<span className="flex-grow truncate"> <span className="flex-grow truncate">
{userIds ? (isMultiple ? placeholder : getUserDetails(userIds)?.display_name) : placeholder} {userIds ? (isMultiple ? placeholder : getUserDetails(userIds)?.display_name) : placeholder}
@ -106,6 +123,7 @@ export const BackgroundButton = observer((props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}); });
@ -118,6 +136,7 @@ export const TransparentButton = observer((props: ButtonProps) => {
hideText = false, hideText = false,
placeholder, placeholder,
userIds, userIds,
tooltip,
} = props; } = props;
// store hooks // store hooks
const { getUserDetails } = useMember(); const { getUserDetails } = useMember();
@ -125,13 +144,18 @@ export const TransparentButton = observer((props: ButtonProps) => {
const isMultiple = Array.isArray(userIds); const isMultiple = Array.isArray(userIds);
return ( return (
<Tooltip
tooltipHeading={placeholder}
tooltipContent={`${userIds?.length ?? 0} assignee${userIds?.length !== 1 ? "s" : ""}`}
disabled={!tooltip}
>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
className className
)} )}
> >
{!hideIcon && <ButtonAvatars userIds={userIds} />} {!hideIcon && <ButtonAvatars tooltip={tooltip} userIds={userIds} />}
{!hideText && ( {!hideText && (
<span className="flex-grow truncate"> <span className="flex-grow truncate">
{userIds ? (isMultiple ? placeholder : getUserDetails(userIds)?.display_name) : placeholder} {userIds ? (isMultiple ? placeholder : getUserDetails(userIds)?.display_name) : placeholder}
@ -141,5 +165,6 @@ export const TransparentButton = observer((props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}); });

View File

@ -36,8 +36,9 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
placeholder = "Members", placeholder = "Members",
placement, placement,
projectId, projectId,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -146,6 +147,7 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -155,6 +157,7 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
@ -165,6 +168,7 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -174,6 +178,7 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
@ -184,6 +189,7 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -193,6 +199,7 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
hideText hideText
/> />
) : null} ) : null}

View File

@ -31,8 +31,9 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
onChange, onChange,
placeholder = "Members", placeholder = "Members",
placement, placement,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -133,6 +134,7 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -142,6 +144,7 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
@ -152,6 +155,7 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -161,6 +165,7 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
@ -171,6 +176,7 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -180,6 +186,7 @@ export const WorkspaceMemberDropdown: React.FC<MemberDropdownProps> = observer((
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
hideText hideText
/> />
) : null} ) : null}

View File

@ -8,7 +8,7 @@ import { useApplication, useModule } from "hooks/store";
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// icons // icons
import { DiceIcon } from "@plane/ui"; import { DiceIcon, Tooltip } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
// types // types
@ -40,6 +40,7 @@ type ButtonProps = {
hideText?: boolean; hideText?: boolean;
module: IModule | null; module: IModule | null;
placeholder: string; placeholder: string;
tooltip: boolean;
}; };
const BorderButton = (props: ButtonProps) => { const BorderButton = (props: ButtonProps) => {
@ -51,9 +52,11 @@ const BorderButton = (props: ButtonProps) => {
hideText = false, hideText = false,
module, module,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Module" tooltipContent={module?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
@ -66,6 +69,7 @@ const BorderButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -78,11 +82,16 @@ const BackgroundButton = (props: ButtonProps) => {
hideText = false, hideText = false,
module, module,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Module" tooltipContent={module?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
> >
{!hideIcon && <DiceIcon className="h-3 w-3 flex-shrink-0" />} {!hideIcon && <DiceIcon className="h-3 w-3 flex-shrink-0" />}
{!hideText && <span className="flex-grow truncate">{module?.name ?? placeholder}</span>} {!hideText && <span className="flex-grow truncate">{module?.name ?? placeholder}</span>}
@ -90,6 +99,7 @@ const BackgroundButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -102,9 +112,11 @@ const TransparentButton = (props: ButtonProps) => {
hideText = false, hideText = false,
module, module,
placeholder, placeholder,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Module" tooltipContent={module?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -117,6 +129,7 @@ const TransparentButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -135,8 +148,9 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
placeholder = "Module", placeholder = "Module",
placement, placement,
projectId, projectId,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -253,6 +267,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -263,6 +278,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
<BackgroundButton <BackgroundButton
@ -272,6 +288,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -282,6 +299,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
<TransparentButton <TransparentButton
@ -291,6 +309,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -301,6 +320,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : null} ) : null}
</button> </button>

View File

@ -2,11 +2,12 @@ import { Fragment, ReactNode, useRef, useState } from "react";
import { Combobox } from "@headlessui/react"; import { Combobox } from "@headlessui/react";
import { usePopper } from "react-popper"; import { usePopper } from "react-popper";
import { Check, ChevronDown, Search } from "lucide-react"; import { Check, ChevronDown, Search } from "lucide-react";
import { useTheme } from "next-themes";
// hooks // hooks
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// icons // icons
import { PriorityIcon } from "@plane/ui"; import { PriorityIcon, Tooltip } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
// types // types
@ -14,7 +15,6 @@ import { TIssuePriorities } from "@plane/types";
import { TDropdownProps } from "./types"; import { TDropdownProps } from "./types";
// constants // constants
import { ISSUE_PRIORITIES } from "constants/issue"; import { ISSUE_PRIORITIES } from "constants/issue";
import { useTheme } from "next-themes";
type Props = TDropdownProps & { type Props = TDropdownProps & {
button?: ReactNode; button?: ReactNode;
@ -33,6 +33,7 @@ type ButtonProps = {
hideText?: boolean; hideText?: boolean;
highlightUrgent: boolean; highlightUrgent: boolean;
priority: TIssuePriorities; priority: TIssuePriorities;
tooltip: boolean;
}; };
const BorderButton = (props: ButtonProps) => { const BorderButton = (props: ButtonProps) => {
@ -44,6 +45,7 @@ const BorderButton = (props: ButtonProps) => {
hideText = false, hideText = false,
highlightUrgent, highlightUrgent,
priority, priority,
tooltip,
} = props; } = props;
const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === priority); const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === priority);
@ -57,6 +59,7 @@ const BorderButton = (props: ButtonProps) => {
}; };
return ( return (
<Tooltip tooltipHeading="Priority" tooltipContent={priorityDetails?.title ?? "None"} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] rounded text-xs px-2 py-0.5",
@ -98,6 +101,7 @@ const BorderButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -110,6 +114,7 @@ const BackgroundButton = (props: ButtonProps) => {
hideText = false, hideText = false,
highlightUrgent, highlightUrgent,
priority, priority,
tooltip,
} = props; } = props;
const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === priority); const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === priority);
@ -123,6 +128,7 @@ const BackgroundButton = (props: ButtonProps) => {
}; };
return ( return (
<Tooltip tooltipHeading="Priority" tooltipContent={priorityDetails?.title ?? "None"} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5",
@ -164,6 +170,7 @@ const BackgroundButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -176,6 +183,7 @@ const TransparentButton = (props: ButtonProps) => {
hideText = false, hideText = false,
highlightUrgent, highlightUrgent,
priority, priority,
tooltip,
} = props; } = props;
const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === priority); const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === priority);
@ -189,6 +197,7 @@ const TransparentButton = (props: ButtonProps) => {
}; };
return ( return (
<Tooltip tooltipHeading="Priority" tooltipContent={priorityDetails?.title ?? "None"} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -230,6 +239,7 @@ const TransparentButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -247,8 +257,9 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
highlightUrgent = true, highlightUrgent = true,
onChange, onChange,
placement, placement,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -341,6 +352,7 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -352,6 +364,7 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
@ -364,6 +377,7 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -375,6 +389,7 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
@ -387,6 +402,7 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -398,6 +414,7 @@ export const PriorityDropdown: React.FC<Props> = (props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
hideText hideText
/> />
) : null} ) : null}

View File

@ -7,6 +7,8 @@ import { Check, ChevronDown, Search } from "lucide-react";
import { useProject } from "hooks/store"; import { useProject } from "hooks/store";
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// ui
import { Tooltip } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
import { renderEmoji } from "helpers/emoji.helper"; import { renderEmoji } from "helpers/emoji.helper";
@ -30,6 +32,7 @@ type ButtonProps = {
hideText?: boolean; hideText?: boolean;
placeholder: string; placeholder: string;
project: IProject | null; project: IProject | null;
tooltip: boolean;
}; };
const BorderButton = (props: ButtonProps) => { const BorderButton = (props: ButtonProps) => {
@ -41,9 +44,11 @@ const BorderButton = (props: ButtonProps) => {
hideText = false, hideText = false,
placeholder, placeholder,
project, project,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Project" tooltipContent={project?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
@ -60,6 +65,7 @@ const BorderButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -72,11 +78,16 @@ const BackgroundButton = (props: ButtonProps) => {
hideText = false, hideText = false,
placeholder, placeholder,
project, project,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Project" tooltipContent={project?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
> >
{!hideIcon && ( {!hideIcon && (
<span className="grid place-items-center flex-shrink-0"> <span className="grid place-items-center flex-shrink-0">
@ -88,6 +99,7 @@ const BackgroundButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -100,9 +112,11 @@ const TransparentButton = (props: ButtonProps) => {
hideText = false, hideText = false,
placeholder, placeholder,
project, project,
tooltip,
} = props; } = props;
return ( return (
<Tooltip tooltipHeading="Project" tooltipContent={project?.name ?? placeholder} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -119,6 +133,7 @@ const TransparentButton = (props: ButtonProps) => {
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -136,8 +151,9 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
onChange, onChange,
placeholder = "Project", placeholder = "Project",
placement, placement,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -239,6 +255,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -249,6 +266,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
<BackgroundButton <BackgroundButton
@ -258,6 +276,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -268,6 +287,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
<TransparentButton <TransparentButton
@ -277,6 +297,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -287,6 +308,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
hideIcon={hideIcon} hideIcon={hideIcon}
hideText hideText
placeholder={placeholder} placeholder={placeholder}
tooltip={tooltip}
/> />
) : null} ) : null}
</button> </button>

View File

@ -8,7 +8,7 @@ import { useApplication, useProjectState } from "hooks/store";
import { useDropdownKeyDown } from "hooks/use-dropdown-key-down"; import { useDropdownKeyDown } from "hooks/use-dropdown-key-down";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// icons // icons
import { StateGroupIcon } from "@plane/ui"; import { StateGroupIcon, Tooltip } from "@plane/ui";
// helpers // helpers
import { cn } from "helpers/common.helper"; import { cn } from "helpers/common.helper";
// types // types
@ -31,12 +31,22 @@ type ButtonProps = {
hideIcon?: boolean; hideIcon?: boolean;
hideText?: boolean; hideText?: boolean;
state: IState | undefined; state: IState | undefined;
tooltip: boolean;
}; };
const BorderButton = (props: ButtonProps) => { const BorderButton = (props: ButtonProps) => {
const { className, dropdownArrow, dropdownArrowClassName, hideIcon = false, hideText = false, state } = props; const {
className,
dropdownArrow,
dropdownArrowClassName,
hideIcon = false,
hideText = false,
state,
tooltip,
} = props;
return ( return (
<Tooltip tooltipHeading="State" tooltipContent={state?.name ?? "State"} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5", "h-full flex items-center gap-1.5 border-[0.5px] border-custom-border-300 hover:bg-custom-background-80 rounded text-xs px-2 py-0.5",
@ -44,38 +54,69 @@ const BorderButton = (props: ButtonProps) => {
)} )}
> >
{!hideIcon && ( {!hideIcon && (
<StateGroupIcon stateGroup={state?.group ?? "backlog"} color={state?.color} className="h-3 w-3 flex-shrink-0" /> <StateGroupIcon
stateGroup={state?.group ?? "backlog"}
color={state?.color}
className="h-3 w-3 flex-shrink-0"
/>
)} )}
{!hideText && <span className="flex-grow truncate">{state?.name ?? "State"}</span>} {!hideText && <span className="flex-grow truncate">{state?.name ?? "State"}</span>}
{dropdownArrow && ( {dropdownArrow && (
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
const BackgroundButton = (props: ButtonProps) => { const BackgroundButton = (props: ButtonProps) => {
const { className, dropdownArrow, dropdownArrowClassName, hideIcon = false, hideText = false, state } = props; const {
className,
dropdownArrow,
dropdownArrowClassName,
hideIcon = false,
hideText = false,
state,
tooltip,
} = props;
return ( return (
<Tooltip tooltipHeading="State" tooltipContent={state?.name ?? "State"} disabled={!tooltip}>
<div <div
className={cn("h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80", className)} className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 bg-custom-background-80",
className
)}
> >
{!hideIcon && ( {!hideIcon && (
<StateGroupIcon stateGroup={state?.group ?? "backlog"} color={state?.color} className="h-3 w-3 flex-shrink-0" /> <StateGroupIcon
stateGroup={state?.group ?? "backlog"}
color={state?.color}
className="h-3 w-3 flex-shrink-0"
/>
)} )}
{!hideText && <span className="flex-grow truncate">{state?.name ?? "State"}</span>} {!hideText && <span className="flex-grow truncate">{state?.name ?? "State"}</span>}
{dropdownArrow && ( {dropdownArrow && (
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
const TransparentButton = (props: ButtonProps) => { const TransparentButton = (props: ButtonProps) => {
const { className, dropdownArrow, dropdownArrowClassName, hideIcon = false, hideText = false, state } = props; const {
className,
dropdownArrow,
dropdownArrowClassName,
hideIcon = false,
hideText = false,
state,
tooltip,
} = props;
return ( return (
<Tooltip tooltipHeading="State" tooltipContent={state?.name ?? "State"} disabled={!tooltip}>
<div <div
className={cn( className={cn(
"h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80", "h-full flex items-center gap-1.5 rounded text-xs px-2 py-0.5 hover:bg-custom-background-80",
@ -83,13 +124,18 @@ const TransparentButton = (props: ButtonProps) => {
)} )}
> >
{!hideIcon && ( {!hideIcon && (
<StateGroupIcon stateGroup={state?.group ?? "backlog"} color={state?.color} className="h-3 w-3 flex-shrink-0" /> <StateGroupIcon
stateGroup={state?.group ?? "backlog"}
color={state?.color}
className="h-3 w-3 flex-shrink-0"
/>
)} )}
{!hideText && <span className="flex-grow truncate">{state?.name ?? "State"}</span>} {!hideText && <span className="flex-grow truncate">{state?.name ?? "State"}</span>}
{dropdownArrow && ( {dropdownArrow && (
<ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" /> <ChevronDown className={cn("h-2.5 w-2.5 flex-shrink-0", dropdownArrowClassName)} aria-hidden="true" />
)} )}
</div> </div>
</Tooltip>
); );
}; };
@ -107,8 +153,9 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
onChange, onChange,
placement, placement,
projectId, projectId,
value,
tabIndex, tabIndex,
tooltip = false,
value,
} = props; } = props;
// states // states
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
@ -204,6 +251,7 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
/> />
) : buttonVariant === "border-without-text" ? ( ) : buttonVariant === "border-without-text" ? (
<BorderButton <BorderButton
@ -212,6 +260,7 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "background-with-text" ? ( ) : buttonVariant === "background-with-text" ? (
@ -221,6 +270,7 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
/> />
) : buttonVariant === "background-without-text" ? ( ) : buttonVariant === "background-without-text" ? (
<BackgroundButton <BackgroundButton
@ -229,6 +279,7 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
hideText hideText
/> />
) : buttonVariant === "transparent-with-text" ? ( ) : buttonVariant === "transparent-with-text" ? (
@ -238,6 +289,7 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon} hideIcon={hideIcon}
tooltip={tooltip}
/> />
) : buttonVariant === "transparent-without-text" ? ( ) : buttonVariant === "transparent-without-text" ? (
<TransparentButton <TransparentButton
@ -245,6 +297,8 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
className={buttonClassName} className={buttonClassName}
dropdownArrow={dropdownArrow && !disabled} dropdownArrow={dropdownArrow && !disabled}
dropdownArrowClassName={dropdownArrowClassName} dropdownArrowClassName={dropdownArrowClassName}
hideIcon={hideIcon}
tooltip={tooltip}
hideText hideText
/> />
) : null} ) : null}

View File

@ -18,4 +18,5 @@ export type TDropdownProps = {
placeholder?: string; placeholder?: string;
placement?: Placement; placement?: Placement;
tabIndex?: number; tabIndex?: number;
tooltip?: boolean;
}; };

View File

@ -81,6 +81,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
projectId={issue.project_id} projectId={issue.project_id}
disabled={isReadOnly} disabled={isReadOnly}
buttonVariant="border-with-text" buttonVariant="border-with-text"
tooltip
/> />
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
@ -94,6 +95,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
disabled={isReadOnly} disabled={isReadOnly}
buttonVariant="border-without-text" buttonVariant="border-without-text"
buttonClassName="border" buttonClassName="border"
tooltip
/> />
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
@ -121,6 +123,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
placeholder="Start date" placeholder="Start date"
buttonVariant={issue.start_date ? "border-with-text" : "border-without-text"} buttonVariant={issue.start_date ? "border-with-text" : "border-without-text"}
disabled={isReadOnly} disabled={isReadOnly}
tooltip
/> />
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
@ -136,6 +139,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
placeholder="Due date" placeholder="Due date"
buttonVariant={issue.target_date ? "border-with-text" : "border-without-text"} buttonVariant={issue.target_date ? "border-with-text" : "border-without-text"}
disabled={isReadOnly} disabled={isReadOnly}
tooltip
/> />
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
@ -151,6 +155,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
multiple multiple
buttonVariant={issue.assignee_ids?.length > 0 ? "transparent-without-text" : "border-without-text"} buttonVariant={issue.assignee_ids?.length > 0 ? "transparent-without-text" : "border-without-text"}
buttonClassName={issue.assignee_ids?.length > 0 ? "hover:bg-transparent px-0" : ""} buttonClassName={issue.assignee_ids?.length > 0 ? "hover:bg-transparent px-0" : ""}
tooltip
/> />
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
@ -165,6 +170,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
projectId={issue.project_id} projectId={issue.project_id}
disabled={isReadOnly} disabled={isReadOnly}
buttonVariant="border-with-text" buttonVariant="border-with-text"
tooltip
/> />
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>

View File

@ -1,9 +1,9 @@
<svg width="94" height="94" viewBox="0 0 94 94" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="94" height="94" viewBox="0 0 94 94" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="46.7188" cy="46.7188" r="46.7188" fill="#F9F9FB"/> <circle cx="46.7188" cy="46.7188" r="46.7188" fill="#F9F9FB"/>
<path d="M74.5 34.2487V29.9987C74.5 28.4958 73.903 27.0545 72.8403 25.9918C71.7776 24.9291 70.3362 24.332 68.8333 24.332H29.1667C27.6638 24.332 26.2224 24.9291 25.1597 25.9918C24.097 27.0545 23.5 28.4958 23.5 29.9987V69.6654C23.5 71.1683 24.097 72.6096 25.1597 73.6723C26.2224 74.735 27.6638 75.332 29.1667 75.332H39.0833" stroke="#D9D9E0" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M69.625 35.4362V31.7487C69.625 30.4447 69.107 29.1941 68.1849 28.2721C67.2629 27.35 66.0123 26.832 64.7083 26.832H30.2917C28.9877 26.832 27.7371 27.35 26.8151 28.2721C25.893 29.1941 25.375 30.4447 25.375 31.7487V66.1654C25.375 67.4693 25.893 68.7199 26.8151 69.642C27.7371 70.564 28.9877 71.082 30.2917 71.082H38.8958" stroke="#D9D9E0" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M60.332 18.668V30.0013" stroke="#CDCED6" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/> <path d="M57.332 21.918V31.7513" stroke="#CDCED6" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M37.668 18.668V30.0013" stroke="#CDCED6" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/> <path d="M37.668 21.918V31.7513" stroke="#CDCED6" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M23.5 41.332H37.6667" stroke="#D9D9E0" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/> <path d="M25.375 41.582H37.6667" stroke="#D9D9E0" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M64.582 62.5846L60.332 59.1846V52.668" stroke="#B9BBC6" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/> <path d="M61.0195 60.0221L57.332 57.0721V51.418" stroke="#B9BBC6" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M60.332 75.332C69.7209 75.332 77.332 67.7209 77.332 58.332C77.332 48.9432 69.7209 41.332 60.332 41.332C50.9432 41.332 43.332 48.9432 43.332 58.332C43.332 67.7209 50.9432 75.332 60.332 75.332Z" stroke="#B9BBC6" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/> <path d="M57.332 71.082C65.4782 71.082 72.082 64.4782 72.082 56.332C72.082 48.1858 65.4782 41.582 57.332 41.582C49.1858 41.582 42.582 48.1858 42.582 56.332C42.582 64.4782 49.1858 71.082 57.332 71.082Z" stroke="#B9BBC6" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB