I'm looking to implement an asana-like UI where a user selects an item from a table and a details panel will open up to the side. My current setup causes a page refresh when I select an item.
I'm having trouble figuring out how to go about routing this setup. Each row in the table has a Link item in it. The root page containing the table is something.com/items When a user selects an item the address should be something.com/items/[selectionId]. selectionId is the DB id of the selected item.
I've tried router..push w/ shallow also, but the refresh still seems to happen.
I have my pages set up like this:
- pages
-- items
--- [selectionId].tsx
--- index.tsx
index.tsx
...
return (
<ItemsPageContainer title={'Items'}>
<div className="relative flex h-full w-full flex-row space-y-6">
<Items organization={organization} />
</div>
</ItemsPageContainer >
)
...
[selectionId].tsx
...
return (
<ItemsPageContainer title={'Items'}>
<div className="relative flex h-full w-full flex-row space-y-6">
<Items organization={organization} />
<DetailsPane /> // Adds details pane
</div>
</ItemsPageContainer >
)
...