ordering-ui-react-native 0.12.79 → 0.12.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/src/components/BusinessesListing/index.tsx +35 -3
  3. package/src/components/BusinessesListing/styles.tsx +10 -0
  4. package/src/theme.json +3 -1
  5. package/src/utils/index.tsx +27 -0
  6. package/themes/doordash/src/components/BusinessesListing/index.tsx +33 -1
  7. package/themes/doordash/src/components/BusinessesListing/styles.tsx +11 -1
  8. package/themes/doordash/src/utils/index.tsx +27 -0
  9. package/themes/instacart/src/components/BusinessesListing/index.tsx +35 -3
  10. package/themes/instacart/src/components/BusinessesListing/styles.tsx +11 -1
  11. package/themes/instacart/src/utils/index.tsx +27 -0
  12. package/themes/original/index.tsx +2 -0
  13. package/themes/original/src/components/ActiveOrders/index.tsx +36 -16
  14. package/themes/original/src/components/ActiveOrders/styles.tsx +10 -0
  15. package/themes/original/src/components/MessageListing/index.tsx +298 -0
  16. package/themes/original/src/components/MessageListing/styles.tsx +16 -0
  17. package/themes/original/src/components/Messages/index.tsx +123 -81
  18. package/themes/original/src/components/Messages/styles.tsx +8 -0
  19. package/themes/original/src/components/UserProfile/index.tsx +10 -0
  20. package/themes/original/src/utils/index.tsx +18 -0
  21. package/themes/single-business/src/components/BusinessesListing/index.tsx +33 -0
  22. package/themes/single-business/src/components/BusinessesListing/styles.tsx +9 -0
  23. package/themes/single-business/src/utils/index.tsx +27 -0
  24. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +36 -3
  25. package/themes/uber-eats/src/components/BusinessesListing/styles.tsx +8 -0
  26. package/themes/uber-eats/src/utils/index.tsx +27 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.12.79",
3
+ "version": "0.12.80",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,6 +1,7 @@
1
- import React, {useEffect} from 'react'
1
+ import React, { useEffect, useState} from 'react'
2
2
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
3
3
  import { View, StyleSheet, ScrollView, Platform, PanResponder, I18nManager } from 'react-native'
4
+ import Geolocation from '@react-native-community/geolocation'
4
5
  import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
5
6
  import {
6
7
  BusinessList as BusinessesListingController,
@@ -13,7 +14,7 @@ import {
13
14
  useToast
14
15
  } from 'ordering-components/native'
15
16
 
16
- import { WelcomeTitle, Search, OrderControlContainer, AddressInput, WrapMomentOption } from './styles'
17
+ import { WelcomeTitle, Search, OrderControlContainer, AddressInput, WrapMomentOption, FarAwayMessage } from './styles'
17
18
 
18
19
  import NavBar from '../NavBar'
19
20
  import { SearchBar } from '../SearchBar'
@@ -24,6 +25,8 @@ import { BusinessTypeFilter } from '../BusinessTypeFilter'
24
25
  import { BusinessController } from '../BusinessController'
25
26
  import { OrderTypeSelector } from '../OrderTypeSelector'
26
27
  import { useTheme } from 'styled-components/native'
28
+ import { getDistance } from '../../utils'
29
+ import Ionicons from 'react-native-vector-icons/Ionicons'
27
30
 
28
31
  const PIXELS_TO_SCROLL = 1200
29
32
 
@@ -68,7 +71,16 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
68
71
  borderColor: theme.colors.backgroundGray,
69
72
  borderWidth: 1,
70
73
  borderRadius: 10,
71
- }
74
+ },
75
+ iconStyle: {
76
+ fontSize: 18,
77
+ color: theme.colors.warning5,
78
+ marginRight: 8
79
+ },
80
+ farAwayMsg: {
81
+ paddingVertical: 6,
82
+ paddingHorizontal: 20
83
+ }
72
84
  })
73
85
 
74
86
  const [, t] = useLanguage()
