ordering-ui-react-native 0.18.38 → 0.18.40-test
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/DriverMap/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +120 -124
- package/themes/original/src/components/AddressForm/index.tsx +7 -4
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +18 -3
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +0 -3
- package/themes/original/src/components/BusinessController/index.tsx +3 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +331 -276
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +49 -8
- package/themes/original/src/components/CartContent/index.tsx +56 -14
- package/themes/original/src/components/CartContent/styles.tsx +4 -0
- package/themes/original/src/components/Checkout/index.tsx +6 -5
- package/themes/original/src/components/GoogleMap/index.tsx +11 -2
- package/themes/original/src/components/LoginForm/index.tsx +15 -14
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -5
- package/themes/original/src/components/MyOrders/index.tsx +14 -1
- package/themes/original/src/components/NavBar/index.tsx +9 -4
- package/themes/original/src/components/OrderSummary/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/index.tsx +3 -1
- package/themes/original/src/components/ProductForm/index.tsx +23 -11
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +7 -5
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +2 -2
- package/themes/original/src/components/SignupForm/index.tsx +14 -14
- package/themes/original/src/components/SingleOrderCard/index.tsx +7 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +17 -16
- package/themes/original/src/components/UserFormDetails/index.tsx +34 -5
- package/themes/original/src/components/UserProfile/index.tsx +2 -20
- package/themes/original/src/components/UserProfileForm/index.tsx +7 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +4 -4
- package/themes/original/src/types/index.tsx +2 -2
- package/themes/original/src/utils/index.tsx +11 -0
package/package.json
CHANGED
|
@@ -453,7 +453,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
453
453
|
{order?.delivery_datetime_utc
|
|
454
454
|
? parseDate(order?.delivery_datetime_utc)
|
|
455
455
|
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
456
|
-
{` - ${order?.paymethod?.name}`}
|
|
456
|
+
{` - ${t(order?.paymethod?.name?.replace(/\s+/g, '_')?.toUpperCase(), order?.paymethod?.name)}`}
|
|
457
457
|
</OText>
|
|
458
458
|
<OText weight="bold">
|
|
459
459
|
{t('INVOICE_ORDER_NO', 'Order No.')} {order?.id}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
2
|
import { OText, OIconButton } from '../shared';
|
|
3
3
|
import { StyleSheet, View, Platform, Alert } from 'react-native';
|
|
4
4
|
import {
|
|
@@ -23,7 +23,11 @@ import { useTheme } from 'styled-components/native';
|
|
|
23
23
|
|
|
24
24
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
25
25
|
|
|
26
|
-
export const OrderSummary = ({ order, navigation, orderStatus
|
|
26
|
+
export const OrderSummary = ({ order, navigation, orderStatus, permissions,
|
|
27
|
+
askBluetoothPermission,
|
|
28
|
+
getPermissions,
|
|
29
|
+
isGrantedPermissions,
|
|
30
|
+
checkBluetoothPermission }: any) => {
|
|
27
31
|
const handleArrowBack: any = () => {
|
|
28
32
|
navigation?.canGoBack() && navigation.goBack();
|
|
29
33
|
};
|
|
@@ -48,10 +52,10 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
48
52
|
const getSuboptions = (suboptions: any) => {
|
|
49
53
|
const array: any = []
|
|
50
54
|
suboptions?.length > 0 &&
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
suboptions?.map((suboption: any) => {
|
|
56
|
+
const string = ` ${getFormattedSubOptionName(suboption)}<br/>`
|
|
57
|
+
array.push(string)
|
|
58
|
+
})
|
|
55
59
|
|
|
56
60
|
return array.join('')
|
|
57
61
|
}
|
|
@@ -60,12 +64,12 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
60
64
|
const array: any = [];
|
|
61
65
|
|
|
62
66
|
options?.length &&
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
options?.map((option: any) => {
|
|
68
|
+
const string =
|
|
69
|
+
` ${option.name}<br/>${getSuboptions(option.suboptions)}`;
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
array.push(string)
|
|
72
|
+
})
|
|
69
73
|
|
|
70
74
|
if (productComment) {
|
|
71
75
|
array.push(`${t('COMMENT', 'Comment')}<br/> ${productComment}`)
|
|
@@ -88,46 +92,38 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
88
92
|
|
|
89
93
|
${orderStatus} </br>
|
|
90
94
|
|
|
91
|
-
${t('DELIVERY_TYPE', 'Delivery Type')}: ${
|
|
92
|
-
|
|
93
|
-
}
|
|
95
|
+
${t('DELIVERY_TYPE', 'Delivery Type')}: ${deliveryStatus[order?.delivery_type]
|
|
96
|
+
}
|
|
94
97
|
</br>
|
|
95
|
-
${t('DELIVERY_DATE', 'Delivery Date')}: ${
|
|
96
|
-
order?.delivery_datetime_utc
|
|
98
|
+
${t('DELIVERY_DATE', 'Delivery Date')}: ${order?.delivery_datetime_utc
|
|
97
99
|
? parseDate(order?.delivery_datetime_utc)
|
|
98
100
|
: parseDate(order?.delivery_datetime, { utc: false })
|
|
99
|
-
|
|
101
|
+
}
|
|
100
102
|
</br>
|
|
101
103
|
${t('PAYMENT_METHOD')}: ${order?.paymethod?.name}
|
|
102
104
|
</p>
|
|
103
105
|
|
|
104
106
|
<h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
|
|
105
|
-
<p style="font-size: 27px"> ${t('FULL_NAME', 'Full Name')}: ${
|
|
106
|
-
order?.customer?.
|
|
107
|
-
|
|
108
|
-
order?.customer?.second_lastname
|
|
109
|
-
}
|
|
107
|
+
<p style="font-size: 27px"> ${t('FULL_NAME', 'Full Name')}: ${order?.customer?.name
|
|
108
|
+
} ${order?.customer?.middle_name} ${order?.customer?.lastname} ${order?.customer?.second_lastname
|
|
109
|
+
}
|
|
110
110
|
</br>
|
|
111
111
|
${t('EMAIL', 'Email')}: ${order?.customer?.email}
|
|
112
112
|
</br>
|
|
113
113
|
${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone}
|
|
114
114
|
</br>
|
|
115
|
-
${
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
: ''
|
|
121
|
-
}
|
|
115
|
+
${!!order?.customer?.phone
|
|
116
|
+
? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone
|
|
117
|
+
} </br>`
|
|
118
|
+
: ''
|
|
119
|
+
}
|
|
122
120
|
${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}
|
|
123
121
|
</br>
|
|
124
|
-
${
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
: ''
|
|
130
|
-
}
|
|
122
|
+
${!!order?.customer?.internal_number
|
|
123
|
+
? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${order?.customer?.internal_number
|
|
124
|
+
} </br>`
|
|
125
|
+
: ''
|
|
126
|
+
}
|
|
131
127
|
${t('ZIPCODE', 'Zipcode')}: ${order?.customer.zipcode}
|
|
132
128
|
</p>
|
|
133
129
|
|
|
@@ -139,30 +135,26 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
139
135
|
</br>
|
|
140
136
|
${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone}
|
|
141
137
|
</br>
|
|
142
|
-
${
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
: ''
|
|
148
|
-
}
|
|
138
|
+
${!!order?.business?.phone
|
|
139
|
+
? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone
|
|
140
|
+
} </br>`
|
|
141
|
+
: ''
|
|
142
|
+
}
|
|
149
143
|
|
|
150
144
|
${t('ADDRESS', 'Address')}: ${order?.business?.address}
|
|
151
145
|
</br>
|
|
152
|
-
${
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
: ''
|
|
158
|
-
}
|
|
146
|
+
${!!order?.business?.address_notes
|
|
147
|
+
? `${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes
|
|
148
|
+
} `
|
|
149
|
+
: ''
|
|
150
|
+
}
|
|
159
151
|
</p>
|
|
160
152
|
<h1> ${t('ORDER_DETAILS', 'Order Details')}</h1>
|
|
161
153
|
|
|
162
154
|
${order?.products.length &&
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
155
|
+
order?.products.map(
|
|
156
|
+
(product: any, i: number) =>
|
|
157
|
+
`<div style="display: flex;flexDirection:row;flex-wrap:wrap">
|
|
166
158
|
<div style="display:flex;width:100%">
|
|
167
159
|
<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
168
160
|
${product?.quantity} ${product?.name}
|
|
@@ -179,8 +171,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
179
171
|
</div>
|
|
180
172
|
</div>
|
|
181
173
|
</div>`
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
)
|
|
175
|
+
}
|
|
184
176
|
<div style="display: flex;">
|
|
185
177
|
|
|
186
178
|
<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
@@ -189,62 +181,58 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
189
181
|
|
|
190
182
|
<div style="display:flex; justify-content: flex-end; font-size: 26px; width: 30%">
|
|
191
183
|
${parsePrice(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
184
|
+
order.tax_type === 1
|
|
185
|
+
? order?.summary?.subtotal + order?.summary?.tax ?? 0
|
|
186
|
+
: order?.summary?.subtotal ?? 0,
|
|
187
|
+
)}
|
|
196
188
|
</div>
|
|
197
189
|
|
|
198
190
|
</div>
|
|
199
191
|
|
|
200
192
|
<div style="display: flex">
|
|
201
|
-
${
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
? `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
193
|
+
${order?.summary?.discount > 0
|
|
194
|
+
? order?.offer_type === 1
|
|
195
|
+
? `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
205
196
|
${t('DISCOUNT', 'Discount')} (${verifyDecimals(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
197
|
+
order?.offer_rate,
|
|
198
|
+
parsePrice,
|
|
199
|
+
)}%)
|
|
209
200
|
</div>`
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
201
|
+
: `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%"> ${t(
|
|
202
|
+
'DISCOUNT',
|
|
203
|
+
'Discount',
|
|
204
|
+
)}
|
|
214
205
|
</div>`
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
${
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
)}
|
|
206
|
+
: ''
|
|
207
|
+
}
|
|
208
|
+
${order?.summary?.discount > 0
|
|
209
|
+
? `<div style="display:flex; justify-content: flex-end; font-size: 26px; width: 30%">- ${parsePrice(
|
|
210
|
+
order?.summary?.discount,
|
|
211
|
+
)}
|
|
222
212
|
</div>`
|
|
223
|
-
|
|
224
|
-
|
|
213
|
+
: ''
|
|
214
|
+
}
|
|
225
215
|
</div>
|
|
226
216
|
|
|
227
|
-
${
|
|
228
|
-
|
|
229
|
-
? `<div style="font-size: 25px">
|
|
217
|
+
${order?.tax_type !== 1
|
|
218
|
+
? `<div style="font-size: 25px">
|
|
230
219
|
${t('TAX', 'Tax')}
|
|
231
220
|
${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%
|
|
232
221
|
${parsePrice(order?.summary?.tax ?? 0)}
|
|
233
222
|
${t('TAX', 'Tax')}
|
|
234
223
|
${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%
|
|
235
224
|
</div>`
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
${
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)}
|
|
225
|
+
: ''
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
${order?.summary?.delivery_price > 0
|
|
229
|
+
? `<div style="font-size: 25px;"> ${t(
|
|
230
|
+
'DELIVERY_FEE',
|
|
231
|
+
'Delivery Fee',
|
|
232
|
+
)}
|
|
245
233
|
</div>`
|
|
246
|
-
|
|
247
|
-
|
|
234
|
+
: ''
|
|
235
|
+
}
|
|
248
236
|
|
|
249
237
|
<div style="display: flex">
|
|
250
238
|
|
|
@@ -336,6 +324,25 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
336
324
|
},
|
|
337
325
|
});
|
|
338
326
|
|
|
327
|
+
const handlePrint = async () => {
|
|
328
|
+
if (Platform.OS === 'ios') {
|
|
329
|
+
silentPrint()
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
const _permissions = await getPermissions()
|
|
333
|
+
|
|
334
|
+
if (!isGrantedPermissions) {
|
|
335
|
+
checkBluetoothPermission()
|
|
336
|
+
}
|
|
337
|
+
if (isGrantedPermissions) {
|
|
338
|
+
const response = await askBluetoothPermission();
|
|
339
|
+
const isGranted = _permissions.reduce((allPermissions: boolean, _permission: string) => allPermissions && response?.[_permission] === 'granted', true)
|
|
340
|
+
if (isGranted) {
|
|
341
|
+
printPDF()
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
|
|
339
346
|
return (
|
|
340
347
|
<>
|
|
341
348
|
<Content>
|
|
@@ -364,17 +371,15 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
364
371
|
</OText>
|
|
365
372
|
|
|
366
373
|
<OText style={{ marginBottom: 5 }}>
|
|
367
|
-
{`${t('DELIVERY_TYPE', 'Delivery Type')}: ${
|
|
368
|
-
|
|
369
|
-
}`}
|
|
374
|
+
{`${t('DELIVERY_TYPE', 'Delivery Type')}: ${deliveryStatus[order?.delivery_type]
|
|
375
|
+
}`}
|
|
370
376
|
</OText>
|
|
371
377
|
|
|
372
378
|
<OText style={{ marginBottom: 5 }}>
|
|
373
|
-
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${
|
|
374
|
-
order?.delivery_datetime_utc
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}`}
|
|
379
|
+
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${order?.delivery_datetime_utc
|
|
380
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
381
|
+
: parseDate(order?.delivery_datetime, { utc: false })
|
|
382
|
+
}`}
|
|
378
383
|
</OText>
|
|
379
384
|
|
|
380
385
|
<OText style={{ marginBottom: 5 }}>{`${t('PAYMENT_METHOD')}: ${t(
|
|
@@ -399,11 +404,9 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
399
404
|
adjustsFontSizeToFit
|
|
400
405
|
ellipsizeMode="tail"
|
|
401
406
|
color={theme.colors.textGray}>
|
|
402
|
-
{`${t('FULL_NAME', 'Full Name')}: ${order?.customer?.name} ${
|
|
403
|
-
order?.customer?.
|
|
404
|
-
|
|
405
|
-
order?.customer?.second_lastname
|
|
406
|
-
}`}
|
|
407
|
+
{`${t('FULL_NAME', 'Full Name')}: ${order?.customer?.name} ${order?.customer?.middle_name
|
|
408
|
+
} ${order?.customer?.lastname} ${order?.customer?.second_lastname
|
|
409
|
+
}`}
|
|
407
410
|
</OText>
|
|
408
411
|
|
|
409
412
|
<OText
|
|
@@ -423,9 +426,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
423
426
|
adjustsFontSizeToFit
|
|
424
427
|
ellipsizeMode="tail"
|
|
425
428
|
color={theme.colors.textGray}>
|
|
426
|
-
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${
|
|
427
|
-
|
|
428
|
-
}`}
|
|
429
|
+
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone
|
|
430
|
+
}`}
|
|
429
431
|
</OText>
|
|
430
432
|
|
|
431
433
|
{!!order?.customer?.phone && (
|
|
@@ -436,9 +438,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
436
438
|
adjustsFontSizeToFit
|
|
437
439
|
ellipsizeMode="tail"
|
|
438
440
|
color={theme.colors.textGray}>
|
|
439
|
-
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${
|
|
440
|
-
|
|
441
|
-
}`}
|
|
441
|
+
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone
|
|
442
|
+
}`}
|
|
442
443
|
</OText>
|
|
443
444
|
)}
|
|
444
445
|
|
|
@@ -508,9 +509,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
508
509
|
numberOfLines={2}
|
|
509
510
|
ellipsizeMode="tail"
|
|
510
511
|
color={theme.colors.textGray}>
|
|
511
|
-
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${
|
|
512
|
-
|
|
513
|
-
}`}
|
|
512
|
+
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone
|
|
513
|
+
}`}
|
|
514
514
|
</OText>
|
|
515
515
|
)}
|
|
516
516
|
|
|
@@ -521,9 +521,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
521
521
|
numberOfLines={2}
|
|
522
522
|
ellipsizeMode="tail"
|
|
523
523
|
color={theme.colors.textGray}>
|
|
524
|
-
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${
|
|
525
|
-
|
|
526
|
-
}`}
|
|
524
|
+
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone
|
|
525
|
+
}`}
|
|
527
526
|
</OText>
|
|
528
527
|
)}
|
|
529
528
|
|
|
@@ -545,9 +544,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
545
544
|
adjustsFontSizeToFit
|
|
546
545
|
ellipsizeMode="tail"
|
|
547
546
|
color={theme.colors.textGray}>
|
|
548
|
-
{`${t('SPECIAL_ADDRESS', 'Special Address')}: ${
|
|
549
|
-
|
|
550
|
-
}`}
|
|
547
|
+
{`${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes
|
|
548
|
+
}`}
|
|
551
549
|
</OText>
|
|
552
550
|
)}
|
|
553
551
|
</OrderBusiness>
|
|
@@ -686,9 +684,7 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
686
684
|
|
|
687
685
|
<View style={{ marginBottom: 0 }}>
|
|
688
686
|
<FloatingButton
|
|
689
|
-
firstButtonClick={() =>
|
|
690
|
-
Platform.OS === 'ios' ? silentPrint() : printPDF()
|
|
691
|
-
}
|
|
687
|
+
firstButtonClick={() => handlePrint()}
|
|
692
688
|
btnText={t('PRINT', 'Print')}
|
|
693
689
|
color={theme.colors.green}
|
|
694
690
|
widthButton={'100%'}
|
|
@@ -122,8 +122,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
122
122
|
width: 16
|
|
123
123
|
},
|
|
124
124
|
wrapperNavbar: Platform.OS === 'ios'
|
|
125
|
-
? { paddingVertical: 0,
|
|
126
|
-
: { paddingVertical: 20,
|
|
125
|
+
? { paddingVertical: 0, paddingLeft: 40, paddingRight: 20 }
|
|
126
|
+
: { paddingVertical: 20, paddingLeft: 40, paddingRight: 20 }
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
const [, t] = useLanguage();
|
|
@@ -352,6 +352,9 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
352
352
|
map_data: { library: 'google', place_id: data.place_id },
|
|
353
353
|
zip_code: data?.zip_code || null,
|
|
354
354
|
};
|
|
355
|
+
if (googleInput?.current) {
|
|
356
|
+
googleInput?.current?.setAddressText(addressSelected.address);
|
|
357
|
+
}
|
|
355
358
|
updateChanges(addressSelected);
|
|
356
359
|
};
|
|
357
360
|
|
|
@@ -526,8 +529,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
526
529
|
onActionLeft={goToBack}
|
|
527
530
|
showCall={false}
|
|
528
531
|
btnStyle={{ paddingLeft: 0 }}
|
|
529
|
-
style={{ marginTop: Platform.OS === 'ios' ? 0 :
|
|
530
|
-
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
532
|
+
style={{ marginTop: Platform.OS === 'ios' ? 0 : 10 }}
|
|
533
|
+
titleWrapStyle={{ paddingHorizontal: 0, width: '100%' }}
|
|
531
534
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
532
535
|
/>
|
|
533
536
|
</View>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { StyleSheet, View, TouchableOpacity, Linking, Pressable } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, TouchableOpacity, Linking, Pressable, Image } from 'react-native';
|
|
3
3
|
import FastImage from 'react-native-fast-image'
|
|
4
4
|
import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
@@ -45,6 +45,7 @@ export const BusinessBasicInformation = (
|
|
|
45
45
|
const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
|
|
46
46
|
const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
|
|
47
47
|
const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
|
|
48
|
+
const [imageRealSize, setImageRealSize] = useState({ width: 16, height: 9, loading: true })
|
|
48
49
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
49
50
|
const hideLogo = theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
50
51
|
const hideDeliveryFee = theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
|
|
@@ -61,7 +62,7 @@ export const BusinessBasicInformation = (
|
|
|
61
62
|
height: 150,
|
|
62
63
|
},
|
|
63
64
|
headerStyle: {
|
|
64
|
-
|
|
65
|
+
aspectRatio: imageRealSize?.width / imageRealSize?.height
|
|
65
66
|
},
|
|
66
67
|
logoStyle: {
|
|
67
68
|
width: 72,
|
|
@@ -195,6 +196,20 @@ export const BusinessBasicInformation = (
|
|
|
195
196
|
}
|
|
196
197
|
}, [businessState?.business])
|
|
197
198
|
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
const bannerImage = header || businessState?.business?.header
|
|
201
|
+
if (!bannerImage) {
|
|
202
|
+
setImageRealSize({ width: 16, height: 9, loading: false })
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
Image.getSize(bannerImage, (width: number, height: number) => {
|
|
206
|
+
setImageRealSize({ width: width, height: height, loading: false });
|
|
207
|
+
}, (error: any) => {
|
|
208
|
+
setImageRealSize({ ...imageRealSize, loading: false });
|
|
209
|
+
console.log(error);
|
|
210
|
+
});
|
|
211
|
+
}, [header, businessState?.business?.header])
|
|
212
|
+
|
|
198
213
|
const SocialIcons = () => {
|
|
199
214
|
return (
|
|
200
215
|
<>
|
|
@@ -283,7 +298,7 @@ export const BusinessBasicInformation = (
|
|
|
283
298
|
? styles.businesInfoheaderStyle
|
|
284
299
|
: { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
|
|
285
300
|
}
|
|
286
|
-
{...(!loading && {
|
|
301
|
+
{...(!loading && !imageRealSize?.loading && {
|
|
287
302
|
source: (header || businessState?.business?.header || typeof theme?.images?.dummies?.businessHeader === 'string') ? {
|
|
288
303
|
uri: optimizeImage(businessState?.business?.header, 'h_250,c_limit') || header || theme?.images?.dummies?.businessHeader
|
|
289
304
|
} : theme?.images?.dummies?.businessHeader
|
|
@@ -8,9 +8,6 @@ export const BusinessContainer = styled.View`
|
|
|
8
8
|
export const BusinessHeader = styled.ImageBackground`
|
|
9
9
|
width: 100%;
|
|
10
10
|
position: relative;
|
|
11
|
-
max-height: 258px;
|
|
12
|
-
height: 258px;
|
|
13
|
-
resize-mode: cover;
|
|
14
11
|
`;
|
|
15
12
|
export const BusinessLogo = styled.View`
|
|
16
13
|
position: absolute;
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
ToastType
|
|
12
12
|
} from 'ordering-components/native';
|
|
13
13
|
import { OIcon, OText } from '../shared';
|
|
14
|
-
import { Dimensions, StyleSheet,
|
|
14
|
+
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
15
15
|
import { InView } from 'react-native-intersection-observer'
|
|
16
16
|
import { BusinessControllerParams } from '../../types';
|
|
17
|
-
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
|
|
17
|
+
import { convertHoursToMinutes, lightenDarkenColor, shape, vibrateApp } from '../../utils';
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
BusinessHero,
|
|
@@ -152,7 +152,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
const handleBusinessClick = (selectedBusiness: any) => {
|
|
155
|
-
|
|
155
|
+
vibrateApp()
|
|
156
156
|
if (business?.open) handleClick && handleClick(selectedBusiness)
|
|
157
157
|
else {
|
|
158
158
|
if (configState?.configs?.preorder_status_enabled?.value === '1') {
|