From 4b72b5b47ad64baab7cc0bfb397dc702fb41941e Mon Sep 17 00:00:00 2001 From: Basile Spaenlehauer Date: Mon, 17 Jun 2024 14:54:59 +0200 Subject: [PATCH] fix: add geolocation button back (#752) --- cypress/e2e/island.cy.ts | 4 ++-- src/modules/navigationIsland/NavigationIsland.tsx | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/island.cy.ts b/cypress/e2e/island.cy.ts index 7a18f263..64d16926 100644 --- a/cypress/e2e/island.cy.ts +++ b/cypress/e2e/island.cy.ts @@ -52,7 +52,7 @@ describe('Island', () => { }); // temporarily disable - it.skip('Show map button for parent geolocation', () => { + it('Show map button for parent geolocation', () => { const parentItem = PackedFolderItemFactory({ settings: {} }); const child = PackedFolderItemFactory({ parentItem, settings: {} }); const geolocation = { lat: 0, lng: 0, item: parentItem }; @@ -85,7 +85,7 @@ describe('Island', () => { }); // temporarily disable - it.skip('Show map button for child geolocation', () => { + it('Show map button for child geolocation', () => { const parentItem = PackedFolderItemFactory({ settings: {} }); const child1 = PackedFolderItemFactory({ parentItem, settings: {} }); const child2 = PackedFolderItemFactory({ parentItem, settings: {} }); diff --git a/src/modules/navigationIsland/NavigationIsland.tsx b/src/modules/navigationIsland/NavigationIsland.tsx index a5299a61..e9cf28a0 100644 --- a/src/modules/navigationIsland/NavigationIsland.tsx +++ b/src/modules/navigationIsland/NavigationIsland.tsx @@ -3,14 +3,14 @@ import { Box, Stack } from '@mui/material'; import { NAVIGATION_ISLAND_CY } from '@/config/selectors'; import useChatButton from './ChatButton'; -// import useGeolocationButton from './GeolocationButton'; +import useGeolocationButton from './GeolocationButton'; import usePinnedItemsButton from './PinnedItemsButton'; import usePreviousNextButtons from './PreviousNextButtons'; const NavigationIslandBox = (): JSX.Element | false => { const { previousButton, nextButton } = usePreviousNextButtons(); const { chatButton } = useChatButton(); - // const { geolocationButton } = useGeolocationButton(); + const { geolocationButton } = useGeolocationButton(); const { pinnedButton } = usePinnedItemsButton(); // if all buttons are disabled do not show the island at all @@ -18,8 +18,8 @@ const NavigationIslandBox = (): JSX.Element | false => { !chatButton && !pinnedButton && !previousButton && - !nextButton - // && !geolocationButton + !nextButton && + !geolocationButton ) { return false; } @@ -56,12 +56,11 @@ const NavigationIslandBox = (): JSX.Element | false => { )} { // if one of the button is present, show the stack - (chatButton || pinnedButton) && ( - // || geolocationButton + (chatButton || pinnedButton || geolocationButton) && ( {chatButton} {pinnedButton} - {/* {geolocationButton} */} + {geolocationButton} ) }