@@ -79,6 +91,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
79
91
  const [, {showToast}] = useToast()
80
92
  const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
81
93
  const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
94
+ const [isFarAway, setIsFarAway] = useState(false)
82
95
 
83
96
  const handleScroll = ({ nativeEvent }: any) => {
84
97
  const y = nativeEvent.contentOffset.y
@@ -91,6 +104,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
91
104
  }
92
105
  }
93
106
 
107
+ useEffect(() => {
108
+ Geolocation.getCurrentPosition((pos) => {
109
+ const crd = pos.coords
110
+ const distance = getDistance(crd.latitude, crd.longitude, orderState?.options?.address?.location?.lat, orderState?.options?.address?.location?.lng)
111
+ if (distance > 20) setIsFarAway(true)
112
+ else setIsFarAway(false)
113
+ }, (err) => {
114
+ console.log(`ERROR(${err.code}): ${err.message}`)
115
+ }, {
116
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
117
+ })
118
+ }, [orderState?.options?.address?.location])
119
+
94
120
  return (
95
121
  <ScrollView style={styles.container} onScroll={(e: any) => handleScroll(e)}>
96
122
  {!auth && (
@@ -162,6 +188,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
162
188
  {orderState?.options?.address?.address}
163
189
  </OText>
164
190
  </AddressInput>
191
+ {isFarAway && (
192
+ <FarAwayMessage style={styles.farAwayMsg}>
193
+ <Ionicons name='md-warning-outline' style={styles.iconStyle} />
194
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
195
+ </FarAwayMessage>
196
+ )}
165
197
  </OrderControlContainer>
166
198
  <BusinessTypeFilter
167
199
  images={props.images}
@@ -48,3 +48,13 @@ export const WrapMomentOption = styled.TouchableOpacity`
48
48
  padding: 15px 20px;
49
49
  max-width: 240px;
50
50
  `
51
+
52
+ export const FarAwayMessage = styled.View`
53
+ flex-direction: row;
54
+ align-items: center;
55
+ background-color: ${(props: any) => props.theme.colors.warning1};
56
+ margin-top: 15px;
57
+ border-radius: 7.6px;
58
+ border: 1px solid ${(props: any) => props.theme.colors.warning5};
59
+ width: 100%;
60
+ `
package/src/theme.json CHANGED
@@ -42,7 +42,9 @@
42
42
  "colorTextTutorial": "#000000",
43
43
  "toastSuccess":"#90C68E",
44
44
  "toastError":"#D83520",
45
- "toastInfo":"#6BA4FF"
45
+ "toastInfo":"#6BA4FF",
46
+ "warning5": "#FFC700",
47
+ "warning1": "#FFF4CC"
46
48
  },
47
49
  "images": {
48
50
  "logos": {
@@ -164,3 +164,30 @@ export const transformCountryCode = (countryCode : number) => {
164
164
  return parser(value)
165
165
  }
166
166
  }
167
+
168
+ /**
169
+ * Function to transform degree to radian
170
+ * @param {number} value for transform
171
+ *
172
+ */
173
+ export const convertToRadian = (value: number) => {
174
+ return value * Math.PI / 180
175
+ }
176
+
177
+ /**
178
+ * Function to distance between two locations
179
+ * @param lat1 Lat for first location
180
+ * @param lon1 Lon for first location
181
+ * @param lat2 Lat for second location
182
+ * @param lon2 Lon for second location
183
+ */
184
+ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
185
+ const R = 6371 // km
186
+ const dLat = convertToRadian(lat2 - lat1)
187
+ const dLon = convertToRadian(lon2 - lon1)
188
+ const curLat1 = convertToRadian(lat1)
189
+ const curLat2 = convertToRadian(lat2)
190
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(curLat1) * Math.cos(curLat2)
191
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
192
+ return R * c
193
+ }
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
3
+ import Geolocation from '@react-native-community/geolocation'
3
4
  import { View, StyleSheet, ScrollView, Platform, PanResponder, I18nManager, TouchableOpacity } from 'react-native'
4
5
  import {
5
6
  BusinessList as BusinessesListingController,
@@ -11,7 +12,7 @@ import {
11
12
  ToastType, useToast
12
13
  } from 'ordering-components/native'
13
14
 
14
- import { Search, AddressInput, HeaderCont, FeaturedBussiCont } from './styles'
15
+ import { Search, AddressInput, HeaderCont, FeaturedBussiCont, FarAwayMessage } from './styles'
15
16
 
16
17
  import { useTheme } from 'styled-components/native'
17
18
  import { SearchBar } from '../SearchBar'
@@ -21,6 +22,8 @@ import { NotFoundSource } from '../NotFoundSource'
21
22
  import { BusinessTypeFilter } from '../BusinessTypeFilter'
22
23
  import { BusinessController } from '../BusinessController'
23
24
  import BusinessesSortBy from '../BusinessesSortBy'
25
+ import { getDistance } from '../../utils'
26
+ import Ionicons from 'react-native-vector-icons/Ionicons'
24
27
 
25
28
  const PIXELS_TO_SCROLL = 1200
26
29
 
@@ -44,6 +47,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
44
47
 
45
48
  const [businesses, setBusinesses] = useState(businessesList?.businesses || []);
46
49
  const [hasFeatured, setHasFeatured] = useState(false);
50
+ const [isFarAway, setIsFarAway] = useState(false);
47
51
 
48
52
  const theme = useTheme();
49
53
 
@@ -75,6 +79,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
75
79
  borderColor: theme.colors.backgroundGray,
76
80
  borderWidth: 1,
77
81
  borderRadius: 40,
82
+ },
83
+ iconStyle: {
84
+ fontSize: 18,
85
+ color: theme.colors.warning5,
86
+ marginRight: 8
87
+ },
88
+ farAwayMsg: {
89
+ paddingVertical: 6,
90
+ paddingHorizontal: 20
78
91
  }
79
92
  })
