ordering-ui-react-native 0.18.41 → 0.18.43
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.
package/package.json
CHANGED
|
@@ -36,10 +36,11 @@ export const OrderEta = (props: any) => {
|
|
|
36
36
|
if (diffTimeAsMinutes <= 0) {
|
|
37
37
|
totalEta += (Math.floor(Math.abs(diffTimeAsMinutes / order?.eta_current_status_time) + 1) * order?.eta_current_status_penalty_time)
|
|
38
38
|
}
|
|
39
|
-
_estimatedTime =
|
|
39
|
+
_estimatedTime = moment.utc(_delivery).add(totalEta, 'minutes')
|
|
40
40
|
} else {
|
|
41
|
-
_estimatedTime =
|
|
41
|
+
_estimatedTime = moment.utc(_delivery).add(order?.eta_time, 'minutes')
|
|
42
42
|
}
|
|
43
|
+
_estimatedTime = outputFormat ? moment(_estimatedTime).format(outputFormat) : parseDate(_estimatedTime, { utc: false })
|
|
43
44
|
setEstimatedDeliveryTime(_estimatedTime)
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -49,11 +50,11 @@ export const OrderEta = (props: any) => {
|
|
|
49
50
|
getEstimatedDeliveryTime()
|
|
50
51
|
}, 1000)
|
|
51
52
|
return () => clearInterval(interval)
|
|
52
|
-
}, [order])
|
|
53
|
+
}, [order, outputFormat])
|
|
53
54
|
|
|
54
55
|
return (
|
|
55
56
|
<>
|
|
56
|
-
{
|
|
57
|
+
{estimatedDeliveryTime}
|
|
57
58
|
</>
|
|
58
59
|
)
|
|
59
60
|
}
|
|
@@ -121,7 +121,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
121
121
|
const mapValidStatuses = [9, 19, 23]
|
|
122
122
|
const placeSpotTypes = [3, 4, 5]
|
|
123
123
|
const directionTypes = [2, 3, 4, 5]
|
|
124
|
-
const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
|
|
124
|
+
const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
|
|
125
125
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
126
126
|
const isGiftCardOrder = !order?.business_id
|
|
127
127
|
const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
useOrder,
|
|
6
6
|
useLanguage
|
|
7
7
|
} from 'ordering-components/native';
|
|
8
|
+
import FastImage from 'react-native-fast-image'
|
|
8
9
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
9
10
|
import { useTheme } from 'styled-components/native';
|
|
10
11
|
import { OIcon, OText, OButton } from '../shared';
|
|
@@ -231,10 +232,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
231
232
|
key={business?.id}
|
|
232
233
|
style={styles.logoWrapper}
|
|
233
234
|
>
|
|
234
|
-
<
|
|
235
|
-
url={optimizeImage(business?.logo, 'h_300,c_limit')}
|
|
236
|
-
src={optimizeImage(!business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
|
|
235
|
+
<FastImage
|
|
237
236
|
style={styles.minilogo}
|
|
237
|
+
source={business?.logo ? {
|
|
238
|
+
uri: optimizeImage(business?.logo, 'h_300,c_limit'),
|
|
239
|
+
priority: FastImage.priority.normal,
|
|
240
|
+
} : theme?.images?.dummies?.businessLogo}
|
|
241
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
238
242
|
/>
|
|
239
243
|
</Logo>
|
|
240
244
|
))}
|
|
@@ -244,10 +248,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
244
248
|
</MultiLogosContainer>
|
|
245
249
|
) : (
|
|
246
250
|
<Logo style={styles.logoWrapper}>
|
|
247
|
-
<
|
|
248
|
-
url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
|
|
249
|
-
src={optimizeImage(!order.business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
|
|
251
|
+
<FastImage
|
|
250
252
|
style={styles.logo}
|
|
253
|
+
source={order.business?.logo ? {
|
|
254
|
+
uri: optimizeImage(order.business?.logo, 'h_300,c_limit'),
|
|
255
|
+
priority: FastImage.priority.normal,
|
|
256
|
+
} : theme?.images?.dummies?.businessLogo}
|
|
257
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
251
258
|
/>
|
|
252
259
|
</Logo>
|
|
253
260
|
)}
|
|
@@ -296,7 +303,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
296
303
|
</OText>
|
|
297
304
|
</TouchableOpacity>
|
|
298
305
|
)}
|
|
299
|
-
{!hideReorderButton && order?.id === 'number' && (
|
|
306
|
+
{!hideReorderButton && typeof order?.id === 'number' && (
|
|
300
307
|
<OButton
|
|
301
308
|
text={t('REORDER', 'Reorder')}
|
|
302
309
|
imgRightSrc={''}
|