[UI]: Migrate react-tooltip usages to CustomTooltip from @sistent/sistent
Description
Several files in the codebase currently use react-tooltip for tooltip functionality, while the project has standardized on CustomTooltip from @sistent/sistent as the preferred tooltip component.
This inconsistency means different parts of the website render tooltips with different styles, behaviors, and dependencies.
Expected Behavior
All tooltip usage across the codebase should use CustomTooltip from @sistent/sistent, consistent with the design system and existing usage in the codebase.
Rather than doing a direct find-and-replace of react-tooltip with CustomTooltip across every file, the cleaner long-term solution is to introduce a shared internal Tooltip wrapper component inside :
src/components/Tooltip/index.js
All files across the repo would then import from this single wrapper:
import Tooltip from "../../components/Tooltip";
Why this approach:
- Single source of truth β if
@sistent/sistentever updatesCustomTooltip, only one file needs to change - Makes future migrations easier
Screenshots
NA
Environment:
- Host OS:
- Browser:
Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.
- π See contributing instructions.
- π¨ Wireframes and designs for Layer5 site in Figma (open invite)
- ππΎππΌ Questions: Discussion Forum and Community Slack.
Join the Layer5 Community by submitting your community member form.
@Katotodan can you pls review the approach? Thanks
Rather than doing a direct find-and-replace of
react-tooltipwithCustomTooltipacross every file, the cleaner long-term solution is to introduce a shared internal Tooltip wrapper component inside :
src/components/Tooltip/index.jsAll files across the repo would then import from this single wrapper:
import Tooltip from "../../components/Tooltip";
I don't think that we need another wrapper, but we could just use the CustomTooltip (from sistent) where needed and import it where needed. @Rajesh-Nagarajan-11 could have a thought on this.
Alright, whatever fits the best @Rajesh-Nagarajan-11 gentle ping!
Hi @Katotodan @Rajesh-Nagarajan-11 What is the decided approach? I would like to start working on it Thanks!
@Katotodan @Rajesh-Nagarajan-11 I think using a shared tooltip wrapper could still be useful here.
Instead of replacing react-tooltip imports with direct CustomTooltip imports in every file, we can centralise the usage through one internal component.
This would give us a single place to handle any future @sistent/sistent API changes, fallback behaviour, or import-related issues without updating multiple files across the codebase.
That said, if the preferred project convention is to import CustomTooltip directly from @sistent/sistent wherever needed.
What do you think would be better for long-term maintainability?
Hi @Katotodan @Rajesh-Nagarajan-11 β just following up on this. Could you share your final call on the direction? Happy to start the implementation as soon as we have clarity. Thanks!