-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor: enable routing config via provider, remove linkProps from DatasetSelectorModal #1338
base: main
Are you sure you want to change the base?
Conversation
- Transform environment config into comprehensive Veda UI configuration - Add framework-agnostic navigation handling - Extract environment and navigation into separate type-safe interfaces - Add useVedaUI hook with context validation - Improve TypeScript types and error handling
- Remove custom link handling in favor of VedaUIProvider's Link - Configure VedaUIProvider with react-router Link component - Remove SmartLink from exploration container - Update DatasetSelectorModal to use new Link component
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@vgeorge - Yep, I agree. Callbacks are meant for actions like buttons which is why I didn't include pageheader as part of this work! Since it should retain the link component. But I have some thoughts with this approach, it might be best to meet and talk over a call. (which we are 🙏🏼 ) |
|
||
interface NavigationConfig { | ||
LinkComponent: React.ElementType<Record<string, any>>; | ||
linkPropName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorry this is not directly related to what this PR changes but since we are on it) - I wonder if we need to make this as an object (linkProps) and make the linkPropName as a part of it since we can't predict what props to expect.
We had a chat today about this (@sandrahoang686, @hanbyul-here, @dzole0311 and I). The output was:
Please let me if I missed something, thanks! |
Related Tickets: #1326 #1108
Description of Changes
VedaUIProvider
'sLink
VedaUIProvider
withreact-router
'sLink
componentSmartLink
from the exploration containerDatasetSelectorModal
to use the newLink
componentNotes & Questions About Changes
We discussed in #1108 approaches for making the library agnostic to the routing library. In this comment, I explained why I think we should avoid relying solely on navigation callbacks, as they degrade the accessibility of the library.
In the approach introduced in this PR, we expand the existing configuration provider to also allow passing routing configuration, making the library compatible with
react-router
,next.js
, or any other routing framework.This PR became quite large but most changes are on invocation calls to the refactored hook. Please let me know if you have any difficulties when reviewing it.
Validation / Testing
The
EnvConfigProvider
was replaced byVedaUIProvider
. The maps and any other functionality depending on the Mapbox token and API endpoints should work as before.The
DatasetSelectorModal
only usesLink
when empty. To test, replace the line here withdatasets={[]}
, visit the exploration page, and confirm that the link in the empty state message works correctly.