Skip to content

Commit bd3fadb

Browse files
Bump async from 2.6.3 to 2.6.4
1 parent 70022d7 commit bd3fadb

12 files changed

Lines changed: 6872 additions & 6872 deletions

File tree

.gitignore

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
node_modules/
2-
.expo/
3-
npm-debug.*
4-
*.jks
5-
*.p8
6-
*.p12
7-
*.key
8-
*.mobileprovision
9-
*.orig.*
10-
web-build/
11-
12-
# macOS
13-
.DS_Store
14-
15-
.env
1+
node_modules/
2+
.expo/
3+
npm-debug.*
4+
*.jks
5+
*.p8
6+
*.p12
7+
*.key
8+
*.mobileprovision
9+
*.orig.*
10+
web-build/
11+
12+
# macOS
13+
.DS_Store
14+
15+
config.bat

app.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
{
2-
"expo": {
3-
"name": "uber-clone",
4-
"slug": "uber-clone",
5-
"version": "1.0.0",
6-
"orientation": "portrait",
7-
"icon": "./assets/icon.png",
8-
"splash": {
9-
"image": "./assets/splash.png",
10-
"resizeMode": "contain",
11-
"backgroundColor": "#ffffff"
12-
},
13-
"updates": {
14-
"fallbackToCacheTimeout": 0
15-
},
16-
"assetBundlePatterns": [
17-
"**/*"
18-
],
19-
"ios": {
20-
"supportsTablet": true
21-
},
22-
"android": {
23-
"adaptiveIcon": {
24-
"foregroundImage": "./assets/adaptive-icon.png",
25-
"backgroundColor": "#FFFFFF"
26-
}
27-
},
28-
"web": {
29-
"favicon": "./assets/favicon.png"
30-
}
31-
}
32-
}
1+
{
2+
"expo": {
3+
"name": "uber-clone",
4+
"slug": "uber-clone",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"splash": {
9+
"image": "./assets/splash.png",
10+
"resizeMode": "contain",
11+
"backgroundColor": "#ffffff"
12+
},
13+
"updates": {
14+
"fallbackToCacheTimeout": 0
15+
},
16+
"assetBundlePatterns": [
17+
"**/*"
18+
],
19+
"ios": {
20+
"supportsTablet": true
21+
},
22+
"android": {
23+
"adaptiveIcon": {
24+
"foregroundImage": "./assets/adaptive-icon.png",
25+
"backgroundColor": "#FFFFFF"
26+
}
27+
},
28+
"web": {
29+
"favicon": "./assets/favicon.png"
30+
}
31+
}
32+
}

app/components/Map.js

