feat: update url onvalue change

This commit is contained in:
lemmyMwaura
2024-07-27 22:18:56 +03:00
parent 9e9aff129e
commit 15749a1f52

View File

@@ -22,12 +22,19 @@ export const MembersPage = withProjectPermission(
}
}, [selectedTab]);
const updateSelectedTab = (tab: TabSections) => {
router.push({
pathname: router.pathname,
query: { ...router.query, selectedTab: tab },
});
}
return (
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 text-white">
<div className="mx-auto mb-6 w-full max-w-7xl py-6 px-6">
<div>{selectedTab}</div>
<p className="mr-4 mb-4 text-3xl font-semibold text-white">Project Access Control</p>
<Tabs value={activeTab} onValueChange={setActiveTab}>
<Tabs value={activeTab} onValueChange={updateSelectedTab}>
<TabList>
<Tab value={TabSections.Member}>Users</Tab>
<Tab value={TabSections.Identities}>