-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix AVS Details tab navigation #148
Conversation
src/App.jsx
Outdated
const router = createBrowserRouter( | ||
createRoutesFromElements( | ||
<Route path="/" element={<Layout />}> | ||
<Route index element={<Home />} /> | ||
<Route path="/avs" element={<AVSList />} /> | ||
<Route path="/avs/:address/:tab?" element={<AVSDetails />} /> | ||
<Route path="/lrt" element={<LRT />} /> | ||
<Route path="/operators" element={<OperatorsList />} /> | ||
<Route path="/operators/:address" element={<OperatorDetails />} /> | ||
<Route path="/lst" element={<LST />} /> | ||
<Route path="*" element={<NotFound />} /> | ||
</Route> | ||
) | ||
); |
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.
moved this up as per https://reactrouter.com/en/main/routers/router-provider. I need to access the router instance
|
||
export default function App() { | ||
log.debug('Starting up'); | ||
|
||
return ( | ||
<NextUIProvider> | ||
<NextUIProvider navigate={router.navigate}> |
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.
So that the href
in Tab can work properly. The docs say this is "PRIVATE - DO NOT USE" , but its perfectly fine to use as per the maintainer.
If we are not feeling comfortable with using this "unstable" API, we would have to remove the usage of createBrowserRouter
and RouterProvider
and use <BrowserRouter/>
instead. From what I can tell, we don't use any of the fancy data API features provided by RouterProvider
so switching should not break anything. More info here
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.
Good job!
Fixes #137
http://localhost:5173/avs/0x870679e138bcdf293b7ff14dd44b70fc97e12fc0/operators?page=1&sort=-tvl