ordering-ui-external 10.4.0 → 10.5.0
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.487a31b3537d90f69a9d.js → 0.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{1.ordering-ui.487a31b3537d90f69a9d.js → 1.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{2.ordering-ui.487a31b3537d90f69a9d.js → 2.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{4.ordering-ui.487a31b3537d90f69a9d.js → 4.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{5.ordering-ui.487a31b3537d90f69a9d.js → 5.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{6.ordering-ui.487a31b3537d90f69a9d.js → 6.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js → 7.ordering-ui.cc1d13aa04732fde3671.js} +2 -2
- package/_bundles/{8.ordering-ui.487a31b3537d90f69a9d.js → 8.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/{9.ordering-ui.487a31b3537d90f69a9d.js → 9.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
- package/_bundles/ordering-ui.cc1d13aa04732fde3671.js +2 -0
- package/_modules/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +4 -2
- package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +3 -1
- package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -2
- package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +25 -19
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +35 -13
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +7 -3
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -0
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +133 -31
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +37 -3
- package/_modules/themes/five/src/components/Cart/index.js +10 -6
- package/_modules/themes/five/src/components/Checkout/index.js +67 -22
- package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +53 -0
- package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +16 -0
- package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +69 -0
- package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +16 -0
- package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/index.js +90 -0
- package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +43 -0
- package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +75 -0
- package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +19 -0
- package/_modules/themes/five/src/components/MyOrders/index.js +6 -1
- package/_modules/themes/five/src/components/OrderProgress/index.js +1 -1
- package/_modules/themes/five/src/components/OrdersOption/index.js +1 -0
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +165 -31
- package/_modules/themes/five/src/components/PhoneAutocomplete/styles.js +53 -9
- package/_modules/themes/five/src/components/ProductForm/index.js +1 -0
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +5 -17
- package/_modules/themes/five/src/components/UserFormDetails/styles.js +3 -7
- package/index-template.js +9 -1
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +3 -1
- package/src/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +5 -1
- package/src/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -2
- package/src/themes/five/src/components/BusinessItemAccordion/styles.js +8 -7
- package/src/themes/five/src/components/BusinessProductsList/index.js +36 -3
- package/src/themes/five/src/components/BusinessProductsList/styles.js +20 -0
- package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +156 -36
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +66 -0
- package/src/themes/five/src/components/Cart/index.js +7 -4
- package/src/themes/five/src/components/Checkout/index.js +61 -35
- package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +50 -0
- package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +34 -0
- package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +75 -0
- package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +29 -0
- package/src/themes/five/src/components/GiftCard/SingleGiftCard/index.js +79 -0
- package/src/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +79 -0
- package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +72 -0
- package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +31 -0
- package/src/themes/five/src/components/MyOrders/index.js +6 -1
- package/src/themes/five/src/components/OrderProgress/index.js +1 -1
- package/src/themes/five/src/components/OrdersOption/index.js +1 -0
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +195 -46
- package/src/themes/five/src/components/PhoneAutocomplete/styles.js +106 -10
- package/src/themes/five/src/components/ProductForm/index.js +1 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -0
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +6 -27
- package/src/themes/five/src/components/UserFormDetails/styles.js +0 -16
- package/template/assets/images/delivery.svg +11 -0
- package/template/assets/images/phone-hero-callcenter.png +0 -0
- package/template/assets/images/phone.svg +11 -0
- package/template/assets/images/pickup.svg +17 -0
- package/template/pages/BusinessProductsList/index.js +2 -1
- package/_bundles/ordering-ui.487a31b3537d90f69a9d.js +0 -2
- /package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → 7.ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
|
@@ -53,7 +53,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
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 _citiesState$cities, _ref, _theme$business_listi, _orderState$
|
|
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$busin3, _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$images5, _theme$business_listi9, _citiesState$cities5, _citiesState$cities6, _orderState$options15, _configs$advanced_bus2, _citiesState$cities7, _citiesState$cities8, _orderState$options17, _businessesList$busin5, _businessesList$busin6, _orderState$options20;
|
|
57
57
|
var businessesList = props.businessesList,
|
|
58
58
|
paginationProps = props.paginationProps,
|
|
59
59
|
searchValue = props.searchValue,
|
|
@@ -69,14 +69,19 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
69
69
|
getCities = props.getCities,
|
|
70
70
|
citiesState = props.citiesState,
|
|
71
71
|
logosLayout = props.logosLayout,
|
|
72
|
-
actualSlug = props.actualSlug
|
|
72
|
+
actualSlug = props.actualSlug,
|
|
73
|
+
orderTypes = props.orderTypes;
|
|
74
|
+
var allOrderTypes = [1, 2, 3, 4, 5];
|
|
75
|
+
var pickupTypes = [2, 3, 4, 5];
|
|
73
76
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
74
77
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
75
78
|
t = _useLanguage2[1];
|
|
76
79
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
77
80
|
_useOrder2 = _slicedToArray(_useOrder, 2),
|
|
78
81
|
orderState = _useOrder2[0],
|
|
79
|
-
|
|
82
|
+
_useOrder2$ = _useOrder2[1],
|
|
83
|
+
changeCityFilter = _useOrder2$.changeCityFilter,
|
|
84
|
+
changeType = _useOrder2$.changeType;
|
|
80
85
|
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
81
86
|
_useSession2 = _slicedToArray(_useSession, 1),
|
|
82
87
|
auth = _useSession2[0].auth;
|
|
@@ -120,15 +125,19 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
120
125
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
121
126
|
hasHighRatedBusiness = _useState14[0],
|
|
122
127
|
setHasHighRatedBusiness = _useState14[1];
|
|
123
|
-
var
|
|
124
|
-
var _useState15 = (0, _react.useState)([]),
|
|
128
|
+
var _useState15 = (0, _react.useState)(pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type)),
|
|
125
129
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
isPickupSelected = _useState16[0],
|
|
131
|
+
setIsPickupSelected = _useState16[1];
|
|
132
|
+
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
133
|
+
var _useState17 = (0, _react.useState)([]),
|
|
134
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
135
|
+
favoriteIds = _useState18[0],
|
|
136
|
+
setFavoriteIds = _useState18[1];
|
|
128
137
|
var allCitiesDisabled = citiesState === null || citiesState === void 0 || (_citiesState$cities = citiesState.cities) === null || _citiesState$cities === void 0 ? void 0 : _citiesState$cities.every(function (city) {
|
|
129
138
|
return !city.enabled;
|
|
130
139
|
});
|
|
131
|
-
var hideCities = (_ref = (theme === null || theme === void 0 || (_theme$business_listi = theme.business_listing_view) === null || _theme$business_listi === void 0 || (_theme$business_listi = _theme$business_listi.components) === null || _theme$business_listi === void 0 || (_theme$business_listi = _theme$business_listi.cities) === null || _theme$business_listi === void 0 ? void 0 : _theme$business_listi.hidden) || (orderState === null || orderState === void 0 || (_orderState$
|
|
140
|
+
var hideCities = (_ref = (theme === null || theme === void 0 || (_theme$business_listi = theme.business_listing_view) === null || _theme$business_listi === void 0 || (_theme$business_listi = _theme$business_listi.components) === null || _theme$business_listi === void 0 || (_theme$business_listi = _theme$business_listi.cities) === null || _theme$business_listi === void 0 ? void 0 : _theme$business_listi.hidden) || (orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) !== 2 || allCitiesDisabled) !== null && _ref !== void 0 ? _ref : true;
|
|
132
141
|
var hideSearch = theme === null || theme === void 0 || (_theme$business_listi2 = theme.business_listing_view) === null || _theme$business_listi2 === void 0 || (_theme$business_listi2 = _theme$business_listi2.components) === null || _theme$business_listi2 === void 0 || (_theme$business_listi2 = _theme$business_listi2.search) === null || _theme$business_listi2 === void 0 ? void 0 : _theme$business_listi2.hidden;
|
|
133
142
|
var hideFilter = (theme === null || theme === void 0 || (_theme$business_listi3 = theme.business_listing_view) === null || _theme$business_listi3 === void 0 || (_theme$business_listi3 = _theme$business_listi3.components) === null || _theme$business_listi3 === void 0 || (_theme$business_listi3 = _theme$business_listi3.filter) === null || _theme$business_listi3 === void 0 ? void 0 : _theme$business_listi3.hidden) || hideSearch;
|
|
134
143
|
var hideHero = theme === null || theme === void 0 || (_theme$business_listi4 = theme.business_listing_view) === null || _theme$business_listi4 === void 0 || (_theme$business_listi4 = _theme$business_listi4.components) === null || _theme$business_listi4 === void 0 || (_theme$business_listi4 = _theme$business_listi4.business_hero) === null || _theme$business_listi4 === void 0 ? void 0 : _theme$business_listi4.hidden;
|
|
@@ -140,7 +149,12 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
140
149
|
return business.id;
|
|
141
150
|
}));
|
|
142
151
|
var isChew = (theme === null || theme === void 0 || (_theme$header = theme.header) === null || _theme$header === void 0 || (_theme$header = _theme$header.components) === null || _theme$header === void 0 || (_theme$header = _theme$header.layout) === null || _theme$header === void 0 || (_theme$header = _theme$header.type) === null || _theme$header === void 0 ? void 0 : _theme$header.toLowerCase()) === 'chew';
|
|
143
|
-
var cateringTypeString = (orderState === null || orderState === void 0 || (_orderState$
|
|
152
|
+
var cateringTypeString = (orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type) === 8 ? 'catering_pickup' : null;
|
|
153
|
+
var configTypes = (configs === null || configs === void 0 || (_configs$order_types_ = configs.order_types_allowed) === null || _configs$order_types_ === void 0 ? void 0 : _configs$order_types_.value.split('|').filter(function (value) {
|
|
154
|
+
return allOrderTypes.includes(Number(value));
|
|
155
|
+
}).map(function (value) {
|
|
156
|
+
return Number(value);
|
|
157
|
+
})) || [];
|
|
144
158
|
var cateringValues = (preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs) && (0, _utils.getCateringValues)(cateringTypeString, preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs);
|
|
145
159
|
var handleScroll = (0, _react.useCallback)(function () {
|
|
146
160
|
var _document$documentEle, _document$documentEle2, _businessesList$error;
|
|
@@ -207,8 +221,24 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
207
221
|
}));
|
|
208
222
|
};
|
|
209
223
|
var handleChangeCity = function handleChangeCity(cityId) {
|
|
210
|
-
var _orderState$
|
|
211
|
-
changeCityFilter(cityId === (orderState === null || orderState === void 0 || (_orderState$
|
|
224
|
+
var _orderState$options5;
|
|
225
|
+
changeCityFilter(cityId === (orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.city_id) ? null : cityId);
|
|
226
|
+
};
|
|
227
|
+
var handleChangeType = function handleChangeType(value) {
|
|
228
|
+
if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
|
|
229
|
+
changeType(value);
|
|
230
|
+
if (value === 1) {
|
|
231
|
+
setIsPickupSelected(false);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
var handleChangeToPickup = function handleChangeToPickup() {
|
|
236
|
+
var _orderTypes$find;
|
|
237
|
+
var firstEnabledPickupType = (_orderTypes$find = orderTypes.find(function (type) {
|
|
238
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
239
|
+
})) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
|
|
240
|
+
handleChangeType(firstEnabledPickupType);
|
|
241
|
+
setIsPickupSelected(true);
|
|
212
242
|
};
|
|
213
243
|
(0, _react.useEffect)(function () {
|
|
214
244
|
if (preorderBusiness) setIsPreorder(true);
|
|
@@ -226,14 +256,36 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
226
256
|
setFavoriteIds(_toConsumableArray(new Set(ids)));
|
|
227
257
|
}, [businessesList === null || businessesList === void 0 || (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.length]);
|
|
228
258
|
(0, _react.useEffect)(function () {
|
|
229
|
-
var _citiesState$cities3, _orderState$
|
|
230
|
-
if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities3 = citiesState.cities) !== null && _citiesState$cities3 !== void 0 && _citiesState$cities3.length) || !(orderState !== null && orderState !== void 0 && (_orderState$
|
|
259
|
+
var _citiesState$cities3, _orderState$options6, _citiesState$cities4;
|
|
260
|
+
if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities3 = citiesState.cities) !== null && _citiesState$cities3 !== void 0 && _citiesState$cities3.length) || !(orderState !== null && orderState !== void 0 && (_orderState$options6 = orderState.options) !== null && _orderState$options6 !== void 0 && _orderState$options6.city_id)) return;
|
|
231
261
|
var selectedCity = citiesState === null || citiesState === void 0 || (_citiesState$cities4 = citiesState.cities) === null || _citiesState$cities4 === void 0 ? void 0 : _citiesState$cities4.find(function (city) {
|
|
232
|
-
var _orderState$
|
|
233
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$
|
|
262
|
+
var _orderState$options7;
|
|
263
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 ? void 0 : _orderState$options7.city_id);
|
|
234
264
|
});
|
|
235
265
|
if (!selectedCity || !(selectedCity !== null && selectedCity !== void 0 && selectedCity.enabled)) changeCityFilter(null);
|
|
236
|
-
}, [citiesState, orderState === null || orderState === void 0 || (_orderState$
|
|
266
|
+
}, [citiesState, orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.city_id]);
|
|
267
|
+
(0, _react.useEffect)(function () {
|
|
268
|
+
var _orderState$options9;
|
|
269
|
+
if (pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.type) && isCustomerMode) {
|
|
270
|
+
setIsPickupSelected(true);
|
|
271
|
+
}
|
|
272
|
+
}, [orderState === null || orderState === void 0 || (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.type]);
|
|
273
|
+
var OrderTypesComponent = function OrderTypesComponent() {
|
|
274
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
|
|
275
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
276
|
+
}) : orderTypes).map(function (item, i) {
|
|
277
|
+
var _orderState$options11, _orderState$options12;
|
|
278
|
+
return /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
279
|
+
key: item.value,
|
|
280
|
+
onClick: function onClick() {
|
|
281
|
+
return handleChangeType(item.value);
|
|
282
|
+
},
|
|
283
|
+
color: (orderState === null || orderState === void 0 || (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : _orderState$options11.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
|
|
284
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
285
|
+
className: (orderState === null || orderState === void 0 || (_orderState$options12 = orderState.options) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
|
|
286
|
+
}, item.text);
|
|
287
|
+
}));
|
|
288
|
+
};
|
|
237
289
|
if (logosLayout) {
|
|
238
290
|
var _businessesList$busin4;
|
|
239
291
|
return /*#__PURE__*/_react.default.createElement(_styles.BusinessLogosWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessLogosContainer, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
@@ -262,17 +314,43 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
262
314
|
}), (windowSize.width < 576 || (configs === null || configs === void 0 || (_configs$business_lis = configs.business_listing_hide_image) === null || _configs$business_lis === void 0 ? void 0 : _configs$business_lis.value) !== '1' && !isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessBanner, null, windowSize.width < 576 && /*#__PURE__*/_react.default.createElement(_OrderContextUI.OrderContextUI, {
|
|
263
315
|
isBusinessList: true,
|
|
264
316
|
hideHero: (configs === null || configs === void 0 || (_configs$business_lis2 = configs.business_listing_hide_image) === null || _configs$business_lis2 === void 0 ? void 0 : _configs$business_lis2.value) !== '1' && !isChew && !hideHero
|
|
265
|
-
}), (configs === null || configs === void 0 || (_configs$business_lis3 = configs.business_listing_hide_image) === null || _configs$business_lis3 === void 0 ? void 0 : _configs$business_lis3.value) !== '1' && !isChew && !hideHero && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
317
|
+
}), (configs === null || configs === void 0 || (_configs$business_lis3 = configs.business_listing_hide_image) === null || _configs$business_lis3 === void 0 ? void 0 : _configs$business_lis3.value) !== '1' && !isChew && !hideHero && !isCustomerMode && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
266
318
|
bgimage: (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.businessHero,
|
|
267
319
|
height: theme === null || theme === void 0 || (_theme$business_listi8 = theme.business_listing_view) === null || _theme$business_listi8 === void 0 || (_theme$business_listi8 = _theme$business_listi8.components) === null || _theme$business_listi8 === void 0 || (_theme$business_listi8 = _theme$business_listi8.business_hero) === null || _theme$business_listi8 === void 0 || (_theme$business_listi8 = _theme$business_listi8.style) === null || _theme$business_listi8 === void 0 ? void 0 : _theme$business_listi8.height
|
|
268
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
320
|
+
})), 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 ? void 0 : _orderState$options13.address) && isCustomerMode && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('DELIVERY_TYPE', 'Delivery Type')), /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
321
|
+
onClick: function onClick() {
|
|
322
|
+
return handleChangeType(1);
|
|
323
|
+
},
|
|
324
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
325
|
+
activated: !isPickupSelected
|
|
326
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
327
|
+
activated: !isPickupSelected
|
|
328
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
329
|
+
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,
|
|
330
|
+
width: 20,
|
|
331
|
+
height: 20
|
|
332
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('DELIVERY', 'Delivery'))), configTypes.some(function (type) {
|
|
333
|
+
return pickupTypes.includes(type);
|
|
334
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
335
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
336
|
+
activated: isPickupSelected,
|
|
337
|
+
onClick: function onClick() {
|
|
338
|
+
return handleChangeToPickup();
|
|
339
|
+
}
|
|
340
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
341
|
+
activated: isPickupSelected
|
|
342
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
343
|
+
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,
|
|
344
|
+
width: 22,
|
|
345
|
+
height: 22
|
|
346
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup')))), isPickupSelected && /*#__PURE__*/_react.default.createElement(_styles.TypesWrapper, 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, {
|
|
269
347
|
isChew: isChew,
|
|
270
348
|
franchiseId: props.franchiseId,
|
|
271
349
|
userCustomerId: userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
|
|
272
350
|
asDashboard: isCustomerMode,
|
|
273
351
|
isCustomerMode: isCustomerMode
|
|
274
352
|
}), (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, {
|
|
275
|
-
bgimage: (_theme$
|
|
353
|
+
bgimage: (_theme$images5 = theme.images) === null || _theme$images5 === void 0 || (_theme$images5 = _theme$images5.general) === null || _theme$images5 === void 0 ? void 0 : _theme$images5.businessHero,
|
|
276
354
|
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
|
|
277
355
|
}), isCustomerMode && !hidePreviousOrders && !businessesList.loading && /*#__PURE__*/_react.default.createElement(_OrdersSection.OrdersSection, {
|
|
278
356
|
titleContent: t('PREVIOUS_ORDERS', 'Previous orders'),
|
|
@@ -301,13 +379,13 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
301
379
|
color: "primary",
|
|
302
380
|
onClick: handleOpenCities
|
|
303
381
|
}, (citiesState === null || citiesState === void 0 || (_citiesState$cities6 = citiesState.cities) === null || _citiesState$cities6 === void 0 || (_citiesState$cities6 = _citiesState$cities6.find(function (city) {
|
|
304
|
-
var _orderState$
|
|
305
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$
|
|
382
|
+
var _orderState$options14;
|
|
383
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$options14 = orderState.options) === null || _orderState$options14 === void 0 ? void 0 : _orderState$options14.city_id);
|
|
306
384
|
})) === null || _citiesState$cities6 === void 0 ? void 0 : _citiesState$cities6.name) || t('SELECT_A_CITY', 'Select a city')), isCustomLayout && /*#__PURE__*/_react.default.createElement(_FiMap.default, {
|
|
307
385
|
onClick: toggleMap
|
|
308
386
|
})), activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
309
387
|
businessList: businessesList.businesses,
|
|
310
|
-
userLocation: orderState === null || orderState === void 0 || (_orderState$
|
|
388
|
+
userLocation: orderState === null || orderState === void 0 || (_orderState$options15 = orderState.options) === null || _orderState$options15 === void 0 || (_orderState$options15 = _orderState$options15.address) === null || _orderState$options15 === void 0 ? void 0 : _orderState$options15.location,
|
|
311
389
|
setErrors: setMapErrors
|
|
312
390
|
})), !isChew && hasHighRatedBusiness && !props.franchiseId && !hideHighestBusiness && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_HighestRated.HighestRated, {
|
|
313
391
|
propsToFetch: props.propsToFetch,
|
|
@@ -346,11 +424,11 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
346
424
|
color: "primary",
|
|
347
425
|
onClick: handleOpenCities
|
|
348
426
|
}, (citiesState === null || citiesState === void 0 || (_citiesState$cities8 = citiesState.cities) === null || _citiesState$cities8 === void 0 || (_citiesState$cities8 = _citiesState$cities8.find(function (city) {
|
|
349
|
-
var _orderState$
|
|
350
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$
|
|
427
|
+
var _orderState$options16;
|
|
428
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$options16 = orderState.options) === null || _orderState$options16 === void 0 ? void 0 : _orderState$options16.city_id);
|
|
351
429
|
})) === null || _citiesState$cities8 === void 0 ? void 0 : _citiesState$cities8.name) || t('SELECT_A_CITY', 'Select a city')))), isCustomerMode && activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
352
430
|
businessList: businessesList.businesses,
|
|
353
|
-
userLocation: orderState === null || orderState === void 0 || (_orderState$
|
|
431
|
+
userLocation: orderState === null || orderState === void 0 || (_orderState$options17 = orderState.options) === null || _orderState$options17 === void 0 || (_orderState$options17 = _orderState$options17.address) === null || _orderState$options17 === void 0 ? void 0 : _orderState$options17.location,
|
|
354
432
|
setErrors: setMapErrors
|
|
355
433
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (!isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 || (_businessesList$busin5 = businessesList.businesses) === null || _businessesList$busin5 === void 0 ? void 0 : _businessesList$busin5.length) > 0 || isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && (businessesList === null || businessesList === void 0 ? void 0 : businessesList.fetched) && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
356
434
|
content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
|
|
@@ -364,14 +442,14 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
364
442
|
height: '44px'
|
|
365
443
|
}
|
|
366
444
|
}, t('CHANGE_ADDRESS', 'Select other Address'))), (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.map(function (business) {
|
|
367
|
-
var _orderState$
|
|
445
|
+
var _orderState$options18, _business$reviews;
|
|
368
446
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
369
447
|
key: business.id,
|
|
370
448
|
className: "card",
|
|
371
449
|
business: business,
|
|
372
450
|
isBusinessOpen: business.open,
|
|
373
451
|
handleCustomClick: handleBusinessClick,
|
|
374
|
-
orderType: orderState === null || orderState === void 0 || (_orderState$
|
|
452
|
+
orderType: orderState === null || orderState === void 0 || (_orderState$options18 = orderState.options) === null || _orderState$options18 === void 0 ? void 0 : _orderState$options18.type,
|
|
375
453
|
isCustomLayout: isCustomLayout,
|
|
376
454
|
isCustomerMode: isCustomerMode,
|
|
377
455
|
onPreorderBusiness: setPreorderBusiness,
|
|
@@ -389,13 +467,13 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
389
467
|
setFavoriteIds: setFavoriteIds
|
|
390
468
|
});
|
|
391
469
|
}), (businessesList.loading || !(businessesList !== null && businessesList !== void 0 && businessesList.fetched)) && _toConsumableArray(Array((paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.nextPageItems) > 4 ? paginationProps.nextPageItems : 8).keys()).map(function (i) {
|
|
392
|
-
var _orderState$
|
|
470
|
+
var _orderState$options19;
|
|
393
471
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
394
472
|
key: i,
|
|
395
473
|
className: "card",
|
|
396
474
|
business: {},
|
|
397
475
|
isSkeleton: true,
|
|
398
|
-
orderType: orderState === null || orderState === void 0 || (_orderState$
|
|
476
|
+
orderType: orderState === null || orderState === void 0 || (_orderState$options19 = orderState.options) === null || _orderState$options19 === void 0 ? void 0 : _orderState$options19.type
|
|
399
477
|
});
|
|
400
478
|
}))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
401
479
|
open: isPreorder,
|
|
@@ -448,7 +526,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
448
526
|
isCustomerMode: isCustomerMode
|
|
449
527
|
}) : /*#__PURE__*/_react.default.createElement(_styles.AddressFormWrapper, null, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
|
|
450
528
|
useValidationFileds: true,
|
|
451
|
-
address: (orderState === null || orderState === void 0 || (_orderState$
|
|
529
|
+
address: (orderState === null || orderState === void 0 || (_orderState$options20 = orderState.options) === null || _orderState$options20 === void 0 ? void 0 : _orderState$options20.address) || {},
|
|
452
530
|
onCancel: function onCancel() {
|
|
453
531
|
return setModals(_objectSpread(_objectSpread({}, modals), {}, {
|
|
454
532
|
formOpen: false
|
|
@@ -475,13 +553,37 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
475
553
|
}));
|
|
476
554
|
};
|
|
477
555
|
var OriginalBusinessesListing = function OriginalBusinessesListing(props) {
|
|
556
|
+
var _useLanguage3 = (0, _orderingComponentsExternal.useLanguage)(),
|
|
557
|
+
_useLanguage4 = _slicedToArray(_useLanguage3, 2),
|
|
558
|
+
t = _useLanguage4[1];
|
|
478
559
|
var businessListingProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
479
560
|
UIComponent: BusinessesListingUI,
|
|
480
561
|
paginationSettings: {
|
|
481
562
|
initialPage: 1,
|
|
482
563
|
pageSize: 25,
|
|
483
564
|
controlType: 'infinity'
|
|
484
|
-
}
|
|
565
|
+
},
|
|
566
|
+
orderTypes: props.orderTypes || [{
|
|
567
|
+
value: 1,
|
|
568
|
+
text: t('DELIVERY', 'Delivery'),
|
|
569
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
570
|
+
}, {
|
|
571
|
+
value: 2,
|
|
572
|
+
text: t('PICKUP', 'Pickup'),
|
|
573
|
+
description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
|
|
574
|
+
}, {
|
|
575
|
+
value: 3,
|
|
576
|
+
text: t('EAT_IN', 'Eat in'),
|
|
577
|
+
description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
|
|
578
|
+
}, {
|
|
579
|
+
value: 4,
|
|
580
|
+
text: t('CURBSIDE', 'Curbside'),
|
|
581
|
+
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
|
|
582
|
+
}, {
|
|
583
|
+
value: 5,
|
|
584
|
+
text: t('DRIVE_THRU', 'Drive thru'),
|
|
585
|
+
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
|
|
586
|
+
}]
|
|
485
587
|
});
|
|
486
588
|
return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.BusinessList, businessListingProps);
|
|
487
589
|
};
|
|
@@ -4,10 +4,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrapperSearch = exports.SearchContainer = exports.PreviousOrders = exports.HightestRatedWrapper = exports.HeaderSearchMode = exports.ErrorMessage = exports.Divider = exports.BusinessesTitle = exports.BusinessSearch = exports.BusinessLogosWrapper = exports.BusinessLogosContainer = exports.BusinessLogo = exports.BusinessList = exports.BusinessHeroImgStyled = exports.BusinessHeroImg = exports.BusinessContainer = exports.BusinessBanner = exports.AddressFormWrapper = void 0;
|
|
7
|
+
exports.WrapperSearch = exports.TypesWrapper = exports.TypesContainer = exports.TypeButton = exports.Title = exports.SearchContainer = exports.PreviousOrders = exports.IconTypeButton = exports.HightestRatedWrapper = exports.HeaderSearchMode = exports.ErrorMessage = exports.Divider = exports.BusinessesTitle = exports.BusinessSearch = exports.BusinessLogosWrapper = exports.BusinessLogosContainer = exports.BusinessLogo = exports.BusinessList = exports.BusinessHeroImgStyled = exports.BusinessHeroImg = exports.BusinessContainer = exports.BusinessBanner = exports.AddressFormWrapper = exports.AdditionalTypesContainer = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31;
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -88,4 +88,38 @@ exports.BusinessLogosContainer = BusinessLogosContainer;
|
|
|
88
88
|
var HeaderSearchMode = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n position: absolute;\n width: 200px;\n"])));
|
|
89
89
|
exports.HeaderSearchMode = HeaderSearchMode;
|
|
90
90
|
var AddressFormWrapper = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n @media (min-width: 450px) {\n margin-top: 20px;\n }\n"])));
|
|
91
|
-
exports.AddressFormWrapper = AddressFormWrapper;
|
|
91
|
+
exports.AddressFormWrapper = AddressFormWrapper;
|
|
92
|
+
var IconTypeButton = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 44px;\n height: 44px;\n background: ", ";\n border-radius: 44px;\n"])), function (_ref5) {
|
|
93
|
+
var _theme$colors;
|
|
94
|
+
var activated = _ref5.activated,
|
|
95
|
+
theme = _ref5.theme;
|
|
96
|
+
return activated ? theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.white : '#F3F9FF';
|
|
97
|
+
});
|
|
98
|
+
exports.IconTypeButton = IconTypeButton;
|
|
99
|
+
var TypesContainer = _styledComponents.default.div(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n display: flex;\n margin: 42px 20px 0px 20px;\n"])));
|
|
100
|
+
exports.TypesContainer = TypesContainer;
|
|
101
|
+
var AdditionalTypesContainer = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n width: 60%;\n display: flex;\n margin-bottom: 20px;\n margin-left: 20px;\n button {\n padding: 4px 10px;\n border-radius: 50px;\n font-size: 10px;\n line-height: 0;\n height: 25px;\n margin-right: 20px;\n }\n .activated {\n color: ", "\n }\n"])), function (_ref6) {
|
|
102
|
+
var _theme$colors2;
|
|
103
|
+
var theme = _ref6.theme;
|
|
104
|
+
return theme === null || theme === void 0 || (_theme$colors2 = theme.colors) === null || _theme$colors2 === void 0 ? void 0 : _theme$colors2.darkTextColor;
|
|
105
|
+
});
|
|
106
|
+
exports.AdditionalTypesContainer = AdditionalTypesContainer;
|
|
107
|
+
var TypeButton = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 215px;\n height: 75px;\n border-radius: 7.6px;\n padding: 16px;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);\n margin-right: 32px;\n margin-bottom: 32px;\n cursor: pointer;\n background: ", ";\n p{\n margin: 0;\n margin-left: 33px;\n ", "\n }\n"])), function (_ref7) {
|
|
108
|
+
var _theme$colors3, _theme$colors4;
|
|
109
|
+
var activated = _ref7.activated,
|
|
110
|
+
theme = _ref7.theme;
|
|
111
|
+
return activated ? theme === null || theme === void 0 || (_theme$colors3 = theme.colors) === null || _theme$colors3 === void 0 ? void 0 : _theme$colors3.primary : theme === null || theme === void 0 || (_theme$colors4 = theme.colors) === null || _theme$colors4 === void 0 ? void 0 : _theme$colors4.white;
|
|
112
|
+
}, function (_ref8) {
|
|
113
|
+
var _theme$colors5;
|
|
114
|
+
var activated = _ref8.activated,
|
|
115
|
+
theme = _ref8.theme;
|
|
116
|
+
return activated && (0, _styledComponents.css)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme === null || theme === void 0 || (_theme$colors5 = theme.colors) === null || _theme$colors5 === void 0 ? void 0 : _theme$colors5.white);
|
|
117
|
+
});
|
|
118
|
+
exports.TypeButton = TypeButton;
|
|
119
|
+
var Title = _styledComponents.default.h2(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n font-weight: 600;\n font-size: 24px;\n color: ", ";\n margin: 0px 20px 5px 20px;\n"])), function (props) {
|
|
120
|
+
var _props$theme3;
|
|
121
|
+
return (_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.colors.headingColor;
|
|
122
|
+
});
|
|
123
|
+
exports.Title = Title;
|
|
124
|
+
var TypesWrapper = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n margin-left: 20px;\n width: 600px;\n"])));
|
|
125
|
+
exports.TypesWrapper = TypesWrapper;
|
|
@@ -44,7 +44,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
44
44
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
45
45
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
46
46
|
var CartUI = function CartUI(props) {
|
|
47
|
-
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _configs$checkout_mul, _orderState$carts, _props$cart, _theme$viewString, _validationFields$fie2, _theme$viewString2, _orderState$options, _orderState$options2, _cart$taxes, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers4, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes3, _cart$taxes4, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _orderState$options3, _cart$offers7, _cart$offers8, _configs$driver_tip_t, _configs$driver_tip_u, _orderState$options4, _validationFields$
|
|
47
|
+
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _configs$checkout_mul, _orderState$carts, _props$cart, _theme$viewString, _validationFields$fie2, _theme$viewString2, _validationFields$fie3, _orderState$options, _orderState$options2, _cart$taxes, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers4, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes3, _cart$taxes4, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _orderState$options3, _cart$offers7, _cart$offers8, _configs$driver_tip_t, _configs$driver_tip_u, _orderState$options4, _validationFields$fie4, _configs$driver_tip_t2, _configs$driver_tip_u2, _configs$driver_tip_t3, _cart$payment_events, _cart$payment_events2, _orderState$options5, _cart$business2, _cart$business3, _curProduct$calendar_, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6, _props$afterComponent, _props$afterElements;
|
|
48
48
|
var currentCartUuid = props.currentCartUuid,
|
|
49
49
|
clearCart = props.clearCart,
|
|
50
50
|
isProducts = props.isProducts,
|
|
@@ -72,7 +72,9 @@ var CartUI = function CartUI(props) {
|
|
|
72
72
|
hideCouponInput = props.hideCouponInput,
|
|
73
73
|
businessConfigs = props.businessConfigs,
|
|
74
74
|
loyaltyRewardRate = props.loyaltyRewardRate,
|
|
75
|
-
isCustomerMode = props.isCustomerMode
|
|
75
|
+
isCustomerMode = props.isCustomerMode,
|
|
76
|
+
guestCheckoutComment = props.guestCheckoutComment,
|
|
77
|
+
guestCheckoutCupon = props.guestCheckoutCupon;
|
|
76
78
|
var theme = (0, _styledComponents.useTheme)();
|
|
77
79
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
78
80
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -83,6 +85,9 @@ var CartUI = function CartUI(props) {
|
|
|
83
85
|
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
84
86
|
_useEvent2 = _slicedToArray(_useEvent, 1),
|
|
85
87
|
events = _useEvent2[0];
|
|
88
|
+
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
89
|
+
_useSession2 = _slicedToArray(_useSession, 1),
|
|
90
|
+
loginUser = _useSession2[0].user;
|
|
86
91
|
var _useUtils = (0, _orderingComponentsExternal.useUtils)(),
|
|
87
92
|
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
88
93
|
_useUtils2$ = _useUtils2[0],
|
|
@@ -148,8 +153,8 @@ var CartUI = function CartUI(props) {
|
|
|
148
153
|
var isMultiCheckout = (configs === null || configs === void 0 || (_configs$checkout_mul = configs.checkout_multi_business_enabled) === null || _configs$checkout_mul === void 0 ? void 0 : _configs$checkout_mul.value) === '1';
|
|
149
154
|
var cart = cartMulticart || (orderState === null || orderState === void 0 || (_orderState$carts = orderState.carts) === null || _orderState$carts === void 0 ? void 0 : _orderState$carts["businessId:".concat((_props$cart = props.cart) === null || _props$cart === void 0 ? void 0 : _props$cart.business_id)]);
|
|
150
155
|
var viewString = isStore ? 'business_view' : 'header';
|
|
151
|
-
var hideCartComments = (theme === null || theme === void 0 || (_theme$viewString = theme[viewString]) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.components) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.cart) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.components) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.comments) === null || _theme$viewString === void 0 ? void 0 : _theme$viewString.hidden) || !(validationFields !== null && validationFields !== void 0 && (_validationFields$fie2 = validationFields.fields) !== null && _validationFields$fie2 !== void 0 && (_validationFields$fie2 = _validationFields$fie2.checkout) !== null && _validationFields$fie2 !== void 0 && (_validationFields$fie2 = _validationFields$fie2.comments) !== null && _validationFields$fie2 !== void 0 && _validationFields$fie2.enabled);
|
|
152
|
-
var hideCartDiscount = theme === null || theme === void 0 || (_theme$viewString2 = theme[viewString]) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.components) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.cart) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.components) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.discount_coupon) === null || _theme$viewString2 === void 0 ? void 0 : _theme$viewString2.hidden;
|
|
156
|
+
var hideCartComments = (theme === null || theme === void 0 || (_theme$viewString = theme[viewString]) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.components) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.cart) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.components) === null || _theme$viewString === void 0 || (_theme$viewString = _theme$viewString.comments) === null || _theme$viewString === void 0 ? void 0 : _theme$viewString.hidden) || (loginUser !== null && loginUser !== void 0 && loginUser.guest_id && guestCheckoutComment ? !(guestCheckoutComment !== null && guestCheckoutComment !== void 0 && guestCheckoutComment.enabled) : !(validationFields !== null && validationFields !== void 0 && (_validationFields$fie2 = validationFields.fields) !== null && _validationFields$fie2 !== void 0 && (_validationFields$fie2 = _validationFields$fie2.checkout) !== null && _validationFields$fie2 !== void 0 && (_validationFields$fie2 = _validationFields$fie2.comments) !== null && _validationFields$fie2 !== void 0 && _validationFields$fie2.enabled));
|
|
157
|
+
var hideCartDiscount = (theme === null || theme === void 0 || (_theme$viewString2 = theme[viewString]) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.components) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.cart) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.components) === null || _theme$viewString2 === void 0 || (_theme$viewString2 = _theme$viewString2.discount_coupon) === null || _theme$viewString2 === void 0 ? void 0 : _theme$viewString2.hidden) || (loginUser !== null && loginUser !== void 0 && loginUser.guest_id && guestCheckoutCupon ? !(guestCheckoutCupon !== null && guestCheckoutCupon !== void 0 && guestCheckoutCupon.enabled) : !(validationFields !== null && validationFields !== void 0 && (_validationFields$fie3 = validationFields.fields) !== null && _validationFields$fie3 !== void 0 && (_validationFields$fie3 = _validationFields$fie3.checkout) !== null && _validationFields$fie3 !== void 0 && (_validationFields$fie3 = _validationFields$fie3.comments) !== null && _validationFields$fie3 !== void 0 && _validationFields$fie3.enabled));
|
|
153
158
|
var cateringTypeString = (orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) === 8 ? 'catering_pickup' : null;
|
|
154
159
|
var cateringValues = businessConfigs && (0, _utils.getCateringValues)(cateringTypeString, businessConfigs);
|
|
155
160
|
var walletName = {
|
|
@@ -177,7 +182,6 @@ var CartUI = function CartUI(props) {
|
|
|
177
182
|
}
|
|
178
183
|
return acc = acc;
|
|
179
184
|
}, cart === null || cart === void 0 ? void 0 : cart.subtotal);
|
|
180
|
-
console.log('cart', cart);
|
|
181
185
|
var clearAmount = function clearAmount(value) {
|
|
182
186
|
var _configs$format_numbe, _configs$format_numbe2;
|
|
183
187
|
return parseFloat((Math.trunc(value * 100) / 100).toFixed((_configs$format_numbe = (_configs$format_numbe2 = configs.format_number_decimal_length) === null || _configs$format_numbe2 === void 0 ? void 0 : _configs$format_numbe2.value) !== null && _configs$format_numbe !== void 0 ? _configs$format_numbe : 2));
|
|
@@ -501,7 +505,7 @@ var CartUI = function CartUI(props) {
|
|
|
501
505
|
})), (cart === null || cart === void 0 ? void 0 : cart.driver_tip) > 0 && !hideDriverTip && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DRIVER_TIP', 'Driver tip'), ' ', (cart === null || cart === void 0 ? void 0 : cart.driver_tip_rate) > 0 && parseInt(configs === null || configs === void 0 || (_configs$driver_tip_t = configs.driver_tip_type) === null || _configs$driver_tip_t === void 0 ? void 0 : _configs$driver_tip_t.value, 10) === 2 && !parseInt(configs === null || configs === void 0 || (_configs$driver_tip_u = configs.driver_tip_use_custom) === null || _configs$driver_tip_u === void 0 ? void 0 : _configs$driver_tip_u.value, 10) && /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(cart === null || cart === void 0 ? void 0 : cart.driver_tip_rate, parseNumber), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.driver_tip))))), isCouponEnabled && !isCartPending && (isCheckout || isCartPopover || isMultiCheckout) && !(isCheckout && isCartPopover) && !hideCartDiscount && !hideCouponInput && /*#__PURE__*/_react.default.createElement(_styles.CouponContainer, null, /*#__PURE__*/_react.default.createElement(_CouponControl.CouponControl, {
|
|
502
506
|
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
503
507
|
price: cart === null || cart === void 0 ? void 0 : cart.total
|
|
504
|
-
})), !isStore && !isMultiCheckout && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 || (_validationFields$
|
|
508
|
+
})), !isStore && !isMultiCheckout && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 || (_validationFields$fie4 = validationFields.fields) === null || _validationFields$fie4 === void 0 || (_validationFields$fie4 = _validationFields$fie4.checkout) === null || _validationFields$fie4 === void 0 || (_validationFields$fie4 = _validationFields$fie4.driver_tip) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) && driverTipsOptions.length > 0 && !useKioskApp && !isCheckout && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.DriverTipContainer, null, /*#__PURE__*/_react.default.createElement("h1", null, t('DRIVER_TIPS', 'Driver Tips')), /*#__PURE__*/_react.default.createElement("p", null, t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')), /*#__PURE__*/_react.default.createElement(_DriverTips.DriverTips, {
|
|
505
509
|
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
506
510
|
driverTipsOptions: driverTipsOptions,
|
|
507
511
|
isFixedPrice: parseInt(configs === null || configs === void 0 || (_configs$driver_tip_t2 = configs.driver_tip_type) === null || _configs$driver_tip_t2 === void 0 ? void 0 : _configs$driver_tip_t2.value, 10) === 1,
|