80
93
 
@@ -145,6 +158,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
145
158
  }
146
159
  }, [businesses])
147
160
 
161
+ useEffect(() => {
162
+ Geolocation.getCurrentPosition((pos) => {
163
+ const crd = pos.coords
164
+ const distance = getDistance(crd.latitude, crd.longitude, orderState?.options?.address?.location?.lat, orderState?.options?.address?.location?.lng)
165
+ if (distance > 20) setIsFarAway(true)
166
+ else setIsFarAway(false)
167
+ }, (err) => {
168
+ console.log(`ERROR(${err.code}): ${err.message}`)
169
+ }, {
170
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
171
+ })
172
+ }, [orderState?.options?.address?.location])
173
+
148
174
  return (
149
175
  <ScrollView style={styles.container} onScroll={(e) => handleScroll(e)} scrollEventThrottle={50}>
150
176
  <HeaderCont>
@@ -168,6 +194,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
168
194
  </AddressInput>
169
195
  </HeaderCont>
170
196
  <View style={{ height: 1, backgroundColor: theme.colors.border, marginHorizontal: -40 }} />
197
+ {isFarAway && (
198
+ <FarAwayMessage style={styles.farAwayMsg}>
199
+ <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
201
+ </FarAwayMessage>
202
+ )}
171
203
  {!auth && (
172
204
  <Search>
173
205
  <SearchBar
@@ -55,4 +55,14 @@ export const HeaderCont = styled.View`
55
55
  export const FeaturedBussiCont = styled.ScrollView`
56
56
  min-height: 190px;
57
57
  margin-horizontal: -40px;
58
- `;
58
+ `;
59
+
60
+ export const FarAwayMessage = styled.View`
61
+ flex-direction: row;
62
+ align-items: center;
63
+ background-color: ${(props: any) => props.theme.colors.warning1};
64
+ margin-top: -5px;
65
+ border-radius: 7.6px;
66
+ border: 1px solid ${(props: any) => props.theme.colors.warning5};
67
+ width: 100%;
68
+ `
@@ -163,3 +163,30 @@ export const transformCountryCode = (countryCode : number) => {
163
163
  return parser(value)
164
164
  }
165
165
  }
166
+
167
+ /**
168
+ * Function to transform degree to radian
169
+ * @param {number} value for transform
170
+ *
171
+ */
172
+ export const convertToRadian = (value: number) => {
173
+ return value * Math.PI / 180
174
+ }
175
+
176
+ /**
177
+ * Function to distance between two locations
178
+ * @param lat1 Lat for first location
179
+ * @param lon1 Lon for first location
180
+ * @param lat2 Lat for second location
181
+ * @param lon2 Lon for second location
182
+ */
183
+ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
184
+ const R = 6371 // km
185
+ const dLat = convertToRadian(lat2 - lat1)
186
+ const dLon = convertToRadian(lon2 - lon1)
187
+ const curLat1 = convertToRadian(lat1)
188
+ const curLat2 = convertToRadian(lat2)
189
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(curLat1) * Math.cos(curLat2)
190
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
191
+ return R * c
192
+ }
@@ -1,5 +1,6 @@
1
- import React from 'react'
1
+ import React, { useState, useEffect } from 'react'
2
2
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
3
+ import Geolocation from '@react-native-community/geolocation'
3
4
  import { View, StyleSheet, ScrollView, Platform, PanResponder, I18nManager } from 'react-native'
4
5
  import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
5
6
  import {
@@ -13,7 +14,7 @@ import {
13
14
  useToast
14
15
  } from 'ordering-components/native'
15
16
 
16
- import { WelcomeTitle, Search, OrderControlContainer, AddressInput, WrapMomentOption } from './styles'
17
+ import { WelcomeTitle, Search, OrderControlContainer, AddressInput, WrapMomentOption, FarAwayMessage } from './styles'
17
18
 
18
19
  import NavBar from '../NavBar'
19
20
  import { SearchBar } from '../SearchBar'
@@ -24,6 +25,8 @@ import { BusinessTypeFilter } from '../BusinessTypeFilter'
24
25
  import { BusinessController } from '../BusinessController'
25
26
  import { OrderTypeSelector } from '../OrderTypeSelector'
26
27
  import { useTheme } from 'styled-components/native'
28
+ import { getDistance } from '../../utils'
29
+ import Ionicons from 'react-native-vector-icons/Ionicons'
27
30
 
28
31
  const PIXELS_TO_SCROLL = 1200
29
32
 
@@ -60,12 +63,22 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
60
63
  flexDirection: 'row',
61
64
  alignItems: 'center',
62
65
  marginBottom: 10,
66
+ marginTop: 10,
63
67
  zIndex: 100
64
68
  },
65
69
  borderStyle: {
66
70
  borderColor: theme.colors.backgroundGray,
67
71
  borderWidth: 1,
68
72
  borderRadius: 10,
73
+ },
74
+ iconStyle: {
75
+ fontSize: 18,
76
+ color: theme.colors.warning5,
77
+ marginRight: 8
78
+ },
79
+ farAwayMsg: {
80
+ paddingVertical: 6,
81
+ paddingHorizontal: 20
69
82
  }
70
83
  })
