ordering-ui-external 14.1.31 → 14.1.32
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.
|
@@ -358,10 +358,11 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
358
358
|
setRequiredFields(_requiredFields);
|
|
359
359
|
if (userSelected && userSelected !== null && userSelected !== void 0 && userSelected.cellphone) {
|
|
360
360
|
if (userSelected !== null && userSelected !== void 0 && userSelected.country_phone_code) {
|
|
361
|
+
var _configs$validation_p, _configs$validation_p2;
|
|
361
362
|
var phone = null;
|
|
362
363
|
phone = "+".concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.country_phone_code).concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.cellphone.replace("+".concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.country_phone_code), ''));
|
|
363
364
|
var phoneNumber = (0, _libphonenumberJs.default)(phone);
|
|
364
|
-
if (!(phoneNumber !== null && phoneNumber !== void 0 && phoneNumber.isValid())) {
|
|
365
|
+
if (parseInt((_configs$validation_p = configs === null || configs === void 0 || (_configs$validation_p2 = configs.validation_phone_number_lib) === null || _configs$validation_p2 === void 0 ? void 0 : _configs$validation_p2.value) !== null && _configs$validation_p !== void 0 ? _configs$validation_p : 1, 10) && !(phoneNumber !== null && phoneNumber !== void 0 && phoneNumber.isValid())) {
|
|
365
366
|
errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_INVALID', 'The field Phone number is invalid.'));
|
|
366
367
|
}
|
|
367
368
|
} else {
|
package/package.json
CHANGED
|
@@ -303,7 +303,7 @@ const CheckoutUI = (props) => {
|
|
|
303
303
|
let phone = null
|
|
304
304
|
phone = `+${userSelected?.country_phone_code}${userSelected?.cellphone.replace(`+${userSelected?.country_phone_code}`, '')}`
|
|
305
305
|
const phoneNumber = parsePhoneNumber(phone)
|
|
306
|
-
if (!phoneNumber?.isValid()) {
|
|
306
|
+
if (parseInt(configs?.validation_phone_number_lib?.value ?? 1, 10) && !phoneNumber?.isValid()) {
|
|
307
307
|
errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_INVALID', 'The field Phone number is invalid.'))
|
|
308
308
|
}
|
|
309
309
|
} else {
|
|
@@ -594,24 +594,24 @@ const CheckoutUI = (props) => {
|
|
|
594
594
|
|
|
595
595
|
{
|
|
596
596
|
!!(!isMultiDriverTips && driverTipsField) &&
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
597
|
+
<>
|
|
598
|
+
<DriverTipContainer>
|
|
599
|
+
<h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
|
|
600
|
+
<p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
|
|
601
|
+
<DriverTips
|
|
602
|
+
businessId={cart?.business_id}
|
|
603
|
+
driverTipsOptions={driverTipsOptions}
|
|
604
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
605
|
+
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
606
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
607
|
+
? cart?.driver_tip
|
|
608
|
+
: cart?.driver_tip_rate}
|
|
609
|
+
cart={cart}
|
|
610
|
+
useOrderContext
|
|
611
|
+
/>
|
|
612
|
+
</DriverTipContainer>
|
|
613
|
+
<DriverTipDivider />
|
|
614
|
+
</>
|
|
615
615
|
}
|
|
616
616
|
{!cartState.loading && placeSpotsEnabled && cart?.business_id && (
|
|
617
617
|
<SelectSpotContainer>
|