ordering-ui-react-native 0.19.9-release → 0.20.0-release
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 +1 -1
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +12 -12
- package/themes/original/src/components/AddressDetails/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/OrderProgress/index.tsx +12 -2
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
50
50
|
const theme = useTheme();
|
|
51
51
|
const [, t] = useLanguage();
|
|
52
52
|
const [{ parseDate }] = useUtils();
|
|
53
|
+
const paymethodsLength = order?.payment_events?.filter((item: any) => item.event === 'payment')?.length
|
|
53
54
|
|
|
54
55
|
const styles = StyleSheet.create({
|
|
55
56
|
icons: {
|
|
@@ -120,6 +121,15 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
120
121
|
? t('CURBSIDE', 'Curbside')
|
|
121
122
|
: t('DRIVER_THRU', 'Driver thru')
|
|
122
123
|
|
|
124
|
+
const handlePaymethodsListString = () => {
|
|
125
|
+
const paymethodsList = order?.payment_events?.filter((item: any) => item.event === 'payment').map((paymethod: any) => {
|
|
126
|
+
return paymethod?.wallet_event
|
|
127
|
+
? walletName[paymethod?.wallet_event?.wallet?.type]?.name
|
|
128
|
+
: t(paymethod?.paymethod?.gateway?.toUpperCase(), paymethod?.paymethod?.name)
|
|
129
|
+
})
|
|
130
|
+
return paymethodsList.join(', ')
|
|
131
|
+
}
|
|
132
|
+
|
|
123
133
|
return (
|
|
124
134
|
<>
|
|
125
135
|
{!props.isCustomView && (
|
|
@@ -283,20 +293,10 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
283
293
|
)}
|
|
284
294
|
<OText>
|
|
285
295
|
<OText size={13} weight='bold'>
|
|
286
|
-
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
296
|
+
{`${t(paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD', paymethodsLength > 1 ? 'Payment methods' : 'Payment method')}: `}
|
|
287
297
|
</OText>
|
|
288
298
|
{order?.payment_events?.length > 0 ? (
|
|
289
|
-
<OText size={13}>
|
|
290
|
-
{order?.payment_events?.map((event: any, idx: number) => {
|
|
291
|
-
return event?.wallet_event
|
|
292
|
-
? idx < order?.payment_events?.length - 1
|
|
293
|
-
? `${walletName[event?.wallet_event?.wallet?.type]?.name} - `
|
|
294
|
-
: walletName[event?.wallet_event?.wallet?.type]?.name
|
|
295
|
-
: idx < order?.payment_events?.length - 1
|
|
296
|
-
? `${t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)} - `
|
|
297
|
-
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
298
|
-
})}
|
|
299
|
-
</OText>
|
|
299
|
+
<OText size={13}>{`${handlePaymethodsListString()}`}</OText>
|
|
300
300
|
) : (
|
|
301
301
|
<OText size={13}>{t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}</OText>
|
|
302
302
|
)}
|
|
@@ -24,7 +24,7 @@ const AddressDetailsUI = (props: any) => {
|
|
|
24
24
|
|
|
25
25
|
const styles = StyleSheet.create({
|
|
26
26
|
productStyle: {
|
|
27
|
-
width
|
|
27
|
+
width,
|
|
28
28
|
height: 151,
|
|
29
29
|
marginVertical: 10
|
|
30
30
|
}
|
|
@@ -45,7 +45,7 @@ const AddressDetailsUI = (props: any) => {
|
|
|
45
45
|
</ADHeader>
|
|
46
46
|
{!!apiKey && googleMapsUrl && (
|
|
47
47
|
<ADMap
|
|
48
|
-
style={{
|
|
48
|
+
style={{ width, flex: 1, marginStart: -20, marginEnd: -20, }}>
|
|
49
49
|
<FastImage
|
|
50
50
|
style={styles.productStyle}
|
|
51
51
|
source={{
|
|
@@ -471,7 +471,7 @@ const CheckoutUI = (props: any) => {
|
|
|
471
471
|
</TopHeader>
|
|
472
472
|
</View>
|
|
473
473
|
</SafeAreaView>
|
|
474
|
-
<Container pt={0} forwardRef={containerRef} noPadding onScroll={handleScroll}>
|
|
474
|
+
<Container pt={0} forwardRef={containerRef} showsVerticalScrollIndicator={false} noPadding onScroll={handleScroll}>
|
|
475
475
|
<View style={styles.wrapperNavbar}>
|
|
476
476
|
<NavBar
|
|
477
477
|
hideArrowLeft
|
|
@@ -110,7 +110,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
110
110
|
setInitialLoaded(true)
|
|
111
111
|
}, [orderList.loading, initialLoaded])
|
|
112
112
|
|
|
113
|
-
const progressBarObjt = lastOrder?.delivery_type && lastOrder?.delivery_type === 2 ? getOrderStatuPickUp : getOrderStatus
|
|
113
|
+
const progressBarObjt = (s: any) => lastOrder?.delivery_type && lastOrder?.delivery_type === 2 ? getOrderStatuPickUp(s) : getOrderStatus(s)
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
116
|
<>
|
|
@@ -130,7 +130,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
130
130
|
<View style={styles.logoWrapper}>
|
|
131
131
|
<FastImage
|
|
132
132
|
style={{ width: 50, height: 50 }}
|
|
133
|
-
source={orderList?.orders.length === 1 ? {
|
|
133
|
+
source={orderList?.orders.length === 1 && lastOrder?.business?.logo.includes('http') ? {
|
|
134
134
|
uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
|
|
135
135
|
priority: FastImage.priority.normal,
|
|
136
136
|
} : theme.images.logos.logotype}
|
|
@@ -209,6 +209,16 @@ export const OrderProgress = (props: any) => {
|
|
|
209
209
|
pageSize: 10,
|
|
210
210
|
controlType: 'infinity'
|
|
211
211
|
},
|
|
212
|
+
propsToFetch: [
|
|
213
|
+
'id',
|
|
214
|
+
'name',
|
|
215
|
+
'business',
|
|
216
|
+
'status',
|
|
217
|
+
'delivery_type',
|
|
218
|
+
'delivery_datetime_utc',
|
|
219
|
+
'delivery_datetime',
|
|
220
|
+
'reporting_data'
|
|
221
|
+
],
|
|
212
222
|
noGiftCardOrders: true
|
|
213
223
|
}
|
|
214
224
|
|