This commit is contained in:
2024-08-05 15:20:15 +05:00
parent 1b22c31828
commit 3c148129f7
4 changed files with 137 additions and 65 deletions
@@ -22,13 +22,14 @@ const Navbar = () => {
useEffect(() => {
const pathname = location.pathname;
console.log(pathname);
const tab = tabs.find((tab) => tab.path === pathname);
const defaultTab = tabs[0];
if (tab) {
setSelectedTab(tab);
} else {
setSelectedTab(defaultTab);
setSelectedTab(null);
}
console.log("tab", tab);
}, [location.pathname]);
useEffect(() => {