Skip to content

Commit 43ecac9

Browse files
committed
Remove custom map styles.
1 parent 7387469 commit 43ecac9

3 files changed

Lines changed: 4 additions & 42 deletions

File tree

src/components/TasksMapView.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, {
55
useRef,
66
useState,
77
} from 'react';
8-
import { View, useColorScheme } from 'react-native';
8+
import { View } from 'react-native';
99
import MapView, { Marker, Region } from 'react-native-maps';
1010
import { connect, useSelector } from 'react-redux';
1111
import { withTranslation } from 'react-i18next';
@@ -25,7 +25,6 @@ import {
2525
BottomSheetContext,
2626
} from '@/components/ui/bottomsheet';
2727
import TasksBottomSheetContent from './TasksBottomSheetContent';
28-
import { darkMapStyle, lightMapStyle } from "../styles/mapStyles"
2928
import TaskListPolylines from './TaskListPolylines';
3029

3130
function TasksMapView(props) {
@@ -37,7 +36,6 @@ function TasksMapView(props) {
3736
uiFilters,
3837
tasksEntities,
3938
isHideUnassignedFromMap,
40-
mode = 'system',
4139
} = props;
4240

4341
const [marginBottom, setMarginBottom] = useState(1);
@@ -51,15 +49,6 @@ function TasksMapView(props) {
5149
const { handleOpen } = useContext(BottomSheetContext || {});
5250
const [modalMarkers, setModalMarkers] = useState([]);
5351

54-
55-
const colorScheme = useColorScheme();
56-
57-
const activeMode = mode === 'system' ? colorScheme : mode;
58-
59-
const mapStyle = useMemo(() => {
60-
return activeMode === 'dark' ? darkMapStyle : lightMapStyle;
61-
}, [activeMode]);
62-
6352
const onMarkerPress = useCallback(
6453
(tasksAtLocation) => {
6554
setModalMarkers(tasksAtLocation);
@@ -155,7 +144,6 @@ function TasksMapView(props) {
155144
// We use a key prop to force the map to re-render, and cleanup markers/polylines.
156145
key={mapKey}
157146
onRegionChangeComplete={onRegionChangeComplete}
158-
customMapStyle={mapStyle}
159147
ref={mapRef}
160148
style={{ flex: 1, marginBottom }}
161149
initialRegion={mapRegion || {

src/navigation/task/components/MiniMap.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import React, { useMemo } from 'react';
2-
import { LayoutChangeEvent, StyleSheet, useColorScheme } from 'react-native';
1+
import React from 'react';
2+
import { LayoutChangeEvent, StyleSheet } from 'react-native';
33
import MapView, { Marker, Polyline } from 'react-native-maps';
44
import TaskMarker from '../../../components/TaskMarker';
55
import { getCoordinates, getRegionForTasks } from './mapUtils';
66
import Task from '../../../types/task';
77
import Tasks from '../../../types/tasks';
8-
import { darkMapStyle, lightMapStyle } from "../../../styles/mapStyles"
98

109
const zoomLevel = 15;
1110

@@ -21,20 +20,9 @@ const MiniMap: React.FC<MiniMapProps> = ({
2120
tasks,
2221
onLayout,
2322
aspectRatio,
24-
mode = 'system',
2523
}) => {
26-
// @see https://stackoverflow.com/questions/46568465/convert-a-region-latitudedelta-longitudedelta-into-an-approximate-zoomlevel/
27-
const systemScheme = useColorScheme();
28-
29-
const activeMode = useMemo(() => {
30-
if (mode === 'system') return systemScheme ?? 'light';
31-
return mode;
32-
}, [mode, systemScheme]);
33-
34-
const mapStyle = useMemo(() => {
35-
return activeMode === 'dark' ? darkMapStyle : lightMapStyle;
36-
}, [activeMode]);
3724

25+
// @see https://stackoverflow.com/questions/46568465/convert-a-region-latitudedelta-longitudedelta-into-an-approximate-zoomlevel/
3826
const region = getRegionForTasks(
3927
task ? [task] : tasks,
4028
zoomLevel,
@@ -64,7 +52,6 @@ const MiniMap: React.FC<MiniMapProps> = ({
6452

6553
return (
6654
<MapView
67-
customMapStyle={mapStyle}
6855
style={styles.map}
6956
zoomEnabled
7057
showsUserLocation

src/styles/mapStyles.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)