Skip to content

Commit

Permalink
Remove directions button from map
Browse files Browse the repository at this point in the history
  • Loading branch information
devcshort committed Feb 1, 2024
1 parent 8b1e51a commit 8117868
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions packages/client/plugins/mapbox/components/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useEffect, useMemo, useRef } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { Stack, Title, useMantineTheme, Text, Group } from '@mantine/core';
import { useAppConfig } from '../../../lib/hooks/useAppConfig';
import { IconNavigation, IconPhone, IconWorldWww } from '@tabler/icons-react';
import { IconPhone, IconWorldWww } from '@tabler/icons-react';
import { useRouter } from 'next/router';
import 'mapbox-gl/dist/mapbox-gl.css';
import { useTranslation } from 'next-i18next';
Expand Down Expand Up @@ -71,11 +71,6 @@ export function MapComponent({ locations = [] }: Props) {
if (!map.current) return;

const bounds = new LngLatBounds();
const coords = ((router.query?.coords as string) ?? '')
.split(',')
.slice()
.reverse()
.join(',');

// remove all current markers
markers.current.forEach((marker) => marker.remove());
Expand Down Expand Up @@ -142,27 +137,6 @@ export function MapComponent({ locations = [] }: Props) {
{t('call_to_action.view_website')}
</Group>
</ReferralButton>

<ReferralButton
referralType="directions_referral"
resourceId={resource._id}
resource={resource}
disabled={!coords || !resource?.location?.coordinates}
href={`https://www.google.com/maps/dir/?api=1&origin=${coords}&destination=${(
resource?.location?.coordinates ?? []
)
.slice()
.reverse()
.join(',')}`}
target="_blank"
size="xs"
miw={130}
>
<Group noWrap spacing={theme.spacing.xs}>
<IconNavigation size={theme.fontSizes.md} />
{t('call_to_action.get_directions')}
</Group>
</ReferralButton>
</Group>
</Stack>
)
Expand Down

0 comments on commit 8117868

Please sign in to comment.