Skip to content

Commit

Permalink
fix: add geolocation button back (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Jun 21, 2024
1 parent 9879a51 commit 4b72b5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/island.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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: {} });
Expand Down
13 changes: 6 additions & 7 deletions src/modules/navigationIsland/NavigationIsland.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ 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
if (
!chatButton &&
!pinnedButton &&
!previousButton &&
!nextButton
// && !geolocationButton
!nextButton &&
!geolocationButton
) {
return false;
}
Expand Down Expand Up @@ -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) && (
<Stack direction="row" gap={1}>
{chatButton}
{pinnedButton}
{/* {geolocationButton} */}
{geolocationButton}
</Stack>
)
}
Expand Down

0 comments on commit 4b72b5b

Please sign in to comment.