From d29f34566c63bf75dd550133b5bdd6cfefeaa12f Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:24:59 +0530 Subject: [PATCH] fix : tooltip fix (#318) * fix: ellipsis added to issue title * feat: toolttip added * feat: assignees tooltip added * fix: build fix * fix: build fix * fix: build error --------- Co-authored-by: Aaryan Khandelwal --- .../core/list-view/single-issue.tsx | 1 - apps/app/components/ui/tooltip.tsx | 45 +++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index 80ad522a6..69745f6e2 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -16,7 +16,6 @@ import { ViewPrioritySelect, ViewStateSelect, } from "components/issues/view-select"; -import { Tooltip2 } from "@blueprintjs/popover2"; // ui import { Tooltip, CustomMenu } from "components/ui"; diff --git a/apps/app/components/ui/tooltip.tsx b/apps/app/components/ui/tooltip.tsx index 796a01ed8..f7fb77425 100644 --- a/apps/app/components/ui/tooltip.tsx +++ b/apps/app/components/ui/tooltip.tsx @@ -1,7 +1,8 @@ import React from "react"; + import { Tooltip2 } from "@blueprintjs/popover2"; -export type Props = { +type Props = { tooltipHeading?: string; tooltipContent: string; position?: "top" | "right" | "bottom" | "left"; @@ -15,26 +16,24 @@ export const Tooltip: React.FC = ({ position = "top", children, disabled = false, -}) => { - return ( - - {tooltipHeading ? ( - <> -
{tooltipHeading}
-

{tooltipContent}

- - ) : ( +}) => ( + + {tooltipHeading ? ( + <> +
{tooltipHeading}

{tooltipContent}

- )} - - } - position={position} - renderTarget={({ isOpen: isTooltipOpen, ref: eleRefernce, ...tooltipProps }) => - React.cloneElement(children, { ref: eleRefernce, ...tooltipProps, ...children.props }) - } - /> - ); -}; + + ) : ( +

{tooltipContent}

+ )} + + } + position={position} + renderTarget={({ isOpen: isTooltipOpen, ref: eleRefernce, ...tooltipProps }) => + React.cloneElement(children, { ref: eleRefernce, ...tooltipProps, ...children.props }) + } + /> +);