maybe fix tooltip on mobile?
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Has been cancelled
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
parent
55b9f0e4ef
commit
56b2f272b9
@ -3,6 +3,7 @@
|
|||||||
import { Tooltip as ShadCnTooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
import { Tooltip as ShadCnTooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { cn } from "@/common/utils";
|
import { cn } from "@/common/utils";
|
||||||
|
import { useDebounce } from "@uidotdev/usehooks";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
/**
|
/**
|
||||||
@ -33,9 +34,10 @@ type Props = {
|
|||||||
|
|
||||||
export default function Tooltip({ children, display, asChild = true, side = "top", className }: Props) {
|
export default function Tooltip({ children, display, asChild = true, side = "top", className }: Props) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
const openDebounce = useDebounce(open, 100);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ShadCnTooltip>
|
<ShadCnTooltip open={openDebounce}>
|
||||||
<TooltipTrigger className={className} asChild={asChild}>
|
<TooltipTrigger className={className} asChild={asChild}>
|
||||||
<div
|
<div
|
||||||
className={cn("cursor-default", className)}
|
className={cn("cursor-default", className)}
|
||||||
|
Reference in New Issue
Block a user