feat(ui): add existing-report analytics destination
This commit is contained in:
@@ -216,6 +216,14 @@ export default function AppShell({
|
||||
() => activeNavItemTo(pathname, [...nav, ...navBottom]),
|
||||
[pathname, nav, navBottom],
|
||||
);
|
||||
const desktopNavigationRef = useRef<HTMLDivElement>(null);
|
||||
const mobileNavigationRef = useRef<HTMLDivElement>(null);
|
||||
// New destinations can extend the existing scrollable list below its initial viewport.
|
||||
// Reveal the actual current item on entry, without resetting a user's later manual scroll.
|
||||
useEffect(() => {
|
||||
const navigation = isMobile ? mobileNavigationRef.current : desktopNavigationRef.current;
|
||||
navigation?.querySelector<HTMLElement>('[aria-current="page"]')?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
|
||||
}, [activeTo, navCollapsed, isMobile, drawerOpen, headerHeight]);
|
||||
|
||||
const renderNavList = (groups: Array<[string, NavItem[]]>) => (
|
||||
<Box sx={{ px: navCollapsed ? 0.75 : 1.25, pt: 1 }}>
|
||||
@@ -577,6 +585,7 @@ export default function AppShell({
|
||||
</AppBar>
|
||||
|
||||
<Drawer
|
||||
ref={desktopNavigationRef}
|
||||
variant="permanent"
|
||||
sx={{
|
||||
display: isMobile ? "none" : "block",
|
||||
@@ -598,6 +607,7 @@ export default function AppShell({
|
||||
</Drawer>
|
||||
|
||||
<Drawer
|
||||
ref={mobileNavigationRef}
|
||||
variant="temporary"
|
||||
open={isMobile && drawerOpen}
|
||||
onClose={() => onToggleDrawer(false)}
|
||||
|
||||
Reference in New Issue
Block a user