ordering-ui-external 14.1.34 → 14.1.35
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/_bundles/{0.ordering-ui.2b1fe991b2c45ea68382.js → 0.ordering-ui.7c3ac8ece68a78750046.js} +1 -1
- package/_bundles/{7.ordering-ui.2b1fe991b2c45ea68382.js → 7.ordering-ui.7c3ac8ece68a78750046.js} +1 -1
- package/_bundles/{ordering-ui.2b1fe991b2c45ea68382.js → ordering-ui.7c3ac8ece68a78750046.js} +2 -2
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +30 -17
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +30 -19
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +28 -13
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +30 -17
- /package/_bundles/{1.ordering-ui.2b1fe991b2c45ea68382.js → 1.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{2.ordering-ui.2b1fe991b2c45ea68382.js → 2.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{4.ordering-ui.2b1fe991b2c45ea68382.js → 4.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{5.ordering-ui.2b1fe991b2c45ea68382.js → 5.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{6.ordering-ui.2b1fe991b2c45ea68382.js → 6.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{7.ordering-ui.2b1fe991b2c45ea68382.js.LICENSE.txt → 7.ordering-ui.7c3ac8ece68a78750046.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.2b1fe991b2c45ea68382.js → 8.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{9.ordering-ui.2b1fe991b2c45ea68382.js → 9.ordering-ui.7c3ac8ece68a78750046.js} +0 -0
- /package/_bundles/{ordering-ui.2b1fe991b2c45ea68382.js.LICENSE.txt → ordering-ui.7c3ac8ece68a78750046.js.LICENSE.txt} +0 -0
|
@@ -37,7 +37,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
37
37
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
38
38
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
39
|
var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
40
|
-
var _orderState$options, _ref, _userCustomer$country, _userCustomer$address, _configState$configs, _userCustomer$name, _orderState$options5, _orderState$options8, _orderState$options9, _theme$images2, _theme$images3, _orderState$options12, _orderState$options13, _orderState$options15, _orderState$options16, _theme$colors, _theme$
|
|
40
|
+
var _orderState$options, _ref, _userCustomer$country, _userCustomer$address, _configState$configs, _userCustomer$name, _orderState$options5, _orderState$options8, _orderState$options9, _theme$images2, _theme$images3, _theme$images4, _orderState$options12, _orderState$options13, _orderState$options15, _orderState$options16, _theme$colors, _theme$images5, _customerState$result, _customerState$result2;
|
|
41
41
|
var phone = props.phone,
|
|
42
42
|
customerState = props.customerState,
|
|
43
43
|
customersPhones = props.customersPhones,
|
|
@@ -57,7 +57,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
57
57
|
franchiseId = props.franchiseId,
|
|
58
58
|
getUsers = props.getUsers;
|
|
59
59
|
var allOrderTypes = [1, 2, 3, 4, 5];
|
|
60
|
-
var pickupTypes = [2,
|
|
60
|
+
var pickupTypes = [2, 4, 5];
|
|
61
|
+
var eatInType = 3;
|
|
61
62
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
62
63
|
_useOrder2 = _slicedToArray(_useOrder, 2),
|
|
63
64
|
orderState = _useOrder2[0],
|
|
@@ -90,10 +91,10 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
90
91
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
91
92
|
isAddressFormOpen = _useState6[0],
|
|
92
93
|
setIsAddressFormOpen = _useState6[1];
|
|
93
|
-
var _useState7 = (0, _react.useState)(
|
|
94
|
+
var _useState7 = (0, _react.useState)(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type),
|
|
94
95
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
orderTypeSelected = _useState8[0],
|
|
97
|
+
setOrderTypeSelected = _useState8[1];
|
|
97
98
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
98
99
|
var _useState9 = (0, _react.useState)((_ref = urlPhone !== null && urlPhone !== void 0 ? urlPhone : userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.cellphone) !== null && _ref !== void 0 ? _ref : ''),
|
|
99
100
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
@@ -156,9 +157,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
156
157
|
var handleChangeType = function handleChangeType(value) {
|
|
157
158
|
if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
|
|
158
159
|
changeType(value);
|
|
159
|
-
|
|
160
|
-
setIsPickupSelected(false);
|
|
161
|
-
}
|
|
160
|
+
setOrderTypeSelected(value);
|
|
162
161
|
}
|
|
163
162
|
};
|
|
164
163
|
(0, _react.useEffect)(function () {
|
|
@@ -264,7 +263,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
264
263
|
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
265
264
|
})) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
|
|
266
265
|
handleChangeType(firstEnabledPickupType);
|
|
267
|
-
|
|
266
|
+
setOrderTypeSelected(firstEnabledPickupType);
|
|
268
267
|
};
|
|
269
268
|
var handleDeleteUser = function handleDeleteUser() {
|
|
270
269
|
deleteUserCustomer(true);
|
|
@@ -352,7 +351,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
352
351
|
}, [urlPhone, customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.loading]);
|
|
353
352
|
(0, _react.useEffect)(function () {
|
|
354
353
|
var _orderState$options4;
|
|
355
|
-
|
|
354
|
+
setOrderTypeSelected(orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type);
|
|
356
355
|
}, [orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type]);
|
|
357
356
|
(0, _react.useEffect)(function () {
|
|
358
357
|
var _orderState$options6, _orderState$options7;
|
|
@@ -369,7 +368,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
369
368
|
}, [userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id, orderState === null || orderState === void 0 ? void 0 : orderState.loading]);
|
|
370
369
|
var OrderTypesComponent = function OrderTypesComponent() {
|
|
371
370
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
|
|
372
|
-
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value
|
|
371
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && pickupTypes.includes(type === null || type === void 0 ? void 0 : type.value);
|
|
373
372
|
}) : orderTypes).map(function (item, i) {
|
|
374
373
|
var _orderState$options10, _orderState$options11;
|
|
375
374
|
return /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
@@ -388,9 +387,9 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
388
387
|
return handleChangeType(1);
|
|
389
388
|
},
|
|
390
389
|
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
391
|
-
activated:
|
|
390
|
+
activated: orderTypeSelected === 1
|
|
392
391
|
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
393
|
-
activated:
|
|
392
|
+
activated: orderTypeSelected === 1
|
|
394
393
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
395
394
|
src: theme === null || theme === void 0 || (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.deliveryIco,
|
|
396
395
|
width: 20,
|
|
@@ -399,17 +398,31 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
399
398
|
return pickupTypes.includes(type);
|
|
400
399
|
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
401
400
|
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
402
|
-
activated:
|
|
401
|
+
activated: pickupTypes.includes(orderTypeSelected),
|
|
403
402
|
onClick: function onClick() {
|
|
404
403
|
return handleChangeToPickup();
|
|
405
404
|
}
|
|
406
405
|
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
407
|
-
activated:
|
|
406
|
+
activated: pickupTypes.includes(orderTypeSelected)
|
|
408
407
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
409
408
|
src: theme === null || theme === void 0 || (_theme$images3 = theme.images) === null || _theme$images3 === void 0 || (_theme$images3 = _theme$images3.general) === null || _theme$images3 === void 0 ? void 0 : _theme$images3.pickupIco,
|
|
410
409
|
width: 22,
|
|
411
410
|
height: 22
|
|
412
|
-
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup')))
|
|
411
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup'))), configTypes.some(function (type) {
|
|
412
|
+
return eatInType === type;
|
|
413
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
414
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
415
|
+
activated: orderTypeSelected === 3,
|
|
416
|
+
onClick: function onClick() {
|
|
417
|
+
return handleChangeType(3);
|
|
418
|
+
}
|
|
419
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
420
|
+
activated: orderTypeSelected === 3
|
|
421
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
422
|
+
src: theme === null || theme === void 0 || (_theme$images4 = theme.images) === null || _theme$images4 === void 0 || (_theme$images4 = _theme$images4.general) === null || _theme$images4 === void 0 ? void 0 : _theme$images4.eatinIco,
|
|
423
|
+
width: 22,
|
|
424
|
+
height: 22
|
|
425
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('EAT_IN', 'Eat in')))), pickupTypes.includes(orderTypeSelected) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')), /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesContainer, null, /*#__PURE__*/_react.default.createElement(OrderTypesComponent, null))), configTypes.includes(orderState === null || orderState === void 0 || (_orderState$options12 = orderState.options) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.type) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.PhoneAutocompleteContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('ADDING_CUSTOMERS_PHONE_NUMBER', 'Adding the customers’ phone number')), /*#__PURE__*/_react.default.createElement(_styles.WrappBtn, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
413
426
|
color: inputValue || userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options13 = orderState.options) !== null && _orderState$options13 !== void 0 && (_orderState$options13 = _orderState$options13.address) !== null && _orderState$options13 !== void 0 && _orderState$options13.address ? 'primary' : 'secundary',
|
|
414
427
|
onMouseDown: function onMouseDown() {
|
|
415
428
|
var _orderState$options14;
|
|
@@ -448,7 +461,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
448
461
|
},
|
|
449
462
|
color: "primary"
|
|
450
463
|
}, t('CONTINUE', 'Continue'))))))), /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, {
|
|
451
|
-
bgimage: theme === null || theme === void 0 || (_theme$
|
|
464
|
+
bgimage: theme === null || theme === void 0 || (_theme$images5 = theme.images) === null || _theme$images5 === void 0 || (_theme$images5 = _theme$images5.general) === null || _theme$images5 === void 0 ? void 0 : _theme$images5.phoneHero
|
|
452
465
|
})), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
453
466
|
open: openModal.signup,
|
|
454
467
|
width: "80%",
|
|
@@ -53,7 +53,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
53
53
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
54
54
|
var PIXELS_TO_SCROLL = 300;
|
|
55
55
|
var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
56
|
-
var _orderState$options, _citiesState$cities, _ref, _theme$business_listi, _orderState$options2, _theme$business_listi2, _theme$business_listi3, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _businessesList$busin, _theme$header, _orderState$options3, _orderState$options4, _configs$order_types_, _businessesList$busin4, _orderState$options8, _orderState$options10, _configs$business_lis, _configs$business_lis2, _configs$business_lis3, _theme$images2, _theme$business_listi8, _orderState$options13, _theme$images3, _theme$images4, _configs$business_lis4, _theme$
|
|
56
|
+
var _orderState$options, _citiesState$cities, _ref, _theme$business_listi, _orderState$options2, _theme$business_listi2, _theme$business_listi3, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _businessesList$busin, _theme$header, _orderState$options3, _orderState$options4, _configs$order_types_, _businessesList$busin4, _orderState$options8, _orderState$options10, _configs$business_lis, _configs$business_lis2, _configs$business_lis3, _theme$images2, _theme$business_listi8, _orderState$options13, _theme$images3, _theme$images4, _theme$images5, _configs$business_lis4, _theme$images6, _theme$business_listi9, _citiesState$cities5, _citiesState$cities6, _orderState$options15, _configs$advanced_bus2, _citiesState$cities7, _citiesState$cities8, _orderState$options17, _businessesList$busin6, _businessesList$busin7, _orderState$options20;
|
|
57
57
|
var businessesList = props.businessesList,
|
|
58
58
|
paginationProps = props.paginationProps,
|
|
59
59
|
searchValue = props.searchValue,
|
|
@@ -72,7 +72,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
72
72
|
actualSlug = props.actualSlug,
|
|
73
73
|
orderTypes = props.orderTypes;
|
|
74
74
|
var allOrderTypes = [1, 2, 3, 4, 5];
|
|
75
|
-
var pickupTypes = [2,
|
|
75
|
+
var pickupTypes = [2, 4, 5];
|
|
76
|
+
var eatInType = 3;
|
|
76
77
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
77
78
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
78
79
|
t = _useLanguage2[1];
|
|
@@ -125,10 +126,10 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
125
126
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
126
127
|
hasHighRatedBusiness = _useState14[0],
|
|
127
128
|
setHasHighRatedBusiness = _useState14[1];
|
|
128
|
-
var _useState15 = (0, _react.useState)(
|
|
129
|
+
var _useState15 = (0, _react.useState)(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type),
|
|
129
130
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
orderTypeSelected = _useState16[0],
|
|
132
|
+
setOrderTypeSelected = _useState16[1];
|
|
132
133
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
133
134
|
var _useState17 = (0, _react.useState)([]),
|
|
134
135
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
@@ -227,9 +228,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
227
228
|
var handleChangeType = function handleChangeType(value) {
|
|
228
229
|
if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
|
|
229
230
|
changeType(value);
|
|
230
|
-
|
|
231
|
-
setIsPickupSelected(false);
|
|
232
|
-
}
|
|
231
|
+
setOrderTypeSelected(value);
|
|
233
232
|
}
|
|
234
233
|
};
|
|
235
234
|
var handleChangeToPickup = function handleChangeToPickup() {
|
|
@@ -238,7 +237,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
238
237
|
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
239
238
|
})) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
|
|
240
239
|
handleChangeType(firstEnabledPickupType);
|
|
241
|
-
|
|
240
|
+
setOrderTypeSelected(firstEnabledPickupType);
|
|
242
241
|
};
|
|
243
242
|
(0, _react.useEffect)(function () {
|
|
244
243
|
if (preorderBusiness) setIsPreorder(true);
|
|
@@ -273,13 +272,11 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
273
272
|
}, [citiesState, orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.city_id]);
|
|
274
273
|
(0, _react.useEffect)(function () {
|
|
275
274
|
var _orderState$options9;
|
|
276
|
-
|
|
277
|
-
setIsPickupSelected(true);
|
|
278
|
-
}
|
|
275
|
+
setOrderTypeSelected(orderState === null || orderState === void 0 || (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.type);
|
|
279
276
|
}, [orderState === null || orderState === void 0 || (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.type]);
|
|
280
277
|
var OrderTypesComponent = function OrderTypesComponent() {
|
|
281
278
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
|
|
282
|
-
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value
|
|
279
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && pickupTypes.includes(type === null || type === void 0 ? void 0 : type.value);
|
|
283
280
|
}) : orderTypes).map(function (item, i) {
|
|
284
281
|
var _orderState$options11, _orderState$options12;
|
|
285
282
|
return /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
@@ -331,9 +328,9 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
331
328
|
return handleChangeType(1);
|
|
332
329
|
},
|
|
333
330
|
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
334
|
-
activated:
|
|
331
|
+
activated: orderTypeSelected === 1
|
|
335
332
|
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
336
|
-
activated:
|
|
333
|
+
activated: orderTypeSelected === 1
|
|
337
334
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
338
335
|
src: theme === null || theme === void 0 || (_theme$images3 = theme.images) === null || _theme$images3 === void 0 || (_theme$images3 = _theme$images3.general) === null || _theme$images3 === void 0 ? void 0 : _theme$images3.deliveryIco,
|
|
339
336
|
width: 20,
|
|
@@ -342,24 +339,38 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
342
339
|
return pickupTypes.includes(type);
|
|
343
340
|
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
344
341
|
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
345
|
-
activated:
|
|
342
|
+
activated: pickupTypes.includes(orderTypeSelected),
|
|
346
343
|
onClick: function onClick() {
|
|
347
344
|
return handleChangeToPickup();
|
|
348
345
|
}
|
|
349
346
|
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
350
|
-
activated:
|
|
347
|
+
activated: pickupTypes.includes(orderTypeSelected)
|
|
351
348
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
352
349
|
src: theme === null || theme === void 0 || (_theme$images4 = theme.images) === null || _theme$images4 === void 0 || (_theme$images4 = _theme$images4.general) === null || _theme$images4 === void 0 ? void 0 : _theme$images4.pickupIco,
|
|
353
350
|
width: 22,
|
|
354
351
|
height: 22
|
|
355
|
-
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup')))
|
|
352
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup'))), configTypes.some(function (type) {
|
|
353
|
+
return eatInType === type;
|
|
354
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
355
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
356
|
+
activated: orderTypeSelected === 3,
|
|
357
|
+
onClick: function onClick() {
|
|
358
|
+
return handleChangeType(3);
|
|
359
|
+
}
|
|
360
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
361
|
+
activated: orderTypeSelected === 3
|
|
362
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
363
|
+
src: theme === null || theme === void 0 || (_theme$images5 = theme.images) === null || _theme$images5 === void 0 || (_theme$images5 = _theme$images5.general) === null || _theme$images5 === void 0 ? void 0 : _theme$images5.eatinIco,
|
|
364
|
+
width: 22,
|
|
365
|
+
height: 22
|
|
366
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('EAT_IN', 'Eat in')))), pickupTypes.includes(orderTypeSelected) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')), /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesContainer, null, /*#__PURE__*/_react.default.createElement(OrderTypesComponent, null)))), !isCustomerMode && /*#__PURE__*/_react.default.createElement(_OrderProgress.OrderProgress, {
|
|
356
367
|
isChew: isChew,
|
|
357
368
|
franchiseId: props.franchiseId,
|
|
358
369
|
userCustomerId: userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
|
|
359
370
|
asDashboard: isCustomerMode,
|
|
360
371
|
isCustomerMode: isCustomerMode
|
|
361
372
|
}), (configs === null || configs === void 0 || (_configs$business_lis4 = configs.business_listing_hide_image) === null || _configs$business_lis4 === void 0 ? void 0 : _configs$business_lis4.value) !== '1' && isChew && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
362
|
-
bgimage: (_theme$
|
|
373
|
+
bgimage: (_theme$images6 = theme.images) === null || _theme$images6 === void 0 || (_theme$images6 = _theme$images6.general) === null || _theme$images6 === void 0 ? void 0 : _theme$images6.businessHero,
|
|
363
374
|
height: theme === null || theme === void 0 || (_theme$business_listi9 = theme.business_listing_view) === null || _theme$business_listi9 === void 0 || (_theme$business_listi9 = _theme$business_listi9.components) === null || _theme$business_listi9 === void 0 || (_theme$business_listi9 = _theme$business_listi9.business_hero) === null || _theme$business_listi9 === void 0 || (_theme$business_listi9 = _theme$business_listi9.style) === null || _theme$business_listi9 === void 0 ? void 0 : _theme$business_listi9.height
|
|
364
375
|
}), isCustomerMode && !hidePreviousOrders && !businessesList.loading && /*#__PURE__*/_react.default.createElement(_OrdersSection.OrdersSection, {
|
|
365
376
|
titleContent: t('PREVIOUS_ORDERS', 'Previous orders'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.35",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"lodash": "^4.17.19",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"nanoid": "^4.0.0",
|
|
91
|
-
"ordering-components-external": "13.0.
|
|
91
|
+
"ordering-components-external": "13.0.36",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -59,7 +59,8 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
59
59
|
getUsers
|
|
60
60
|
} = props
|
|
61
61
|
const allOrderTypes = [1, 2, 3, 4, 5]
|
|
62
|
-
const pickupTypes = [2,
|
|
62
|
+
const pickupTypes = [2, 4, 5]
|
|
63
|
+
const eatInType = 3
|
|
63
64
|
const [orderState, { changeType }] = useOrder()
|
|
64
65
|
const [, t] = useLanguage()
|
|
65
66
|
const theme = useTheme()
|
|
@@ -69,7 +70,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
69
70
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
70
71
|
const [isOpenUserData, setIsOpenUserData] = useState(false)
|
|
71
72
|
const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
|
|
72
|
-
const [
|
|
73
|
+
const [orderTypeSelected, setOrderTypeSelected] = useState(orderState?.options?.type)
|
|
73
74
|
const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
|
|
74
75
|
const [inputValue, setInputValue] = useState(urlPhone ?? userCustomer?.cellphone ?? '')
|
|
75
76
|
const [isSavedAddress, setIsSavedAddress] = useState(false)
|
|
@@ -110,9 +111,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
110
111
|
const handleChangeType = (value) => {
|
|
111
112
|
if (!orderState?.loading) {
|
|
112
113
|
changeType(value)
|
|
113
|
-
|
|
114
|
-
setIsPickupSelected(false)
|
|
115
|
-
}
|
|
114
|
+
setOrderTypeSelected(value)
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
117
|
|
|
@@ -195,7 +194,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
195
194
|
const handleChangeToPickup = () => {
|
|
196
195
|
const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
|
|
197
196
|
handleChangeType(firstEnabledPickupType)
|
|
198
|
-
|
|
197
|
+
setOrderTypeSelected(firstEnabledPickupType)
|
|
199
198
|
}
|
|
200
199
|
|
|
201
200
|
const handleDeleteUser = () => {
|
|
@@ -275,7 +274,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
275
274
|
}, [urlPhone, customersPhones?.loading])
|
|
276
275
|
|
|
277
276
|
useEffect(() => {
|
|
278
|
-
|
|
277
|
+
setOrderTypeSelected(orderState?.options?.type)
|
|
279
278
|
}, [orderState?.options?.type])
|
|
280
279
|
|
|
281
280
|
useEffect(() => {
|
|
@@ -296,7 +295,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
296
295
|
const OrderTypesComponent = () => {
|
|
297
296
|
return (
|
|
298
297
|
<>
|
|
299
|
-
{orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && type
|
|
298
|
+
{orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && pickupTypes.includes(type?.value)) : orderTypes).map((item, i) => (
|
|
300
299
|
<Button
|
|
301
300
|
key={item.value}
|
|
302
301
|
onClick={() => handleChangeType(item.value)}
|
|
@@ -319,8 +318,8 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
319
318
|
<Slogan>{t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')}</Slogan>
|
|
320
319
|
<TypesContainer>
|
|
321
320
|
{configTypes.includes(1) && (
|
|
322
|
-
<TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={
|
|
323
|
-
<IconTypeButton activated={
|
|
321
|
+
<TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={orderTypeSelected === 1}>
|
|
322
|
+
<IconTypeButton activated={orderTypeSelected === 1}>
|
|
324
323
|
<img
|
|
325
324
|
src={theme?.images?.general?.deliveryIco}
|
|
326
325
|
width={20}
|
|
@@ -333,10 +332,10 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
333
332
|
{configTypes.some(type => pickupTypes.includes(type)) && (
|
|
334
333
|
<TypeButton
|
|
335
334
|
disabled={orderState?.loading}
|
|
336
|
-
activated={
|
|
335
|
+
activated={pickupTypes.includes(orderTypeSelected)}
|
|
337
336
|
onClick={() => handleChangeToPickup()}
|
|
338
337
|
>
|
|
339
|
-
<IconTypeButton activated={
|
|
338
|
+
<IconTypeButton activated={pickupTypes.includes(orderTypeSelected)}>
|
|
340
339
|
<img
|
|
341
340
|
src={theme?.images?.general?.pickupIco}
|
|
342
341
|
width={22}
|
|
@@ -346,8 +345,24 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
346
345
|
<p>{t('PICKUP', 'Pickup')}</p>
|
|
347
346
|
</TypeButton>
|
|
348
347
|
)}
|
|
348
|
+
{configTypes.some(type => eatInType === type) && (
|
|
349
|
+
<TypeButton
|
|
350
|
+
disabled={orderState?.loading}
|
|
351
|
+
activated={orderTypeSelected === 3}
|
|
352
|
+
onClick={() => handleChangeType(3)}
|
|
353
|
+
>
|
|
354
|
+
<IconTypeButton activated={orderTypeSelected === 3}>
|
|
355
|
+
<img
|
|
356
|
+
src={theme?.images?.general?.eatinIco}
|
|
357
|
+
width={22}
|
|
358
|
+
height={22}
|
|
359
|
+
/>
|
|
360
|
+
</IconTypeButton>
|
|
361
|
+
<p>{t('EAT_IN', 'Eat in')}</p>
|
|
362
|
+
</TypeButton>
|
|
363
|
+
)}
|
|
349
364
|
</TypesContainer>
|
|
350
|
-
{
|
|
365
|
+
{pickupTypes.includes(orderTypeSelected) && (
|
|
351
366
|
<>
|
|
352
367
|
<p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
|
|
353
368
|
<AdditionalTypesContainer>
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -80,7 +80,8 @@ const BusinessesListingUI = (props) => {
|
|
|
80
80
|
orderTypes
|
|
81
81
|
} = props
|
|
82
82
|
const allOrderTypes = [1, 2, 3, 4, 5]
|
|
83
|
-
const pickupTypes = [2,
|
|
83
|
+
const pickupTypes = [2, 4, 5]
|
|
84
|
+
const eatInType = 3
|
|
84
85
|
const [, t] = useLanguage()
|
|
85
86
|
const [orderState, { changeCityFilter, changeType }] = useOrder()
|
|
86
87
|
const [{ auth }] = useSession()
|
|
@@ -94,7 +95,7 @@ const BusinessesListingUI = (props) => {
|
|
|
94
95
|
const [isPreorder, setIsPreorder] = useState(false)
|
|
95
96
|
const [preorderBusiness, setPreorderBusiness] = useState(null)
|
|
96
97
|
const [hasHighRatedBusiness, setHasHighRatedBusiness] = useState(true)
|
|
97
|
-
const [
|
|
98
|
+
const [orderTypeSelected, setOrderTypeSelected] = useState(orderState?.options?.type)
|
|
98
99
|
const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
|
|
99
100
|
const [favoriteIds, setFavoriteIds] = useState([])
|
|
100
101
|
const allCitiesDisabled = citiesState?.cities?.every(city => !city.enabled)
|
|
@@ -185,16 +186,14 @@ const BusinessesListingUI = (props) => {
|
|
|
185
186
|
const handleChangeType = (value) => {
|
|
186
187
|
if (!orderState?.loading) {
|
|
187
188
|
changeType(value)
|
|
188
|
-
|
|
189
|
-
setIsPickupSelected(false)
|
|
190
|
-
}
|
|
189
|
+
setOrderTypeSelected(value)
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
192
|
|
|
194
193
|
const handleChangeToPickup = () => {
|
|
195
194
|
const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
|
|
196
195
|
handleChangeType(firstEnabledPickupType)
|
|
197
|
-
|
|
196
|
+
setOrderTypeSelected(firstEnabledPickupType)
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
useEffect(() => {
|
|
@@ -227,15 +226,13 @@ const BusinessesListingUI = (props) => {
|
|
|
227
226
|
}, [citiesState, orderState?.options?.city_id])
|
|
228
227
|
|
|
229
228
|
useEffect(() => {
|
|
230
|
-
|
|
231
|
-
setIsPickupSelected(true)
|
|
232
|
-
}
|
|
229
|
+
setOrderTypeSelected(orderState?.options?.type)
|
|
233
230
|
}, [orderState?.options?.type])
|
|
234
231
|
|
|
235
232
|
const OrderTypesComponent = () => {
|
|
236
233
|
return (
|
|
237
234
|
<>
|
|
238
|
-
{orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && type
|
|
235
|
+
{orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && pickupTypes.includes(type?.value)) : orderTypes).map((item, i) => (
|
|
239
236
|
<Button
|
|
240
237
|
key={item.value}
|
|
241
238
|
onClick={() => handleChangeType(item.value)}
|
|
@@ -304,8 +301,8 @@ const BusinessesListingUI = (props) => {
|
|
|
304
301
|
)}
|
|
305
302
|
<TypesContainer>
|
|
306
303
|
{configTypes.includes(1) && (
|
|
307
|
-
<TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={
|
|
308
|
-
<IconTypeButton activated={
|
|
304
|
+
<TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={orderTypeSelected === 1}>
|
|
305
|
+
<IconTypeButton activated={orderTypeSelected === 1}>
|
|
309
306
|
<img
|
|
310
307
|
src={theme?.images?.general?.deliveryIco}
|
|
311
308
|
width={20}
|
|
@@ -318,10 +315,10 @@ const BusinessesListingUI = (props) => {
|
|
|
318
315
|
{configTypes.some(type => pickupTypes.includes(type)) && (
|
|
319
316
|
<TypeButton
|
|
320
317
|
disabled={orderState?.loading}
|
|
321
|
-
activated={
|
|
318
|
+
activated={pickupTypes.includes(orderTypeSelected)}
|
|
322
319
|
onClick={() => handleChangeToPickup()}
|
|
323
320
|
>
|
|
324
|
-
<IconTypeButton activated={
|
|
321
|
+
<IconTypeButton activated={pickupTypes.includes(orderTypeSelected)}>
|
|
325
322
|
<img
|
|
326
323
|
src={theme?.images?.general?.pickupIco}
|
|
327
324
|
width={22}
|
|
@@ -331,14 +328,30 @@ const BusinessesListingUI = (props) => {
|
|
|
331
328
|
<p>{t('PICKUP', 'Pickup')}</p>
|
|
332
329
|
</TypeButton>
|
|
333
330
|
)}
|
|
331
|
+
{configTypes.some(type => eatInType === type) && (
|
|
332
|
+
<TypeButton
|
|
333
|
+
disabled={orderState?.loading}
|
|
334
|
+
activated={orderTypeSelected === 3}
|
|
335
|
+
onClick={() => handleChangeType(3)}
|
|
336
|
+
>
|
|
337
|
+
<IconTypeButton activated={orderTypeSelected === 3}>
|
|
338
|
+
<img
|
|
339
|
+
src={theme?.images?.general?.eatinIco}
|
|
340
|
+
width={22}
|
|
341
|
+
height={22}
|
|
342
|
+
/>
|
|
343
|
+
</IconTypeButton>
|
|
344
|
+
<p>{t('EAT_IN', 'Eat in')}</p>
|
|
345
|
+
</TypeButton>
|
|
346
|
+
)}
|
|
334
347
|
</TypesContainer>
|
|
335
|
-
{
|
|
336
|
-
|
|
348
|
+
{pickupTypes.includes(orderTypeSelected) && (
|
|
349
|
+
<>
|
|
337
350
|
<p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
|
|
338
351
|
<AdditionalTypesContainer>
|
|
339
352
|
<OrderTypesComponent />
|
|
340
353
|
</AdditionalTypesContainer>
|
|
341
|
-
|
|
354
|
+
</>
|
|
342
355
|
)}
|
|
343
356
|
</>
|
|
344
357
|
)}
|
/package/_bundles/{1.ordering-ui.2b1fe991b2c45ea68382.js → 1.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|
/package/_bundles/{2.ordering-ui.2b1fe991b2c45ea68382.js → 2.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|
/package/_bundles/{4.ordering-ui.2b1fe991b2c45ea68382.js → 4.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|
/package/_bundles/{5.ordering-ui.2b1fe991b2c45ea68382.js → 5.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|
/package/_bundles/{6.ordering-ui.2b1fe991b2c45ea68382.js → 6.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/_bundles/{8.ordering-ui.2b1fe991b2c45ea68382.js → 8.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|
/package/_bundles/{9.ordering-ui.2b1fe991b2c45ea68382.js → 9.ordering-ui.7c3ac8ece68a78750046.js}
RENAMED
|
File without changes
|