Skip to content

Commit

Permalink
Merge pull request #939 from andrew-bierman/fix/refactoring-webmap-hook
Browse files Browse the repository at this point in the history
Fix/refactoring webmap hook
  • Loading branch information
andrew-bierman authored May 17, 2024
2 parents f2a7370 + 8c416bc commit a2e9fc0
Show file tree
Hide file tree
Showing 2 changed files with 269 additions and 197 deletions.
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

0 comments on commit a2e9fc0

Please sign in to comment.