feat: enhance navigation state handling for history overview
- Updated NavLink components in App and DesktopSidebar to conditionally pass state for the '/history' route, improving user experience by maintaining the selected tab on navigation.
This commit is contained in:
parent
1c512b0d0a
commit
3eb7ef3ae6
|
|
@ -79,6 +79,7 @@ function Nav({ isAdmin }) {
|
||||||
<NavLink
|
<NavLink
|
||||||
key={item.to}
|
key={item.to}
|
||||||
to={item.to}
|
to={item.to}
|
||||||
|
state={item.to === '/history' ? { tab: 'overview' } : undefined}
|
||||||
end={!!item.end}
|
end={!!item.end}
|
||||||
className={({ isActive }) =>
|
className={({ isActive }) =>
|
||||||
'nav-item' +
|
'nav-item' +
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ export default function DesktopSidebar({
|
||||||
<NavLink
|
<NavLink
|
||||||
key={item.to}
|
key={item.to}
|
||||||
to={item.to}
|
to={item.to}
|
||||||
|
state={item.to === '/history' ? { tab: 'overview' } : undefined}
|
||||||
end={!!item.end}
|
end={!!item.end}
|
||||||
className={({ isActive }) =>
|
className={({ isActive }) =>
|
||||||
'desktop-sidebar__link' +
|
'desktop-sidebar__link' +
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user