ordering-ui-external 2.6.8 → 2.7.1
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.0a58ae9fc1a4bce64c6e.js +1 -0
- package/_bundles/{1.ordering-ui.ba64d5c9c7490676feb5.js → 1.ordering-ui.0a58ae9fc1a4bce64c6e.js} +1 -1
- package/_bundles/4.ordering-ui.0a58ae9fc1a4bce64c6e.js +1 -0
- package/_bundles/{5.ordering-ui.ba64d5c9c7490676feb5.js → 5.ordering-ui.0a58ae9fc1a4bce64c6e.js} +1 -1
- package/_bundles/{6.ordering-ui.ba64d5c9c7490676feb5.js → 6.ordering-ui.0a58ae9fc1a4bce64c6e.js} +1 -1
- package/_bundles/{7.ordering-ui.ba64d5c9c7490676feb5.js → 7.ordering-ui.0a58ae9fc1a4bce64c6e.js} +2 -2
- package/_bundles/ordering-ui.0a58ae9fc1a4bce64c6e.js +2 -0
- package/_modules/themes/five/index.js +21 -0
- package/_modules/themes/five/src/components/BusinessController/index.js +6 -2
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +5 -4
- package/_modules/themes/five/src/components/BusinessReviews/index.js +5 -8
- package/_modules/themes/five/src/components/Cart/index.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +10 -5
- package/_modules/themes/five/src/components/Header/index.js +10 -4
- package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +18 -8
- package/_modules/themes/five/src/components/ProductForm/styles.js +1 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +1 -1
- package/package.json +2 -2
- package/src/themes/five/index.js +6 -0
- package/src/themes/five/src/components/BusinessController/index.js +2 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +5 -4
- package/src/themes/five/src/components/BusinessReviews/index.js +5 -6
- package/src/themes/five/src/components/Cart/index.js +1 -1
- package/src/themes/five/src/components/Checkout/index.js +10 -7
- package/src/themes/five/src/components/Header/index.js +9 -4
- package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +21 -9
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -1
- package/template/app.js +13 -7
- package/template/pages/BusinessProductsList/index.js +4 -3
- package/template/pages/BusinessesList/index.js +2 -1
- package/template/pages/Checkout/index.js +1 -0
- package/template/pages/MyOrders/index.js +1 -0
- package/_bundles/0.ordering-ui.ba64d5c9c7490676feb5.js +0 -1
- package/_bundles/4.ordering-ui.ba64d5c9c7490676feb5.js +0 -1
- package/_bundles/ordering-ui.ba64d5c9c7490676feb5.js +0 -2
- /package/_bundles/{2.ordering-ui.ba64d5c9c7490676feb5.js → 2.ordering-ui.0a58ae9fc1a4bce64c6e.js} +0 -0
- /package/_bundles/{7.ordering-ui.ba64d5c9c7490676feb5.js.LICENSE.txt → 7.ordering-ui.0a58ae9fc1a4bce64c6e.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.ba64d5c9c7490676feb5.js → 8.ordering-ui.0a58ae9fc1a4bce64c6e.js} +0 -0
- /package/_bundles/{9.ordering-ui.ba64d5c9c7490676feb5.js → 9.ordering-ui.0a58ae9fc1a4bce64c6e.js} +0 -0
- /package/_bundles/{ordering-ui.ba64d5c9c7490676feb5.js.LICENSE.txt → ordering-ui.0a58ae9fc1a4bce64c6e.js.LICENSE.txt} +0 -0
|
@@ -171,6 +171,12 @@ Object.defineProperty(exports, "Checkout", {
|
|
|
171
171
|
return _Checkout.Checkout;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
+
Object.defineProperty(exports, "Confirm", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function get() {
|
|
177
|
+
return _Confirm.Confirm;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
174
180
|
Object.defineProperty(exports, "DriverTips", {
|
|
175
181
|
enumerable: true,
|
|
176
182
|
get: function get() {
|
|
@@ -621,6 +627,12 @@ Object.defineProperty(exports, "Select", {
|
|
|
621
627
|
return _Select.Select;
|
|
622
628
|
}
|
|
623
629
|
});
|
|
630
|
+
Object.defineProperty(exports, "SendGiftCard", {
|
|
631
|
+
enumerable: true,
|
|
632
|
+
get: function get() {
|
|
633
|
+
return _SendGiftCard.SendGiftCard;
|
|
634
|
+
}
|
|
635
|
+
});
|
|
624
636
|
Object.defineProperty(exports, "ServiceForm", {
|
|
625
637
|
enumerable: true,
|
|
626
638
|
get: function get() {
|
|
@@ -693,6 +705,12 @@ Object.defineProperty(exports, "Switch", {
|
|
|
693
705
|
return _Switch.Switch;
|
|
694
706
|
}
|
|
695
707
|
});
|
|
708
|
+
Object.defineProperty(exports, "TaxInformation", {
|
|
709
|
+
enumerable: true,
|
|
710
|
+
get: function get() {
|
|
711
|
+
return _TaxInformation.TaxInformation;
|
|
712
|
+
}
|
|
713
|
+
});
|
|
696
714
|
Object.defineProperty(exports, "TextArea", {
|
|
697
715
|
enumerable: true,
|
|
698
716
|
get: function get() {
|
|
@@ -864,6 +882,9 @@ var _ActionsSection = require("./src/components/OrderDetails/ActionsSection");
|
|
|
864
882
|
var _ProductShare = require("./src/components/ProductShare");
|
|
865
883
|
var _MultiCart = require("./src/components/MultiCart");
|
|
866
884
|
var _QueryLoginSpoonity = require("./src/components/QueryLoginSpoonity");
|
|
885
|
+
var _Confirm = require("./src/components/Confirm");
|
|
886
|
+
var _TaxInformation = require("./src/components/TaxInformation");
|
|
887
|
+
var _SendGiftCard = require("./src/components/GiftCard/SendGiftCard");
|
|
867
888
|
var _Buttons = require("./src/styles/Buttons");
|
|
868
889
|
var _Inputs = require("./src/styles/Inputs");
|
|
869
890
|
var _Select = require("./src/styles/Select");
|
|
@@ -116,9 +116,13 @@ var BusinessControllerUI = function BusinessControllerUI(props) {
|
|
|
116
116
|
// }
|
|
117
117
|
|
|
118
118
|
var handleBusinessClick = function handleBusinessClick(e) {
|
|
119
|
-
var _favoriteRef$current;
|
|
119
|
+
var _favoriteRef$current, _business$menus;
|
|
120
120
|
if (favoriteRef !== null && favoriteRef !== void 0 && (_favoriteRef$current = favoriteRef.current) !== null && _favoriteRef$current !== void 0 && _favoriteRef$current.contains(e.target)) return;
|
|
121
|
-
|
|
121
|
+
var hasMenu = business === null || business === void 0 ? void 0 : (_business$menus = business.menus) === null || _business$menus === void 0 ? void 0 : _business$menus.filter(function (menu) {
|
|
122
|
+
var _menu$products;
|
|
123
|
+
return (menu === null || menu === void 0 ? void 0 : menu.enabled) && (menu === null || menu === void 0 ? void 0 : (_menu$products = menu.products) === null || _menu$products === void 0 ? void 0 : _menu$products.length) > 0;
|
|
124
|
+
}).length;
|
|
125
|
+
if (onPreorderBusiness && (!isBusinessOpen || !hasMenu)) onPreorderBusiness(business);else handleClick(business);
|
|
122
126
|
};
|
|
123
127
|
var handleChangeFavorite = function handleChangeFavorite() {
|
|
124
128
|
if (auth) {
|
|
@@ -79,7 +79,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
79
79
|
onBusinessClick = props.onBusinessClick,
|
|
80
80
|
handleChangePriceFilterValues = props.handleChangePriceFilterValues,
|
|
81
81
|
priceFilterValues = props.priceFilterValues,
|
|
82
|
-
handleUpdateProfessionals = props.handleUpdateProfessionals
|
|
82
|
+
handleUpdateProfessionals = props.handleUpdateProfessionals,
|
|
83
|
+
isCustomLayout = props.isCustomLayout;
|
|
83
84
|
var business = businessState.business,
|
|
84
85
|
loading = businessState.loading,
|
|
85
86
|
error = businessState.error;
|
|
@@ -309,7 +310,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
309
310
|
while (1) switch (_context2.prev = _context2.next) {
|
|
310
311
|
case 0:
|
|
311
312
|
_carts = carts === null || carts === void 0 ? void 0 : carts[adjustBusinessId];
|
|
312
|
-
products = carts === null || carts === void 0 ? void 0 : (_carts$adjustBusiness = carts[adjustBusinessId]) === null || _carts$adjustBusiness === void 0 ? void 0 : _carts$adjustBusiness.products;
|
|
313
|
+
products = (carts === null || carts === void 0 ? void 0 : (_carts$adjustBusiness = carts[adjustBusinessId]) === null || _carts$adjustBusiness === void 0 ? void 0 : _carts$adjustBusiness.products) || [];
|
|
313
314
|
unavailableProducts = products.filter(function (product) {
|
|
314
315
|
return product.valid !== true;
|
|
315
316
|
});
|
|
@@ -422,7 +423,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
422
423
|
setBusiness({});
|
|
423
424
|
};
|
|
424
425
|
}, [cateringPreorder, business]);
|
|
425
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ProductsContainer, null, !props.useKioskApp && /*#__PURE__*/_react.default.createElement(_styles.HeaderContent, null, !location.pathname.includes('/marketplace') && /*#__PURE__*/_react.default.createElement("div", {
|
|
426
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ProductsContainer, null, !props.useKioskApp && /*#__PURE__*/_react.default.createElement(_styles.HeaderContent, null, !isCustomLayout && !location.pathname.includes('/marketplace') && /*#__PURE__*/_react.default.createElement("div", {
|
|
426
427
|
id: "back-arrow"
|
|
427
428
|
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ArrowLeft, {
|
|
428
429
|
className: "back-arrow",
|
|
@@ -444,8 +445,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
444
445
|
businessState: businessState,
|
|
445
446
|
sortByOptions: sortByOptions,
|
|
446
447
|
categoryState: categoryState,
|
|
448
|
+
isCustomLayout: isCustomLayout,
|
|
447
449
|
categoriesState: props.categoriesState,
|
|
448
|
-
isCustomLayout: props.isCustomLayout,
|
|
449
450
|
useKioskApp: props.useKioskApp,
|
|
450
451
|
categorySelected: categorySelected,
|
|
451
452
|
openCategories: openCategories,
|
|
@@ -31,7 +31,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
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; } }
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
34
|
-
var
|
|
34
|
+
var _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view7, _theme$business_view8, _theme$business_view9, _theme$business_view10, _theme$business_view11, _theme$business_view12, _theme$business_view13, _theme$business_view14, _theme$business_view15, _theme$business_view16, _props$beforeElements, _props$beforeComponen, _theme$images, _theme$images$general, _props$afterComponent, _props$afterElements;
|
|
35
35
|
var stars = props.stars,
|
|
36
36
|
reviewsList = props.reviewsList,
|
|
37
37
|
handleClickOption = props.handleClickOption,
|
|
@@ -42,19 +42,16 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
42
42
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
43
43
|
_useTheme2 = _slicedToArray(_useTheme, 1),
|
|
44
44
|
theme = _useTheme2[0];
|
|
45
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
46
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
47
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
48
45
|
var handleOnChange = function handleOnChange(evt) {
|
|
49
46
|
if (evt.target.value) onChangeReview(evt.target.value);else onChangeReview('');
|
|
50
47
|
};
|
|
51
48
|
var handleClickRaiting = function handleClickRaiting(raiting) {
|
|
52
49
|
if (raiting) handleClickOption(raiting);
|
|
53
50
|
};
|
|
54
|
-
var showRanking = !(
|
|
55
|
-
var showReviewDate = !(
|
|
56
|
-
var showCustomerComments = !(
|
|
57
|
-
var showSearch = !(
|
|
51
|
+
var showRanking = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view$ = _theme$business_view.components) !== null && _theme$business_view$ !== void 0 && (_theme$business_view$2 = _theme$business_view$.review) !== null && _theme$business_view$2 !== void 0 && (_theme$business_view$3 = _theme$business_view$2.components) !== null && _theme$business_view$3 !== void 0 && (_theme$business_view$4 = _theme$business_view$3.ranking) !== null && _theme$business_view$4 !== void 0 && _theme$business_view$4.hidden);
|
|
52
|
+
var showReviewDate = !(theme !== null && theme !== void 0 && (_theme$business_view2 = theme.business_view) !== null && _theme$business_view2 !== void 0 && (_theme$business_view3 = _theme$business_view2.components) !== null && _theme$business_view3 !== void 0 && (_theme$business_view4 = _theme$business_view3.review) !== null && _theme$business_view4 !== void 0 && (_theme$business_view5 = _theme$business_view4.components) !== null && _theme$business_view5 !== void 0 && (_theme$business_view6 = _theme$business_view5.review_date) !== null && _theme$business_view6 !== void 0 && _theme$business_view6.hidden);
|
|
53
|
+
var showCustomerComments = !(theme !== null && theme !== void 0 && (_theme$business_view7 = theme.business_view) !== null && _theme$business_view7 !== void 0 && (_theme$business_view8 = _theme$business_view7.components) !== null && _theme$business_view8 !== void 0 && (_theme$business_view9 = _theme$business_view8.review) !== null && _theme$business_view9 !== void 0 && (_theme$business_view10 = _theme$business_view9.components) !== null && _theme$business_view10 !== void 0 && (_theme$business_view11 = _theme$business_view10.customer_comments) !== null && _theme$business_view11 !== void 0 && _theme$business_view11.hidden);
|
|
54
|
+
var showSearch = !(theme !== null && theme !== void 0 && (_theme$business_view12 = theme.business_view) !== null && _theme$business_view12 !== void 0 && (_theme$business_view13 = _theme$business_view12.components) !== null && _theme$business_view13 !== void 0 && (_theme$business_view14 = _theme$business_view13.review) !== null && _theme$business_view14 !== void 0 && (_theme$business_view15 = _theme$business_view14.components) !== null && _theme$business_view15 !== void 0 && (_theme$business_view16 = _theme$business_view15.search) !== null && _theme$business_view16 !== void 0 && _theme$business_view16.hidden);
|
|
58
55
|
var hideElement = !(!showReviewDate && !showCustomerComments);
|
|
59
56
|
var reviewPoints = [1, 2, 3, 4, 5];
|
|
60
57
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
|
@@ -454,7 +454,7 @@ var CartUI = function CartUI(props) {
|
|
|
454
454
|
return onRemoveOffer(offer === null || offer === void 0 ? void 0 : offer.id);
|
|
455
455
|
}
|
|
456
456
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 ? void 0 : (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount)));
|
|
457
|
-
})), (orderState === null || orderState === void 0 ? void 0 : (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 1 &&
|
|
457
|
+
})), (orderState === null || orderState === void 0 ? void 0 : (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 1 && !hideDeliveryFee && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.delivery_price_with_discount))), !hideCartDiscount && (cart === null || cart === void 0 ? void 0 : (_cart$offers7 = cart.offers) === null || _cart$offers7 === void 0 ? void 0 : _cart$offers7.length) > 0 && (cart === null || cart === void 0 ? void 0 : (_cart$offers8 = cart.offers) === null || _cart$offers8 === void 0 ? void 0 : (_cart$offers8$filter = _cart$offers8.filter(function (offer) {
|
|
458
458
|
return (offer === null || offer === void 0 ? void 0 : offer.target) === 2;
|
|
459
459
|
})) === null || _cart$offers8$filter === void 0 ? void 0 : _cart$offers8$filter.map(function (offer) {
|
|
460
460
|
var _offer$summary3;
|
|
@@ -622,7 +622,8 @@ var Checkout = function Checkout(props) {
|
|
|
622
622
|
handleOrderRedirect = props.handleOrderRedirect,
|
|
623
623
|
handleCheckoutRedirect = props.handleCheckoutRedirect,
|
|
624
624
|
handleSearchRedirect = props.handleSearchRedirect,
|
|
625
|
-
handleCheckoutListRedirect = props.handleCheckoutListRedirect
|
|
625
|
+
handleCheckoutListRedirect = props.handleCheckoutListRedirect,
|
|
626
|
+
businessSlug = props.businessSlug;
|
|
626
627
|
var _useOrder3 = (0, _orderingComponentsExternal.useOrder)(),
|
|
627
628
|
_useOrder4 = _slicedToArray(_useOrder3, 2),
|
|
628
629
|
orderState = _useOrder4[0],
|
|
@@ -671,6 +672,10 @@ var Checkout = function Checkout(props) {
|
|
|
671
672
|
var _cart$products3;
|
|
672
673
|
return (cart === null || cart === void 0 ? void 0 : cart.products) && (cart === null || cart === void 0 ? void 0 : (_cart$products3 = cart.products) === null || _cart$products3 === void 0 ? void 0 : _cart$products3.length);
|
|
673
674
|
})) || null);
|
|
675
|
+
var carts = businessSlug ? cartsWithProducts.filter(function (cart) {
|
|
676
|
+
var _cart$business6;
|
|
677
|
+
return (cart === null || cart === void 0 ? void 0 : (_cart$business6 = cart.business) === null || _cart$business6 === void 0 ? void 0 : _cart$business6.slug) === businessSlug || businessSlug === (cart === null || cart === void 0 ? void 0 : cart.business_id);
|
|
678
|
+
}) : cartsWithProducts;
|
|
674
679
|
var closeAlert = function closeAlert() {
|
|
675
680
|
setAlertState({
|
|
676
681
|
open: false,
|
|
@@ -713,7 +718,7 @@ var Checkout = function Checkout(props) {
|
|
|
713
718
|
case 0:
|
|
714
719
|
_context.prev = 0;
|
|
715
720
|
result = {};
|
|
716
|
-
cart =
|
|
721
|
+
cart = carts.find(function (cart) {
|
|
717
722
|
return cart.uuid === cartId;
|
|
718
723
|
});
|
|
719
724
|
userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
@@ -853,12 +858,12 @@ var Checkout = function Checkout(props) {
|
|
|
853
858
|
isResetPaymethod: isResetPaymethod,
|
|
854
859
|
setIsResetPaymethod: setIsResetPaymethod
|
|
855
860
|
});
|
|
856
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !cartUuid && orderState.carts &&
|
|
861
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !cartUuid && orderState.carts && carts && (carts === null || carts === void 0 ? void 0 : carts.length) === 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
857
862
|
content: t('NOT_FOUND_CARTS', 'Sorry, You don\'t seem to have any carts.'),
|
|
858
863
|
btnTitle: t('SEARCH_REDIRECT', 'Go to Businesses'),
|
|
859
864
|
onClickButton: handleSearchRedirect
|
|
860
|
-
}), !cartUuid && orderState.carts &&
|
|
861
|
-
carts:
|
|
865
|
+
}), !cartUuid && orderState.carts && carts && (carts === null || carts === void 0 ? void 0 : carts.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.CartsList, null, /*#__PURE__*/_react.default.createElement(_CartContent.CartContent, {
|
|
866
|
+
carts: carts,
|
|
862
867
|
isOrderStateCarts: !!orderState.carts,
|
|
863
868
|
isForceOpenCart: true
|
|
864
869
|
})), cartUuid && cartState.error && ((_cartState$error = cartState.error) === null || _cartState$error === void 0 ? void 0 : _cartState$error.length) > 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
@@ -58,7 +58,9 @@ var Header = function Header(props) {
|
|
|
58
58
|
isHideSignup = props.isHideSignup,
|
|
59
59
|
isCustomerMode = props.isCustomerMode,
|
|
60
60
|
searchValue = props.searchValue,
|
|
61
|
-
setSearchValue = props.setSearchValue
|
|
61
|
+
setSearchValue = props.setSearchValue,
|
|
62
|
+
businessSlug = props.businessSlug,
|
|
63
|
+
notificationState = props.notificationState;
|
|
62
64
|
var _useLocation = (0, _reactRouterDom.useLocation)(),
|
|
63
65
|
pathname = _useLocation.pathname;
|
|
64
66
|
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
@@ -146,6 +148,10 @@ var Header = function Header(props) {
|
|
|
146
148
|
var _cart$products;
|
|
147
149
|
return cart.products && ((_cart$products = cart.products) === null || _cart$products === void 0 ? void 0 : _cart$products.length) > 0;
|
|
148
150
|
}) || null;
|
|
151
|
+
var carts = businessSlug ? cartsWithProducts.filter(function (cart) {
|
|
152
|
+
var _cart$business;
|
|
153
|
+
return (cart === null || cart === void 0 ? void 0 : (_cart$business = cart.business) === null || _cart$business === void 0 ? void 0 : _cart$business.slug) === businessSlug || businessSlug === (cart === null || cart === void 0 ? void 0 : cart.business_id);
|
|
154
|
+
}) : cartsWithProducts;
|
|
149
155
|
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
150
156
|
var onlineStatus = (0, _useOnlineStatus.useOnlineStatus)();
|
|
151
157
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
@@ -366,7 +372,7 @@ var Header = function Header(props) {
|
|
|
366
372
|
}
|
|
367
373
|
}, t('SIGN_UP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag3 = theme.defaultLanguages) === null || _theme$defaultLanguag3 === void 0 ? void 0 : _theme$defaultLanguag3.SIGN_UP) || 'Sign up'))), auth && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isShowOrderOptions && (windowSize.width > 768 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isMulticheckoutPage ? /*#__PURE__*/_react.default.createElement(_CartPopover.CartPopover, {
|
|
368
374
|
open: openPopover.cart,
|
|
369
|
-
carts:
|
|
375
|
+
carts: carts,
|
|
370
376
|
onClick: function onClick() {
|
|
371
377
|
return handleTogglePopover('cart');
|
|
372
378
|
},
|
|
@@ -379,7 +385,7 @@ var Header = function Header(props) {
|
|
|
379
385
|
setPreorderBusiness: setPreorderBusiness
|
|
380
386
|
}) : null) : /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
381
387
|
variant: "cart",
|
|
382
|
-
totalCarts:
|
|
388
|
+
totalCarts: carts === null || carts === void 0 ? void 0 : carts.length,
|
|
383
389
|
onClick: function onClick(variant) {
|
|
384
390
|
return openModal(variant);
|
|
385
391
|
}
|
|
@@ -431,7 +437,7 @@ var Header = function Header(props) {
|
|
|
431
437
|
},
|
|
432
438
|
width: modalSelected === 'address' ? orderState !== null && orderState !== void 0 && (_orderState$options17 = orderState.options) !== null && _orderState$options17 !== void 0 && _orderState$options17.user_id ? '70%' : '50%' : '700px'
|
|
433
439
|
}), modalSelected === 'cart' && /*#__PURE__*/_react.default.createElement(_CartContent.CartContent, {
|
|
434
|
-
carts:
|
|
440
|
+
carts: carts,
|
|
435
441
|
isOrderStateCarts: !!orderState.carts,
|
|
436
442
|
onClose: function onClose() {
|
|
437
443
|
return setModalIsOpen(false);
|
|
@@ -134,7 +134,7 @@ var OrderBillSection = function OrderBillSection(props) {
|
|
|
134
134
|
size: "20",
|
|
135
135
|
color: theme.colors.primary
|
|
136
136
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 ? void 0 : (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount)));
|
|
137
|
-
})), (order === null || order === void 0 ? void 0 : (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price)
|
|
137
|
+
})), typeof (order === null || order === void 0 ? void 0 : (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price) === 'number' && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.DELIVERY_FEE) || 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(order === null || order === void 0 ? void 0 : (_order$summary13 = order.summary) === null || _order$summary13 === void 0 ? void 0 : _order$summary13.delivery_price))), (order === null || order === void 0 ? void 0 : (_order$offers6 = order.offers) === null || _order$offers6 === void 0 ? void 0 : _order$offers6.length) > 0 && (order === null || order === void 0 ? void 0 : (_order$offers7 = order.offers) === null || _order$offers7 === void 0 ? void 0 : (_order$offers7$filter = _order$offers7.filter(function (offer) {
|
|
138
138
|
return (offer === null || offer === void 0 ? void 0 : offer.target) === 2;
|
|
139
139
|
})) === null || _order$offers7$filter === void 0 ? void 0 : _order$offers7$filter.map(function (offer) {
|
|
140
140
|
var _offer$name3, _offer$name3$toUpperC, _offer$summary3;
|
|
@@ -28,13 +28,27 @@ var OrderEta = function OrderEta(props) {
|
|
|
28
28
|
estimatedDeliveryTime = _useState2[0],
|
|
29
29
|
setEstimatedDeliveryTime = _useState2[1];
|
|
30
30
|
var getEstimatedDeliveryTime = function getEstimatedDeliveryTime() {
|
|
31
|
-
var
|
|
31
|
+
var estimatedUtcTime = null;
|
|
32
32
|
var totalEta = 0;
|
|
33
|
+
if (order !== null && order !== void 0 && order.delivered_in) totalEta += order === null || order === void 0 ? void 0 : order.delivered_in;
|
|
34
|
+
if (order !== null && order !== void 0 && order.prepared_in) totalEta += order === null || order === void 0 ? void 0 : order.prepared_in;
|
|
35
|
+
if ((order === null || order === void 0 ? void 0 : order.delivery_type) === 1 && order !== null && order !== void 0 && order.eta_drive_time) {
|
|
36
|
+
totalEta += order === null || order === void 0 ? void 0 : order.eta_drive_time;
|
|
37
|
+
}
|
|
33
38
|
var _delivery = order !== null && order !== void 0 && order.delivery_datetime_utc ? order === null || order === void 0 ? void 0 : order.delivery_datetime_utc : order === null || order === void 0 ? void 0 : order.delivery_datetime;
|
|
34
39
|
if (order !== null && order !== void 0 && order.eta_current_status_time) {
|
|
35
40
|
var _order$reporting_data;
|
|
36
41
|
var currentStatueEta = order === null || order === void 0 ? void 0 : order.eta_current_status_time;
|
|
37
42
|
totalEta += currentStatueEta;
|
|
43
|
+
var previousStatusTimes = 0;
|
|
44
|
+
if (order !== null && order !== void 0 && order.eta_previous_status_times) {
|
|
45
|
+
Object.keys(order.eta_previous_status_times).map(function (key) {
|
|
46
|
+
if (!key.includes('status_penalty')) {
|
|
47
|
+
previousStatusTimes += order.eta_previous_status_times[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
totalEta += previousStatusTimes;
|
|
38
52
|
var nextStatusTimes = 0;
|
|
39
53
|
if (order !== null && order !== void 0 && order.eta_next_status_times) {
|
|
40
54
|
Object.keys(order.eta_next_status_times).map(function (key) {
|
|
@@ -49,15 +63,11 @@ var OrderEta = function OrderEta(props) {
|
|
|
49
63
|
if (diffTimeAsMinutes <= 0) {
|
|
50
64
|
totalEta += Math.floor(Math.abs(diffTimeAsMinutes / (order === null || order === void 0 ? void 0 : order.eta_current_status_time)) + 1) * (order === null || order === void 0 ? void 0 : order.eta_current_status_penalty_time);
|
|
51
65
|
}
|
|
52
|
-
_estimatedTime = _moment.default.utc(_delivery).add(totalEta, 'minutes');
|
|
53
66
|
} else {
|
|
54
|
-
|
|
55
|
-
if (order !== null && order !== void 0 && order.delivered_in) timesToAdd += order === null || order === void 0 ? void 0 : order.delivered_in;
|
|
56
|
-
if (order !== null && order !== void 0 && order.prepared_in) timesToAdd += order === null || order === void 0 ? void 0 : order.prepared_in;
|
|
57
|
-
var _etaTime = (order === null || order === void 0 ? void 0 : order.eta_time) + timesToAdd;
|
|
58
|
-
_estimatedTime = _moment.default.utc(_delivery).add(_etaTime, 'minutes');
|
|
67
|
+
totalEta = (order === null || order === void 0 ? void 0 : order.eta_time) + totalEta;
|
|
59
68
|
}
|
|
60
|
-
|
|
69
|
+
estimatedUtcTime = _moment.default.utc(_delivery).add(totalEta, 'minutes');
|
|
70
|
+
var _estimatedTime = outputFormat ? (0, _moment.default)(estimatedUtcTime).local().format(outputFormat) : parseDate(estimatedUtcTime, {
|
|
61
71
|
utc: false
|
|
62
72
|
});
|
|
63
73
|
setEstimatedDeliveryTime(_estimatedTime);
|
|
@@ -72,7 +72,7 @@ var SectionTitle = _styledComponents.default.h3(_templateObject18 || (_templateO
|
|
|
72
72
|
exports.SectionTitle = SectionTitle;
|
|
73
73
|
var ProductComment = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin-bottom: 130px;\n\n textarea {\n margin-top: 8px;\n }\n\n p {\n font-weight: 300;\n margin-bottom: 5px;\n }\n\n @media (min-width: 577px) {\n margin-bottom: 62px;\n }\n\n @media (min-width: 769px) {\n margin-bottom: 0px;\n padding-bottom: 10px;\n }\n"])));
|
|
74
74
|
exports.ProductComment = ProductComment;
|
|
75
|
-
var ProductActions = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n width: 100%;\n z-index: 9999997;\n\n position: fixed;\n bottom: 0;\n right: 0;\n width: 100%;\n background-color: #FFF;\n\n div.price {\n padding-top: 10px;\n color: ", ";\n h4 {\n margin: 0;\n font-weight: 600;\n font-size: 20px;\n line-height: 20px;\n }\n span {\n font-size: 13px;\n color: #D83520;\n line-height: 15px;\n }\n }\n\n div.incdec-control {\n width: 135px;\n display: flex;\n justify-content: space-around;\n align-items: center;\n position: relative;\n\n svg {\n width: 25px;\n height: 25px;\n cursor: pointer;\n }\n }\n\n div.price-amount-block {\n display: flex;\n justify-content: space-between;\n width: 70%\n }\n\n svg {\n color: ", ";\n }\n\n svg.disabled {\n pointer-events: none;\n color: #CED4DA;\n }\n\n button:disabled,\n button.disabled {\n background: #E9ECEF;\n border: 1px solid #E9ECEF;\n color: #B1BCCC;\n }\n\n button.add {\n width: 90%;\n padding: 5px 10px;\n margin-top: 10px;\n position: relative;\n\n &.soldout {\n width: 100%;\n pointer-events: none;\n }\n }\n .qty {\n flex: 1;\n text-align: center;\n display: flex;\n align-items: center;\n height: 38px;\n min-width: 60px;\n box-sizing: border-box;\n padding: 0;\n margin: 0 10px;\n }\n\n #address_control {\n button.add {\n width: calc(100% - 20px) !important;\n margin: 10px 10px 0 10px;\n }\n }\n \n div#address_list {\n padding: 0;\n }\n\n @media (min-width: 577px) {\n position: sticky;\n }\n\n @media (min-width: 1200px) {\n bottom: 0px;\n flex-direction: row;\n justify-content: space-between;\n border-top: 1px solid #E9ECEF;\n width: calc(100% + 40px);\n transform: translateX(-20px);\n padding: 10px 20px;\n box-sizing: border-box;\n\n ", "\n\n div.price {\n width: 25%;\n }\n\n button.add {\n width: 35%;\n margin-top: 0;\n }\n\n div.incdec-control {\n
|
|
75
|
+
var ProductActions = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n width: 100%;\n z-index: 9999997;\n\n position: fixed;\n bottom: 0;\n right: 0;\n width: 100%;\n background-color: #FFF;\n\n div.price {\n padding-top: 10px;\n color: ", ";\n h4 {\n margin: 0;\n font-weight: 600;\n font-size: 20px;\n line-height: 20px;\n }\n span {\n font-size: 13px;\n color: #D83520;\n line-height: 15px;\n }\n }\n\n div.incdec-control {\n width: 135px;\n display: flex;\n justify-content: space-around;\n align-items: center;\n position: relative;\n\n svg {\n width: 25px;\n height: 25px;\n cursor: pointer;\n }\n }\n\n div.price-amount-block {\n display: flex;\n justify-content: space-between;\n width: 70%\n }\n\n svg {\n color: ", ";\n }\n\n svg.disabled {\n pointer-events: none;\n color: #CED4DA;\n }\n\n button:disabled,\n button.disabled {\n background: #E9ECEF;\n border: 1px solid #E9ECEF;\n color: #B1BCCC;\n }\n\n button.add {\n width: 90%;\n padding: 5px 10px;\n margin-top: 10px;\n position: relative;\n\n &.soldout {\n width: 100%;\n pointer-events: none;\n }\n }\n .qty {\n flex: 1;\n text-align: center;\n display: flex;\n align-items: center;\n height: 38px;\n min-width: 60px;\n box-sizing: border-box;\n padding: 0;\n margin: 0 10px;\n }\n\n #address_control {\n button.add {\n width: calc(100% - 20px) !important;\n margin: 10px 10px 0 10px;\n }\n }\n \n div#address_list {\n padding: 0;\n }\n\n @media (min-width: 577px) {\n position: sticky;\n }\n\n @media (min-width: 1200px) {\n bottom: 0px;\n flex-direction: row;\n justify-content: space-between;\n border-top: 1px solid #E9ECEF;\n width: calc(100% + 40px);\n transform: translateX(-20px);\n padding: 10px 20px;\n box-sizing: border-box;\n\n ", "\n\n div.price {\n width: 25%;\n }\n\n button.add {\n width: 35%;\n margin-top: 0;\n }\n\n div.incdec-control {\n margin-right: 18%;\n &.show-weight-unit{\n width: 30%;\n }\n }\n }\n"])), function (props) {
|
|
76
76
|
var _props$theme;
|
|
77
77
|
return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.colors.darkTextColor;
|
|
78
78
|
}, function (props) {
|
|
@@ -149,7 +149,7 @@ var RenderProductsLayout = function RenderProductsLayout(props) {
|
|
|
149
149
|
}, [categoryClicked]);
|
|
150
150
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isLoading && (business === null || business === void 0 ? void 0 : business.id) && /*#__PURE__*/_react.default.createElement(_styles.WrappLayout, {
|
|
151
151
|
isCartOnProductsList: isCartOnProductsList
|
|
152
|
-
}, (!hideBusinessNearCity && !useKioskApp || props.forceShowNearBusiness) && /*#__PURE__*/_react.default.createElement(_styles.NearBusiness, null, /*#__PURE__*/_react.default.createElement(_BusinessesListing.BusinessesListing, {
|
|
152
|
+
}, (!hideBusinessNearCity && !useKioskApp || props.forceShowNearBusiness) && !isCustomLayout && /*#__PURE__*/_react.default.createElement(_styles.NearBusiness, null, /*#__PURE__*/_react.default.createElement(_BusinessesListing.BusinessesListing, {
|
|
153
153
|
logosLayout: true,
|
|
154
154
|
propsToFetch: ['id', 'logo', 'location', 'timezone', 'schedule', 'open', 'slug'],
|
|
155
155
|
cityId: businessState === null || businessState === void 0 ? void 0 : (_businessState$busine = businessState.business) === null || _businessState$busine === void 0 ? void 0 : _businessState$busine.city_id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"lodash": "^4.17.19",
|
|
88
88
|
"moment": "^2.29.4",
|
|
89
89
|
"nanoid": "^4.0.0",
|
|
90
|
-
"ordering-components-external": "2.
|
|
90
|
+
"ordering-components-external": "2.8.0",
|
|
91
91
|
"payment": "^2.4.6",
|
|
92
92
|
"polished": "^3.6.6",
|
|
93
93
|
"react-bootstrap-icons": "^1.7.2",
|
package/src/themes/five/index.js
CHANGED
|
@@ -115,6 +115,9 @@ import { ActionsSection } from './src/components/OrderDetails/ActionsSection'
|
|
|
115
115
|
import { ProductShare } from './src/components/ProductShare'
|
|
116
116
|
import { MultiCart } from './src/components/MultiCart'
|
|
117
117
|
import { QueryLoginSpoonity } from './src/components/QueryLoginSpoonity'
|
|
118
|
+
import { Confirm } from './src/components/Confirm'
|
|
119
|
+
import { TaxInformation } from './src/components/TaxInformation'
|
|
120
|
+
import { SendGiftCard } from './src/components/GiftCard/SendGiftCard'
|
|
118
121
|
|
|
119
122
|
import { Button } from './src/styles/Buttons'
|
|
120
123
|
import { Input, TextArea } from './src/styles/Inputs'
|
|
@@ -241,6 +244,9 @@ export {
|
|
|
241
244
|
ProductShare,
|
|
242
245
|
MultiCart,
|
|
243
246
|
QueryLoginSpoonity,
|
|
247
|
+
Confirm,
|
|
248
|
+
TaxInformation,
|
|
249
|
+
SendGiftCard,
|
|
244
250
|
// styles
|
|
245
251
|
Button,
|
|
246
252
|
Input,
|
|
@@ -95,8 +95,8 @@ const BusinessControllerUI = (props) => {
|
|
|
95
95
|
|
|
96
96
|
const handleBusinessClick = (e) => {
|
|
97
97
|
if (favoriteRef?.current?.contains(e.target)) return
|
|
98
|
-
|
|
99
|
-
if (onPreorderBusiness && !isBusinessOpen) onPreorderBusiness(business)
|
|
98
|
+
const hasMenu = business?.menus?.filter(menu => menu?.enabled && menu?.products?.length > 0).length
|
|
99
|
+
if (onPreorderBusiness && (!isBusinessOpen || !hasMenu)) onPreorderBusiness(business)
|
|
100
100
|
else handleClick(business)
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -83,7 +83,8 @@ const BusinessProductsListingUI = (props) => {
|
|
|
83
83
|
onBusinessClick,
|
|
84
84
|
handleChangePriceFilterValues,
|
|
85
85
|
priceFilterValues,
|
|
86
|
-
handleUpdateProfessionals
|
|
86
|
+
handleUpdateProfessionals,
|
|
87
|
+
isCustomLayout
|
|
87
88
|
} = props
|
|
88
89
|
|
|
89
90
|
const { business, loading, error } = businessState
|
|
@@ -224,7 +225,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
224
225
|
}
|
|
225
226
|
const adjustBusiness = async (adjustBusinessId) => {
|
|
226
227
|
const _carts = carts?.[adjustBusinessId]
|
|
227
|
-
const products = carts?.[adjustBusinessId]?.products
|
|
228
|
+
const products = carts?.[adjustBusinessId]?.products || []
|
|
228
229
|
const unavailableProducts = products.filter(product => product.valid !== true)
|
|
229
230
|
const alreadyRemoved = sessionStorage.getItem('already-removed')
|
|
230
231
|
sessionStorage.removeItem('already-removed')
|
|
@@ -327,7 +328,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
327
328
|
<ProductsContainer>
|
|
328
329
|
{!props.useKioskApp && (
|
|
329
330
|
<HeaderContent>
|
|
330
|
-
{!location.pathname.includes('/marketplace') && (
|
|
331
|
+
{!isCustomLayout && !location.pathname.includes('/marketplace') && (
|
|
331
332
|
<div id='back-arrow'>
|
|
332
333
|
<ArrowLeft className='back-arrow' onClick={() => handleGoToBusinessList()} />
|
|
333
334
|
</div>
|
|
@@ -352,8 +353,8 @@ const BusinessProductsListingUI = (props) => {
|
|
|
352
353
|
businessState={businessState}
|
|
353
354
|
sortByOptions={sortByOptions}
|
|
354
355
|
categoryState={categoryState}
|
|
356
|
+
isCustomLayout={isCustomLayout}
|
|
355
357
|
categoriesState={props.categoriesState}
|
|
356
|
-
isCustomLayout={props.isCustomLayout}
|
|
357
358
|
useKioskApp={props.useKioskApp}
|
|
358
359
|
categorySelected={categorySelected}
|
|
359
360
|
openCategories={openCategories}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
|
-
import { BusinessReviews as BusinessReviewController, useLanguage
|
|
3
|
+
import { BusinessReviews as BusinessReviewController, useLanguage } from 'ordering-components-external'
|
|
4
4
|
import { useTheme } from '../../../../../contexts/ThemeContext'
|
|
5
5
|
import moment from 'moment'
|
|
6
6
|
|
|
@@ -30,7 +30,6 @@ export const BusinessReviewsUI = (props) => {
|
|
|
30
30
|
const { stars, reviewsList, handleClickOption, onChangeReview } = props
|
|
31
31
|
const [, t] = useLanguage()
|
|
32
32
|
const [theme] = useTheme()
|
|
33
|
-
const [orderingTheme] = useOrderingTheme()
|
|
34
33
|
const handleOnChange = (evt) => {
|
|
35
34
|
if (evt.target.value) onChangeReview(evt.target.value)
|
|
36
35
|
else onChangeReview('')
|
|
@@ -39,10 +38,10 @@ export const BusinessReviewsUI = (props) => {
|
|
|
39
38
|
if (raiting) handleClickOption(raiting)
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
const showRanking = !
|
|
43
|
-
const showReviewDate = !
|
|
44
|
-
const showCustomerComments = !
|
|
45
|
-
const showSearch = !
|
|
41
|
+
const showRanking = !theme?.business_view?.components?.review?.components?.ranking?.hidden
|
|
42
|
+
const showReviewDate = !theme?.business_view?.components?.review?.components?.review_date?.hidden
|
|
43
|
+
const showCustomerComments = !theme?.business_view?.components?.review?.components?.customer_comments?.hidden
|
|
44
|
+
const showSearch = !theme?.business_view?.components?.review?.components?.search?.hidden
|
|
46
45
|
const hideElement = !(!showReviewDate && !showCustomerComments)
|
|
47
46
|
|
|
48
47
|
const reviewPoints = [1, 2, 3, 4, 5]
|
|
@@ -421,7 +421,7 @@ const CartUI = (props) => {
|
|
|
421
421
|
</tr>
|
|
422
422
|
))
|
|
423
423
|
}
|
|
424
|
-
{orderState?.options?.type === 1 &&
|
|
424
|
+
{orderState?.options?.type === 1 && !hideDeliveryFee && (
|
|
425
425
|
<tr>
|
|
426
426
|
<td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
|
|
427
427
|
<td>{parsePrice(cart?.delivery_price_with_discount)}</td>
|
|
@@ -3,7 +3,7 @@ import VscWarning from '@meronex/icons/vsc/VscWarning'
|
|
|
3
3
|
import Skeleton from 'react-loading-skeleton'
|
|
4
4
|
import { useTheme } from 'styled-components'
|
|
5
5
|
import { Modal } from '../Modal'
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
7
|
Checkout as CheckoutController,
|
|
8
8
|
useOrder,
|
|
9
9
|
useSession,
|
|
@@ -755,7 +755,8 @@ export const Checkout = (props) => {
|
|
|
755
755
|
handleOrderRedirect,
|
|
756
756
|
handleCheckoutRedirect,
|
|
757
757
|
handleSearchRedirect,
|
|
758
|
-
handleCheckoutListRedirect
|
|
758
|
+
handleCheckoutListRedirect,
|
|
759
|
+
businessSlug
|
|
759
760
|
} = props
|
|
760
761
|
|
|
761
762
|
const [orderState, { confirmCart }] = useOrder()
|
|
@@ -772,7 +773,9 @@ export const Checkout = (props) => {
|
|
|
772
773
|
const [isResetPaymethod, setIsResetPaymethod] = useState(false)
|
|
773
774
|
|
|
774
775
|
const cartsWithProducts = orderState?.carts && (Object.values(orderState?.carts)?.filter(cart => cart?.products && cart?.products?.length) || null)
|
|
775
|
-
|
|
776
|
+
const carts = businessSlug
|
|
777
|
+
? cartsWithProducts.filter((cart) => cart?.business?.slug === businessSlug || businessSlug === cart?.business_id)
|
|
778
|
+
: cartsWithProducts
|
|
776
779
|
const closeAlert = () => {
|
|
777
780
|
setAlertState({
|
|
778
781
|
open: false,
|
|
@@ -812,7 +815,7 @@ export const Checkout = (props) => {
|
|
|
812
815
|
const getOrder = async (cartId) => {
|
|
813
816
|
try {
|
|
814
817
|
let result = {}
|
|
815
|
-
const cart =
|
|
818
|
+
const cart = carts.find(cart => cart.uuid === cartId)
|
|
816
819
|
const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
|
|
817
820
|
if (cart && !userCustomer) {
|
|
818
821
|
result = { ...cart }
|
|
@@ -920,17 +923,17 @@ export const Checkout = (props) => {
|
|
|
920
923
|
|
|
921
924
|
return (
|
|
922
925
|
<>
|
|
923
|
-
{!cartUuid && orderState.carts &&
|
|
926
|
+
{!cartUuid && orderState.carts && carts && carts?.length === 0 && (
|
|
924
927
|
<NotFoundSource
|
|
925
928
|
content={t('NOT_FOUND_CARTS', 'Sorry, You don\'t seem to have any carts.')}
|
|
926
929
|
btnTitle={t('SEARCH_REDIRECT', 'Go to Businesses')}
|
|
927
930
|
onClickButton={handleSearchRedirect}
|
|
928
931
|
/>
|
|
929
932
|
)}
|
|
930
|
-
{!cartUuid && orderState.carts &&
|
|
933
|
+
{!cartUuid && orderState.carts && carts && carts?.length > 0 && (
|
|
931
934
|
<CartsList>
|
|
932
935
|
<CartContent
|
|
933
|
-
carts={
|
|
936
|
+
carts={carts}
|
|
934
937
|
isOrderStateCarts={!!orderState.carts}
|
|
935
938
|
isForceOpenCart
|
|
936
939
|
/>
|
|
@@ -59,7 +59,9 @@ export const Header = (props) => {
|
|
|
59
59
|
isHideSignup,
|
|
60
60
|
isCustomerMode,
|
|
61
61
|
searchValue,
|
|
62
|
-
setSearchValue
|
|
62
|
+
setSearchValue,
|
|
63
|
+
businessSlug,
|
|
64
|
+
notificationState
|
|
63
65
|
} = props
|
|
64
66
|
|
|
65
67
|
const { pathname } = useLocation()
|
|
@@ -90,6 +92,9 @@ export const Header = (props) => {
|
|
|
90
92
|
const isMulticheckoutPage = window.location.pathname?.includes('/multi-checkout')
|
|
91
93
|
|
|
92
94
|
const cartsWithProducts = (orderState?.carts && Object.values(orderState?.carts).filter(cart => cart.products && cart.products?.length > 0)) || null
|
|
95
|
+
const carts = businessSlug
|
|
96
|
+
? cartsWithProducts.filter((cart) => cart?.business?.slug === businessSlug || businessSlug === cart?.business_id)
|
|
97
|
+
: cartsWithProducts
|
|
93
98
|
|
|
94
99
|
const windowSize = useWindowSize()
|
|
95
100
|
const onlineStatus = useOnlineStatus()
|
|
@@ -367,7 +372,7 @@ export const Header = (props) => {
|
|
|
367
372
|
{!isMulticheckoutPage ? (
|
|
368
373
|
<CartPopover
|
|
369
374
|
open={openPopover.cart}
|
|
370
|
-
carts={
|
|
375
|
+
carts={carts}
|
|
371
376
|
onClick={() => handleTogglePopover('cart')}
|
|
372
377
|
onClose={() => handleClosePopover('cart')}
|
|
373
378
|
auth={auth}
|
|
@@ -380,7 +385,7 @@ export const Header = (props) => {
|
|
|
380
385
|
) : (
|
|
381
386
|
<HeaderOption
|
|
382
387
|
variant='cart'
|
|
383
|
-
totalCarts={
|
|
388
|
+
totalCarts={carts?.length}
|
|
384
389
|
onClick={(variant) => openModal(variant)}
|
|
385
390
|
/>
|
|
386
391
|
)
|
|
@@ -469,7 +474,7 @@ export const Header = (props) => {
|
|
|
469
474
|
>
|
|
470
475
|
{modalSelected === 'cart' && (
|
|
471
476
|
<CartContent
|
|
472
|
-
carts={
|
|
477
|
+
carts={carts}
|
|
473
478
|
isOrderStateCarts={!!orderState.carts}
|
|
474
479
|
onClose={() => setModalIsOpen(false)}
|
|
475
480
|
/>
|
|
@@ -175,7 +175,7 @@ export const OrderBillSection = (props) => {
|
|
|
175
175
|
</tr>
|
|
176
176
|
))
|
|
177
177
|
}
|
|
178
|
-
{order?.summary?.delivery_price
|
|
178
|
+
{typeof order?.summary?.delivery_price === 'number' && (
|
|
179
179
|
<tr>
|
|
180
180
|
<td>{t('DELIVERY_FEE', theme?.defaultLanguages?.DELIVERY_FEE || 'Delivery Fee')}</td>
|
|
181
181
|
<td>{parsePrice(order?.summary?.delivery_price)}</td>
|