diff --git a/src/components/navigation/GlobalNavigation/HomeButton.tsx b/src/components/navigation/GlobalNavigation/HomeButton.tsx index f4f061833..31253d12f 100644 --- a/src/components/navigation/GlobalNavigation/HomeButton.tsx +++ b/src/components/navigation/GlobalNavigation/HomeButton.tsx @@ -1,7 +1,7 @@ -import React from 'react' +import React, { useState } from 'react' import { Center, Icon, Popover, Tooltip } from 'src/components' import MiniMap from 'src/components/navigation/MiniMap/MiniMap' -import { IMiniMapOptions } from 'src/components/navigation/GlobalNavigation/GlobalNavigationItems' +import { IMiniMapOptions, MiniMapLink } from 'src/components/navigation/GlobalNavigation/GlobalNavigationItems' interface MpHomeButtonProps { onClick: () => void @@ -29,19 +29,30 @@ function MpHomeButton(props: MpHomeButtonProps) { } function MinimapWithPopover(props: MinimapWithPopoverProps) { + const [isPopoverOpen, setIsPopoverOpen] = useState(false) + const handleLinkClick = (link: MiniMapLink) => { + setIsPopoverOpen(false) + props.onLinkClick(link) + } + const handlePopoverOpenChange = (newPopoverState: boolean) => { + setIsPopoverOpen(newPopoverState) + } + return ( ( + content={ - )} + } placement="rightBottom" + open={isPopoverOpen} + onOpenChange={handlePopoverOpenChange} arrow={false}>