diff --git a/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx b/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx index 6b7edc59f..69cc029bc 100644 --- a/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx +++ b/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx @@ -487,7 +487,8 @@ export const MP: Story = { overviewHref: '/', onLinkClick: link => alert(link.href), onUnauthorizedClick: link => alert(`unauthorized ${link?.href} `), - unauthorizedLinks: ['oversight', 'dataPlatform'], + unauthorizedLinks: ['dataPlatform'], + activeLink: 'oversight', links: [ { linkId: 'oversight', href: '/oversight' }, { linkId: 'dataPlatform', href: '/data-platform' }, diff --git a/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts b/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts index 7bc4055f1..557c4849f 100644 --- a/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts +++ b/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts @@ -44,4 +44,5 @@ export interface IMiniMapOptions { onLinkClick: (link: MiniMapLink) => void onUnauthorizedClick: (link?: MiniMapLink) => void unauthorizedLinks: MiniMapLinks[] + activeLink: MiniMapLinks } diff --git a/src/components/navigation/GlobalNavigation/HomeButton.tsx b/src/components/navigation/GlobalNavigation/HomeButton.tsx index 22e823d63..f4f061833 100644 --- a/src/components/navigation/GlobalNavigation/HomeButton.tsx +++ b/src/components/navigation/GlobalNavigation/HomeButton.tsx @@ -38,6 +38,7 @@ function MinimapWithPopover(props: MinimapWithPopoverProps) { links={props.links} onLinkClick={props.onLinkClick} unauthorizedLinks={props.unauthorizedLinks} + activeLink={props.activeLink} /> )} placement="rightBottom" @@ -68,6 +69,7 @@ export function HomeButton(props: HomeButtonProps) { onLinkClick={props.minimapOptions.onLinkClick} unauthorizedLinks={props.minimapOptions.unauthorizedLinks} onPopoverClick={props.onMpHomeClick} + activeLink={props.minimapOptions.activeLink} /> ) } diff --git a/src/components/navigation/MiniMap/MiniMap.tsx b/src/components/navigation/MiniMap/MiniMap.tsx index 450bbc239..d57dc54f9 100644 --- a/src/components/navigation/MiniMap/MiniMap.tsx +++ b/src/components/navigation/MiniMap/MiniMap.tsx @@ -25,6 +25,7 @@ const Minimap = (props: IMiniMapProps) => { href: link.href, variant: 'drop-shadow', isUnauthorized: props.unauthorizedLinks.includes(link.linkId), + isActive: props.activeLink === link.linkId, })) return ( diff --git a/src/components/navigation/MiniMap/SvgLinker.tsx b/src/components/navigation/MiniMap/SvgLinker.tsx index 2c435147f..94f2667a2 100644 --- a/src/components/navigation/MiniMap/SvgLinker.tsx +++ b/src/components/navigation/MiniMap/SvgLinker.tsx @@ -6,6 +6,7 @@ export interface ISvgLink { href: string variant?: 'regular' | 'black' | 'drop-shadow' isUnauthorized?: boolean + isActive?: boolean } interface ISvgLinkerProps { @@ -21,10 +22,16 @@ export const SvgLinker = (props: ISvgLinkerProps) => { const href = target.closest('a')?.getAttribute('href') const link = props.links.find(b => b.href === href) - if (link) props.onLinkClick(link) + if (link) { + props.onLinkClick(link) + } } - return