-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderBlock
returns nothing
#32
Comments
@grubersjoe I'm trying to add tooltip i tried your approach as well its not working 🙇🏼 renderBlock={(block, activity) =>
cloneElement(block, {
children: (
<Tooltip content={`gm`} placement="top">
{block}
</Tooltip>
)
})
} |
renderBlock={(block, activity) => (
<Tooltip content={`gm`} placement="top">
{block}
</Tooltip>
)} this one also not working 🙇🏼 |
This is the tooltip component https://github.com/lensterxyz/lenster/blob/main/packages/ui/src/Tooltip.tsx I followed the same as in example https://grubersjoe.github.io/react-activity-calendar/?path=/story/react-activity-calendar--tooltips but it renders nothing 🙇🏼 |
Any ideas how to fix? |
I'm facing a similar issue as @bigint, as I'm wrapping |
Any ideas how to fix? |
Hey people. I haven't forgotten about this issue but I've realized from your comments that it seems pretty hard to support the whole variety of tooltip libraries since they're all implemented differently. I will try to come up with a better solution, but in general it seems difficult. Maybe a "headless" approach where styling is up to the component user would be best. It's a bit more work, but very flexible. Floating UI looks promising for example. |
Has anyone achieved this using the radix-ui tooltip? |
FYI it can work like this: const CustomTooltip = ({ children, count, date }: { children: React.ReactNode; count: number; date: string }) => (
<Tooltip.Root>
<Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content sideOffset={10} side="top">
<div>
your tooltip content
</div>
<Tooltip.Arrow />
</Tooltip.Content>
</Tooltip.Portal>
</Tooltip.Root>
) Usage in ActivityCalendar <TooltipProvider>
<ActivityCalendar
data={data}
renderBlock={(block, activity) => (
<CustomTooltip date={activity.date} count={activity.count}>
{block}
</CustomTooltip>
)}
/>
</TooltipProvider> |
The text was updated successfully, but these errors were encountered: