add tooltip portal (#10233)

This commit is contained in:
Josh Hawkins 2024-03-04 07:34:23 -06:00 committed by GitHub
parent c2a537ce22
commit 85ce672b53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import {
} from "@/components/ui/tooltip"; } from "@/components/ui/tooltip";
import { useState } from "react"; import { useState } from "react";
import { isDesktop } from "react-device-detect"; import { isDesktop } from "react-device-detect";
import { TooltipPortal } from "@radix-ui/react-tooltip";
const variants = { const variants = {
primary: { primary: {
@ -61,9 +62,11 @@ export default function NavItem({
<Icon className="size-5 md:m-[6px]" /> <Icon className="size-5 md:m-[6px]" />
</TooltipTrigger> </TooltipTrigger>
</NavLink> </NavLink>
<TooltipPortal>
<TooltipContent side="right"> <TooltipContent side="right">
<p>{title}</p> <p>{title}</p>
</TooltipContent> </TooltipContent>
</TooltipPortal>
</Tooltip> </Tooltip>
) )
); );