Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/refactoring webmap hook #939

Merged
merged 8 commits into from
May 17, 2024
27 changes: 15 additions & 12 deletions packages/app/components/map/WebMap.web.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useState } from 'react';
import { MAPBOX_ACCESS_TOKEN } from '@packrat/config';
import { useWebMap } from 'app/hooks/map/useWebMap';
import useCustomStyles from 'app/hooks/useCustomStyles';
import mapboxgl from 'mapbox-gl';
import { View, Modal, Alert } from 'react-native';
import React, { useState } from 'react';
import { View } from 'react-native';
import { isPolygonOrMultiPolygon } from '../../utils/mapFunctions';
import MapButtonsOverlay from './MapButtonsOverlay';
import MapPreview from './MapPreview';
import useCustomStyles from 'app/hooks/useCustomStyles';
import { useWebMap } from 'app/hooks/map/useWebMap';
import useGpxUpload from './useGpxUpload';
import { MAPBOX_ACCESS_TOKEN } from '@packrat/config';

mapboxgl.accessToken = MAPBOX_ACCESS_TOKEN;

Expand Down Expand Up @@ -64,13 +64,16 @@ const WebMap = ({ shape: shapeProp }) => {
</View>
);

return showModal ? (
<Modal animationType={'fade'} transparent={false} visible={true}>
{element}
</Modal>
) : (
element
);
// TODO: Fix this. The modal is not working as expected.
return element;

// return showModal ? (
// <Modal animationType={'fade'} transparent={false} visible={true}>
// {element}
// </Modal>
// ) : (
// element
// );
};

const loadStyles = () => ({
Expand Down
Loading
Loading