feat: sidebar nav item tooltips (#9160)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/8946/head^2
parent
24ee3401af
commit
60a3bc5832
|
@ -41,6 +41,7 @@ import {
|
||||||
HeadSeo,
|
HeadSeo,
|
||||||
Logo,
|
Logo,
|
||||||
SkeletonText,
|
SkeletonText,
|
||||||
|
Tooltip,
|
||||||
showToast,
|
showToast,
|
||||||
useCalcomTheme,
|
useCalcomTheme,
|
||||||
} from "@calcom/ui";
|
} from "@calcom/ui";
|
||||||
|
@ -618,6 +619,7 @@ const NavigationItem: React.FC<{
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
<Tooltip side="right" content={t(item.name)} className="lg:hidden">
|
||||||
<Link
|
<Link
|
||||||
href={item.href}
|
href={item.href}
|
||||||
aria-label={t(item.name)}
|
aria-label={t(item.name)}
|
||||||
|
@ -646,6 +648,7 @@ const NavigationItem: React.FC<{
|
||||||
<SkeletonText className="h-3 w-32" />
|
<SkeletonText className="h-3 w-32" />
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
|
</Tooltip>
|
||||||
{item.child &&
|
{item.child &&
|
||||||
isCurrent({ router, isChild, item }) &&
|
isCurrent({ router, isChild, item }) &&
|
||||||
item.child.map((item, index) => <NavigationItem index={index} key={item.name} item={item} isChild />)}
|
item.child.map((item, index) => <NavigationItem index={index} key={item.name} item={item} isChild />)}
|
||||||
|
|
|
@ -30,14 +30,15 @@ export function Tooltip({
|
||||||
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
|
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
|
||||||
<TooltipPrimitive.Portal>
|
<TooltipPrimitive.Portal>
|
||||||
<TooltipPrimitive.Content
|
<TooltipPrimitive.Content
|
||||||
|
{...props}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
side === "top" && "-mt-7",
|
side === "top" && "-mt-7",
|
||||||
side === "right" && "ml-2",
|
side === "right" && "ml-2",
|
||||||
"bg-inverted text-inverted relative z-50 rounded-md px-2 py-1 text-xs font-semibold shadow-lg"
|
"bg-inverted text-inverted relative z-50 rounded-md px-2 py-1 text-xs font-semibold shadow-lg",
|
||||||
|
props.className && `${props.className}`
|
||||||
)}
|
)}
|
||||||
side={side}
|
side={side}
|
||||||
align="center"
|
align="center">
|
||||||
{...props}>
|
|
||||||
{content}
|
{content}
|
||||||
</TooltipPrimitive.Content>
|
</TooltipPrimitive.Content>
|
||||||
</TooltipPrimitive.Portal>
|
</TooltipPrimitive.Portal>
|
||||||
|
|
Loading…
Reference in New Issue