feat: sidebar nav item tooltips (#9160)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/8946/head^2
VasuDevrani 2023-05-30 19:48:21 +05:30 committed by GitHub
parent 24ee3401af
commit 60a3bc5832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -41,6 +41,7 @@ import {
HeadSeo,
Logo,
SkeletonText,
Tooltip,
showToast,
useCalcomTheme,
} from "@calcom/ui";
@ -618,6 +619,7 @@ const NavigationItem: React.FC<{
return (
<Fragment>
<Tooltip side="right" content={t(item.name)} className="lg:hidden">
<Link
href={item.href}
aria-label={t(item.name)}
@ -646,6 +648,7 @@ const NavigationItem: React.FC<{
<SkeletonText className="h-3 w-32" />
)}
</Link>
</Tooltip>
{item.child &&
isCurrent({ router, isChild, item }) &&
item.child.map((item, index) => <NavigationItem index={index} key={item.name} item={item} isChild />)}

View File

@ -30,14 +30,15 @@ export function Tooltip({
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
<TooltipPrimitive.Portal>
<TooltipPrimitive.Content
{...props}
className={classNames(
side === "top" && "-mt-7",
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}
align="center"
{...props}>
align="center">
{content}
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>