Lines changed: 117 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,117 @@
1-
import React, { useRef, useEffect } from 'react'
2-
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
3-
import MapView, { Marker } from 'react-native-maps'
4-
import { useDispatch, useSelector } from 'react-redux'
5-
import tailwind from 'tailwind-react-native-classnames'
6-
import { selectDestination, selectOrigin, setTravelTimeInformation } from '../redux/slices/navSlice'
7-
import MapViewDirections from 'react-native-maps-directions'
8-
import { GOOGLE_MAP_APIKEY } from '@env'
9-
import { Icon } from 'react-native-elements'
10-
import Constants from 'expo-constants'
11-
import { useNavigation } from '@react-navigation/native'
12-
13-
const Map = () => {
14-
const origin = useSelector(selectOrigin)
15-
const destination = useSelector(selectDestination)
16-
const mapRef = useRef(null)
17-
const navigation = useNavigation()
18-
const dispatch = useDispatch()
19-
20-
useEffect(() => {
21-
if (!origin || !destination) return;
22-
mapRef.current.fitToSuppliedMarkers(['origin', 'destination'], {
23-
edgePadding: { top: 50, right: 50, bottom: 50, left: 50 }
24-
})
25-
}, [origin, destination])
26-
27-
useEffect(() => {
28-
if(!origin || !destination) return;
29-
getTravelTime()
30-
}, [origin, destination, GOOGLE_MAP_APIKEY])
31-
32-
const getTravelTime = async () => {
33-
const URL = `https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=${origin.description}&destinations=${destination.description}&key=${GOOGLE_MAP_APIKEY}`
34-
const data = await fetch(URL).then(response => response.json())
35-
if(data.status !== 'OK') return alert(data.error_message)
36-
dispatch(setTravelTimeInformation(data.rows[0].elements[0]))
37-
}
38-
39-
return (
40-
<View style={tailwind`flex-1 relative`}>
41-
<TouchableOpacity
42-
style={[ tailwind`bg-white p-3 rounded-full shadow-lg`,{ top: Constants.statusBarHeight, left: 20, position: 'absolute', zIndex: 100 }]}
43-
onPress={() => navigation.push("Home")}
44-
>
45-
<Icon
46-
type="antdesign"
47-
name="home"
48-
color="black"
49-
size={16}
50-
// style={}
51-
/>
52-
</TouchableOpacity>
53-
54-
<MapView
55-
ref={mapRef}
56-
style={tailwind`flex-1 relative z-10`}
57-
initialRegion={{
58-
latitude: origin?.loaction.lat,
59-
longitude: origin?.loaction.lng,
60-
latitudeDelta: 0.005,
61-
longitudeDelta: 0.005,
62-
}}
63-
mapType="mutedStandard"
64-
>
65-
{!!origin && !!destination && (
66-
<MapViewDirections
67-
// origin={{
68-
// latitude: origin?.loaction.lat,
69-
// longitude: origin?.loaction.lng,
70-
// }}
71-
// destination={{
72-
// latitude: destination?.loaction.lat,
73-
// longitude: destination?.loaction.lng,
74-
// }}
75-
origin={origin.description}
76-
destination={destination.description}
77-
lineDashPattern={[0]}
78-
apikey={GOOGLE_MAP_APIKEY}
79-
strokeWidth={3}
80-
strokeColor="black"
81-
onError={error => console.log("Directions error: ", error)}
82-
/>
83-
)}
84-
{origin?.loaction && (
85-
<Marker
86-
coordinate={{
87-
latitude: origin?.loaction.lat,
88-
longitude: origin?.loaction.lng,
89-
}}
90-
title="Origin"
91-
description={origin.description}
92-
identifier="origin"
93-
>
94-
<Image source={require('../assets/custom_pin.png')} style={{ height: 45, width: 45 }} />
95-
</Marker>
96-
)}
97-
{destination?.loaction && (
98-
<Marker
99-
coordinate={{
100-
latitude: destination?.loaction.lat,
101-
longitude: destination?.loaction.lng,
102-
}}
103-
title="Destination"
104-
description={destination.description}
105-
identifier="destination"
106-
>
107-
<Image source={require('../assets/custom_pin.png')} style={{ height: 45, width: 45 }} />
108-
</Marker>
109-
)}
110-
</MapView>
111-
</View>
112-
)
113-
}
114-
115-
export default Map
116-
117-
const styles = StyleSheet.create({})
1+
import React, { useRef, useEffect } from 'react'
2+
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
3+
import MapView, { Marker } from 'react-native-maps'
4+
import { useDispatch, useSelector } from 'react-redux'
5+
import tailwind from 'tailwind-react-native-classnames'
6+
import { selectDestination, selectOrigin, setTravelTimeInformation } from '../redux/slices/navSlice'
7+
import MapViewDirections from 'react-native-maps-directions'
8+
import { GOOGLE_MAP_APIKEY } from '@env'
9+
import { Icon } from 'react-native-elements'
10+
import Constants from 'expo-constants'
11+
import { useNavigation } from '@react-navigation/native'
12+
13+
const Map = () => {
14+
const origin = useSelector(selectOrigin)
15+
const destination = useSelector(selectDestination)
16+
const mapRef = useRef(null)
17+
const navigation = useNavigation()
18+
const dispatch = useDispatch()
19+
20+
useEffect(() => {
21+
if (!origin || !destination) return;
22+
mapRef.current.fitToSuppliedMarkers(['origin', 'destination'], {
23+
edgePadding: { top: 50, right: 50, bottom: 50, left: 50 }
24+
})
25+
}, [origin, destination])
26+
27+
useEffect(() => {
28+
if(!origin || !destination) return;
29+
getTravelTime()
30+
}, [origin, destination, GOOGLE_MAP_APIKEY])
31+
32+
const getTravelTime = async () => {
33+
const URL = `https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=${origin.description}&destinations=${destination.description}&key=${GOOGLE_MAP_APIKEY}`
34+
const data = await fetch(URL).then(response => response.json())
35+
if(data.status !== 'OK') return alert(data.error_message)
36+
dispatch(setTravelTimeInformation(data.rows[0].elements[0]))
37+
}
38+
39+
return (
40+
<View style={tailwind`flex-1 relative`}>
41+
<TouchableOpacity
42+
style={[ tailwind`bg-white p-3 rounded-full shadow-lg`,{ top: Constants.statusBarHeight, left: 20, position: 'absolute', zIndex: 100 }]}
43+
onPress={() => navigation.push("Home")}
44+
>
45+
<Icon
46+
type="antdesign"
47+
name="home"
48+
color="black"
49+
size={16}
50+
// style={}
51+
/>
52+
</TouchableOpacity>
53+
54+
<MapView
55+
ref={mapRef}
56+
style={tailwind`flex-1 relative z-10`}
57+
initialRegion={{
58+
latitude: origin?.loaction.lat,
59+
longitude: origin?.loaction.lng,
60+
latitudeDelta: 0.005,
61+
longitudeDelta: 0.005,
62+
}}
63+
mapType="mutedStandard"
64+
>
65+
{!!origin && !!destination && (
66+
<MapViewDirections
67+
// origin={{
68+
// latitude: origin?.loaction.lat,
69+
// longitude: origin?.loaction.lng,
70+
// }}
71+
// destination={{
72+
// latitude: destination?.loaction.lat,
73+
// longitude: destination?.loaction.lng,
74+
// }}
75+
origin={origin.description}
76+
destination={destination.description}
77+
lineDashPattern={[0]}
78+
apikey={GOOGLE_MAP_APIKEY}
79+
strokeWidth={3}
80+
strokeColor="black"
81+
onError={error => console.log("Directions error: ", error)}
82+
/>
83+
)}
84+
{origin?.loaction && (
85+
<Marker
86+
coordinate={{
87+
latitude: origin?.loaction.lat,
88+
longitude: origin?.loaction.lng,
89+
}}
90+
title="Origin"
91+
description={origin.description}
92+
identifier="origin"
93+
>
94+
<Image source={require('../assets/custom_pin.png')} style={{ height: 45, width: 45 }} />
95+
</Marker>
96+
)}
97+
{destination?.loaction && (
98+
<Marker
99+
coordinate={{
100+
latitude: destination?.loaction.lat,
101+
longitude: destination?.loaction.lng,
102+
}}
103+
title="Destination"
104+
description={destination.description}
105+
identifier="destination"
106+
>
107+
<Image source={require('../assets/custom_pin.png')} style={{ height: 45, width: 45 }} />
108+
</Marker>
109+
)}
110+
</MapView>
111+
</View>
112+
)
113+
}
114+
115+
export default Map
116+
117+
const styles = StyleSheet.create({})

0 commit comments

Comments
 (0)