71
84
 
@@ -75,6 +88,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
75
88
  const [{ configs }] = useConfig()
76
89
  const [{ parseDate }] = useUtils()
77
90
  const [, { showToast }] = useToast()
91
+ const [isFarAway, setIsFarAway] = useState(false)
78
92
 
79
93
  const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
80
94
 
@@ -95,6 +109,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
95
109
  return fBusiness !== undefined && fBusiness !== null;
96
110
  }
97
111
 
112
+ useEffect(() => {
113
+ Geolocation.getCurrentPosition((pos) => {
114
+ const crd = pos.coords
115
+ const distance = getDistance(crd.latitude, crd.longitude, orderState?.options?.address?.location?.lat, orderState?.options?.address?.location?.lng)
116
+ if (distance > 20) setIsFarAway(true)
117
+ else setIsFarAway(false)
118
+ }, (err) => {
119
+ console.log(`ERROR(${err.code}): ${err.message}`)
120
+ }, {
121
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
122
+ })
123
+ }, [orderState?.options?.address?.location])
124
+
98
125
  return (
99
126
  <ScrollView style={styles.container} contentContainerStyle={{ paddingHorizontal: 40 }} onScroll={(e: any) => handleScroll(e)}>
100
127
  {!auth && (
@@ -125,7 +152,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
125
152
  {orderState?.options?.address?.address}
126
153
  </OText>
127
154
  </AddressInput>
128
-
155
+ {isFarAway && (
156
+ <FarAwayMessage style={styles.farAwayMsg}>
157
+ <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
159
+ </FarAwayMessage>
160
+ )}
129
161
  <View style={styles.wrapperOrderOptions}>
130
162
  <OrderTypeSelector configTypes={configTypes} />
131
163
  <WrapMomentOption
@@ -25,7 +25,6 @@ export const AddressInput = styled.TouchableOpacity`
25
25
  border-radius: 3px;
26
26
  align-items: center;
27
27
  padding-vertical: 4px;
28
- margin-bottom: 10px;
29
28
  flex: 1;
30
29
  width: 100%;
31
30
  z-index: -10;
@@ -50,3 +49,14 @@ export const WrapMomentOption = styled.TouchableOpacity`
50
49
  margin-start: 15px;
51
50
  min-height: 28px;
52
51
  `
52
+
53
+ export const FarAwayMessage = styled.View`
54
+ flex-direction: row;
55
+ align-items: center;
56
+ background-color: ${(props: any) => props.theme.colors.warning1};
57
+ margin-top: 0px;
58
+ margin-left: 0px;
59
+ border-radius: 7.6px;
60
+ border: 1px solid ${(props: any) => props.theme.colors.warning5};
61
+ width: 100%;
62
+ `
@@ -163,3 +163,30 @@ export const transformCountryCode = (countryCode : number) => {
163
163
  return parser(value)
164
164
  }
165
165
  }
166
+
167
+ /**
168
+ * Function to transform degree to radian
169
+ * @param {number} value for transform
170
+ *
171
+ */
172
+ export const convertToRadian = (value: number) => {
173
+ return value * Math.PI / 180
174
+ }
175
+
176
+ /**
177
+ * Function to distance between two locations
178
+ * @param lat1 Lat for first location
179
+ * @param lon1 Lon for first location
180
+ * @param lat2 Lat for second location
181
+ * @param lon2 Lon for second location
182
+ */
183
+ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
184
+ const R = 6371 // km
185
+ const dLat = convertToRadian(lat2 - lat1)
186
+ const dLon = convertToRadian(lon2 - lon1)
187
+ const curLat1 = convertToRadian(lat1)
188
+ const curLat2 = convertToRadian(lat2)
189
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(curLat1) * Math.cos(curLat2)
190
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
191
+ return R * c
192
+ }
@@ -20,6 +20,7 @@ import { BusinessMenuList } from './src/components/BusinessMenuList';
20
20
  import { UserProfileForm } from './src/components/UserProfileForm';
21
21
  import { ReviewOrder } from './src/components/ReviewOrder';
22
22
  import { UserProfile } from './src/components/UserProfile';
23
+ import { MessageListing } from './src/components/MessageListing';
23
24
  import { Help } from './src/components/Help';
24
25
  import { HelpAccountAndPayment } from './src/components/HelpAccountAndPayment';
25
26
  import { HelpGuide } from './src/components/HelpGuide';
@@ -76,6 +77,7 @@ export {
76
77
  ReviewOrder,
77
78
  BusinessMenuList,
78
79
  UserProfile,
80
+ MessageListing,
79
81
  Help,
80
82
  HelpAccountAndPayment,
81
83
  HelpGuide,
@@ -10,6 +10,7 @@ import {
10
10
  OrderInformation,
11
11
  BusinessInformation,
12
12
  Price,
13
+ UnreadMessageCounter,
13
14
  LoadMore
14
15
  } from './styles';
15
16
  import { View, StyleSheet } from 'react-native';
@@ -26,6 +27,8 @@ export const ActiveOrders = (props: ActiveOrdersParams) => {
26
27
  pagination,
27
28
  loadMoreOrders,
28
29
  getOrderStatus,
30
+ isMessageView,
31
+ handleClickOrder
29
32
  } = props;
30
33
 
31
34
  const theme = useTheme();
@@ -38,6 +41,10 @@ export const ActiveOrders = (props: ActiveOrdersParams) => {
38
41
  };
39
42
 
40
43
  const handleClickCard = (uuid: string) => {
44
+ if (isMessageView ) {
45
+ handleClickOrder(uuid)
46
+ return
47
+ }
41
48
  onNavigationRedirect &&
42
49
  onNavigationRedirect('OrderDetails', { orderId: uuid });
43
50
  };
@@ -49,15 +56,15 @@ export const ActiveOrders = (props: ActiveOrdersParams) => {
49
56
  onPress={() => handleClickCard(order?.uuid)}
50
57
  activeOpacity={0.7}>
51
58
  {/* {!!(configs?.google_maps_api_key?.value) && (
52
- <Map>
53
- <OIcon
54
- url={getGoogleMapImage(order?.business?.location, configs?.google_maps_api_key?.value)}
55
- height={100}
56
- width={320}
57
- style={{resizeMode: 'cover', borderTopRightRadius: 24, borderTopLeftRadius: 24}}
58
- />
59
- </Map>
60
- )} */}
59
+ <Map>
60
+ <OIcon
61
+ url={getGoogleMapImage(order?.business?.location, configs?.google_maps_api_key?.value)}
62
+ height={100}
63
+ width={320}
64
+ style={{resizeMode: 'cover', borderTopRightRadius: 24, borderTopLeftRadius: 24}}
65
+ />
66
+ </Map>
67
+ )} */}
61
68
  <Information>
62
69
  {!!order.business?.logo && (
63
70
  <Logo>
@@ -96,15 +103,28 @@ export const ActiveOrders = (props: ActiveOrdersParams) => {
96
103
  </OText>
97
104
  {/* )} */}
98
105
  </BusinessInformation>
99
- <Price>
100
- <OText size={12} lineHeight={18}>
101
- {parsePrice(order?.summary?.total || order?.total)}
102
- </OText>
103
- </Price>
106
+ {isMessageView ? (
107
+ <>
108
+ {order?.unread_count > 0 && (
109
+ <UnreadMessageCounter>
110
+ <OText size={12} color={theme.colors.primary} lineHeight={18} >
111
+ {order?.unread_count}
112
+ </OText>
113
+ </UnreadMessageCounter>
114
+ )}
115
+ </>
116
+ ) : (
117
+ <Price>
118
+ <OText size={12} lineHeight={18}>
119
+ {parsePrice(order?.summary?.total || order?.total)}
120
+ </OText>
121
+ </Price>
122
+ )}
123
+
104
124
  </OrderInformation>
105
125
  </Information>
106
- </Card>
107
- </React.Fragment>
126
+ </Card >
127
+ </React.Fragment >
108
128
  );
109
129
 
110
130
  return (
@@ -42,6 +42,16 @@ export const Price = styled.View`
42
42
  margin-left: 10px;
43
43
  width: 30%;
44
44
  `
45
+
46
+ export const UnreadMessageCounter = styled.View`
47
+ justify-content: center;
48
+ align-items: center;
49
+ margin-left: 10px;
50
+ width: 24px;
51
+ height: 24px;
52
+ border-radius: 7.6px;
53
+ background-color: ${(props: any) => props.theme.colors.primaryContrast};
54
+ `
45
55
  export const LoadMore = styled.View`
46
56
  flex-direction: row;
47
57
  justify-content: center;