fix: use tooltip portal (#5889)

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
pull/5700/head^2
Udit Takkar 2022-12-06 19:27:02 +05:30 committed by GitHub
parent 10d3b5f1b9
commit a9117c2d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -5,8 +5,7 @@ import { Icon } from "react-feather";
import classNames from "@calcom/lib/classNames";
import { applyStyleToMultipleVariants } from "@calcom/lib/cva";
import Tooltip from "../../v2/core/Tooltip";
import { Tooltip } from "@calcom/ui";
type InferredVariantProps = VariantProps<typeof buttonClasses>;

View File

@ -26,18 +26,20 @@ export function Tooltip({
defaultOpen={defaultOpen}
onOpenChange={onOpenChange}>
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
<TooltipPrimitive.Content
className={classNames(
side === "top" && "-mt-7",
side === "right" && "ml-2",
<TooltipPrimitive.Portal>
<TooltipPrimitive.Content
className={classNames(
side === "top" && "-mt-7",
side === "right" && "ml-2",
"relative z-40 rounded-md bg-gray-900 px-2 py-1 text-xs font-semibold text-white shadow-lg dark:bg-white dark:text-gray-600"
)}
side={side}
align="center"
{...props}>
{content}
</TooltipPrimitive.Content>
"relative z-40 rounded-md bg-gray-900 px-2 py-1 text-xs font-semibold text-white shadow-lg dark:bg-white dark:text-gray-600"
)}
side={side}
align="center"
{...props}>
{content}
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>
</TooltipPrimitive.Root>
);
}