ordering-ui-external 1.4.4 → 1.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.a7a2180d81ab27bb0e20.js → 0.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{1.ordering-ui.a7a2180d81ab27bb0e20.js → 1.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{2.ordering-ui.a7a2180d81ab27bb0e20.js → 2.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{4.ordering-ui.a7a2180d81ab27bb0e20.js → 4.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{5.ordering-ui.a7a2180d81ab27bb0e20.js → 5.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{6.ordering-ui.a7a2180d81ab27bb0e20.js → 6.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{7.ordering-ui.a7a2180d81ab27bb0e20.js → 7.ordering-ui.b1e32f04828ea3f944e1.js} +2 -2
- package/_bundles/{7.ordering-ui.a7a2180d81ab27bb0e20.js.LICENSE.txt → 7.ordering-ui.b1e32f04828ea3f944e1.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a7a2180d81ab27bb0e20.js → 8.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{9.ordering-ui.a7a2180d81ab27bb0e20.js → 9.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/ordering-ui.b1e32f04828ea3f944e1.js +2 -0
- package/_bundles/{ordering-ui.a7a2180d81ab27bb0e20.js.LICENSE.txt → ordering-ui.b1e32f04828ea3f944e1.js.LICENSE.txt} +0 -0
- package/_modules/components/LogoutButton/index.js +9 -4
- package/_modules/components/PaymentOptions/index.js +14 -7
- package/_modules/components/SpinnerLoader/styles.js +1 -1
- package/_modules/components/UserProfileForm/index.js +15 -2
- package/_modules/components/UserProfileForm/styles.js +1 -1
- package/_modules/hooks/useRecaptcha.js +62 -0
- package/_modules/themes/five/src/components/AddressForm/styles.js +3 -3
- package/_modules/themes/five/src/components/AddressList/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +5 -5
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +12 -10
- package/_modules/themes/five/src/components/BusinessController/index.js +6 -4
- package/_modules/themes/five/src/components/BusinessController/styles.js +10 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +21 -6
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +6 -17
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +3 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -3
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessReviews/index.js +16 -8
- package/_modules/themes/five/src/components/BusinessReviews/styles.js +6 -4
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +58 -34
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -23
- package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
- package/_modules/themes/five/src/components/Footer/index.js +2 -1
- package/_modules/themes/five/src/components/Footer/styles.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +18 -11
- package/_modules/themes/five/src/components/Header/styles.js +7 -7
- package/_modules/themes/five/src/components/HomeHero/index.js +0 -15
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +116 -31
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +36 -37
- package/_modules/themes/five/src/components/LoginForm/index.js +62 -21
- package/_modules/themes/five/src/components/LoginForm/styles.js +1 -1
- package/_modules/themes/five/src/components/Messages/index.js +19 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +6 -6
- package/_modules/themes/five/src/components/MyOrders/index.js +4 -4
- package/_modules/themes/five/src/components/NavigationBar/index.js +145 -34
- package/_modules/themes/five/src/components/NavigationBar/styles.js +1 -1
- package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
- package/_modules/themes/five/src/components/PaymentOptions/index.js +23 -16
- package/_modules/themes/five/src/components/PaymentOptions/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +9 -7
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +10 -4
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +11 -3
- package/_modules/themes/five/src/components/ProductShare/ProductCopyURL.js +61 -0
- package/_modules/themes/five/src/components/ProductShare/index.js +107 -0
- package/_modules/themes/five/src/components/ProductShare/styles.js +40 -0
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +18 -16
- package/_modules/themes/five/src/components/ReviewProduct/index.js +5 -3
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +19 -3
- package/_modules/themes/five/src/components/SearchProducts/index.js +13 -2
- package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpForm/index.js +60 -20
- package/_modules/themes/five/src/components/SignUpForm/styles.js +2 -2
- package/_modules/themes/five/src/components/SingleProductCard/index.js +36 -2
- package/_modules/themes/five/src/components/UserProfileForm/index.js +105 -8
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +30 -17
- package/_modules/utils/index.js +26 -11
- package/index-template.js +11 -1
- package/package.json +2 -2
- package/src/components/LogoutButton/index.js +10 -8
- package/src/components/PaymentOptions/index.js +16 -11
- package/src/components/SpinnerLoader/styles.js +1 -0
- package/src/components/UserProfileForm/index.js +12 -2
- package/src/components/UserProfileForm/styles.js +1 -1
- package/src/hooks/useRecaptcha.js +40 -0
- package/src/themes/five/src/components/AddressForm/styles.js +3 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -1
- package/src/themes/five/src/components/AddressList/styles.js +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +74 -71
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +69 -20
- package/src/themes/five/src/components/BusinessController/index.js +3 -1
- package/src/themes/five/src/components/BusinessController/styles.js +8 -0
- package/src/themes/five/src/components/BusinessListingSearch/index.js +16 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +6 -18
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +2 -3
- package/src/themes/five/src/components/BusinessReviews/index.js +17 -10
- package/src/themes/five/src/components/BusinessReviews/styles.js +7 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +64 -19
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +99 -1
- package/src/themes/five/src/components/DriverTips/styles.js +1 -1
- package/src/themes/five/src/components/Footer/index.js +9 -5
- package/src/themes/five/src/components/Footer/styles.js +2 -6
- package/src/themes/five/src/components/Header/index.js +16 -8
- package/src/themes/five/src/components/Header/styles.js +49 -8
- package/src/themes/five/src/components/HomeHero/index.js +0 -6
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +163 -60
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +145 -82
- package/src/themes/five/src/components/LoginForm/index.js +30 -4
- package/src/themes/five/src/components/LoginForm/styles.js +8 -0
- package/src/themes/five/src/components/Messages/index.js +8 -2
- package/src/themes/five/src/components/MultiOrdersDetails/styles.js +34 -1
- package/src/themes/five/src/components/MyOrders/index.js +4 -4
- package/src/themes/five/src/components/NavigationBar/index.js +153 -39
- package/src/themes/five/src/components/NavigationBar/styles.js +2 -2
- package/src/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
- package/src/themes/five/src/components/PaymentOptions/index.js +13 -7
- package/src/themes/five/src/components/PaymentOptions/styles.js +5 -0
- package/src/themes/five/src/components/ProductForm/index.js +9 -7
- package/src/themes/five/src/components/ProductItemAccordion/index.js +67 -53
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +26 -0
- package/src/themes/five/src/components/ProductShare/ProductCopyURL.js +53 -0
- package/src/themes/five/src/components/ProductShare/index.js +104 -0
- package/src/themes/five/src/components/ProductShare/styles.js +165 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +2 -8
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +5 -0
- package/src/themes/five/src/components/ReviewProduct/index.js +10 -3
- package/src/themes/five/src/components/ReviewProduct/styles.js +43 -0
- package/src/themes/five/src/components/SearchProducts/index.js +16 -3
- package/src/themes/five/src/components/SignUpApproval/index.js +8 -7
- package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +26 -2
- package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +26 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +26 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +26 -2
- package/src/themes/five/src/components/SignUpForm/index.js +26 -1
- package/src/themes/five/src/components/SignUpForm/styles.js +9 -2
- package/src/themes/five/src/components/SingleProductCard/index.js +26 -1
- package/src/themes/five/src/components/UserPopover/index.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/index.js +83 -5
- package/src/themes/five/src/components/UserProfileForm/styles.js +49 -0
- package/src/utils/index.js +36 -9
- package/template/app.js +12 -11
- package/template/assets/images/amex.svg +30 -0
- package/template/assets/images/diners.svg +16 -0
- package/template/assets/images/discover.svg +17 -0
- package/template/assets/images/jcb.svg +33 -0
- package/template/assets/images/unionpay.svg +25 -0
- package/template/components/HelmetTags/index.js +1 -1
- package/template/components/ScrollToTop/index.js +7 -5
- package/template/pages/BusinessProductsList/index.js +8 -4
- package/template/pages/MyOrders/index.js +4 -1
- package/template/pages/OrderDetails/index.js +11 -2
- package/template/pages/Profile/index.js +8 -2
- package/_bundles/ordering-ui.a7a2180d81ab27bb0e20.js +0 -2
|
@@ -115,7 +115,6 @@ var BusinessProductsCategoriesUI = function BusinessProductsCategoriesUI(props)
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
var navbar = document.getElementById('category-lists');
|
|
118
|
-
var cart = document.getElementById('BusinessCartContainer');
|
|
119
118
|
var search = document.getElementById('WrapperSearchAbsolute');
|
|
120
119
|
var wrapperCategories = document.getElementById('wrapper-categories');
|
|
121
120
|
var limit = window.pageYOffset >= (wrapperCategories === null || wrapperCategories === void 0 ? void 0 : wrapperCategories.offsetTop) && window.pageYOffset > 0;
|
|
@@ -123,12 +122,10 @@ var BusinessProductsCategoriesUI = function BusinessProductsCategoriesUI(props)
|
|
|
123
122
|
var classAdded = navbar.classList.contains('sticky-prod-cat');
|
|
124
123
|
if (!classAdded) {
|
|
125
124
|
navbar && navbar.classList.add('sticky-prod-cat');
|
|
126
|
-
cart && cart.classList.add('sticky-prod-cart');
|
|
127
125
|
search && search.classList.add('sticky-search');
|
|
128
126
|
}
|
|
129
127
|
} else {
|
|
130
128
|
navbar && navbar.classList.remove('sticky-prod-cat');
|
|
131
|
-
cart && cart.classList.remove('sticky-prod-cart');
|
|
132
129
|
search && search.classList.remove('sticky-search');
|
|
133
130
|
}
|
|
134
131
|
};
|
|
@@ -142,24 +139,16 @@ var BusinessProductsCategoriesUI = function BusinessProductsCategoriesUI(props)
|
|
|
142
139
|
style0 += 'padding: 5px 5px 0px 5px !important;';
|
|
143
140
|
style0 += "width: calc(100% - ".concat(useKioskApp ? '50px' : '155px', ") !important;");
|
|
144
141
|
style0 += '}';
|
|
145
|
-
var style1 = '.sticky-
|
|
142
|
+
var style1 = '.sticky-search {';
|
|
146
143
|
style1 += 'position: fixed !important;';
|
|
147
|
-
style1 += 'top:
|
|
148
|
-
style1 += 'right:
|
|
149
|
-
style1 += '
|
|
150
|
-
style1 += '
|
|
144
|
+
style1 += 'top: 0px !important;';
|
|
145
|
+
style1 += 'right: 0% !important;';
|
|
146
|
+
style1 += 'z-index: 9999 !important;';
|
|
147
|
+
style1 += 'width: 50px !important;';
|
|
148
|
+
style1 += "background-color: ".concat(theme.colors.backgroundPage, " !important;");
|
|
151
149
|
style1 += '}';
|
|
152
|
-
var style2 = '.sticky-search {';
|
|
153
|
-
style2 += 'position: fixed !important;';
|
|
154
|
-
style2 += 'top: 0px !important;';
|
|
155
|
-
style2 += 'right: 0% !important;';
|
|
156
|
-
style2 += 'z-index: 9999 !important;';
|
|
157
|
-
style2 += 'width: 50px !important;';
|
|
158
|
-
style2 += "background-color: ".concat(theme.colors.backgroundPage, " !important;");
|
|
159
|
-
style2 += '}';
|
|
160
150
|
styleSheet.insertRule(style0, 0);
|
|
161
151
|
styleSheet.insertRule(style1, 1);
|
|
162
|
-
styleSheet.insertRule(style2, 2);
|
|
163
152
|
window.addEventListener('scroll', handleScroll);
|
|
164
153
|
return function () {
|
|
165
154
|
return window.removeEventListener('scroll', handleScroll);
|
|
@@ -13,8 +13,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
13
13
|
var CategoriesContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n overflow-x: auto;\n padding: 5px 0px 0px 0px;\n background: ", ";\n z-index: 1002;\n position: absolute;\n top: 0;\n border-bottom: 1px solid #D9D9D9;\n text-align: center;\n width: ", ";\n\n div.category {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding: 10px 0px;\n margin: 0 15px;\n &:nth-of-type(1) {\n margin-left: 0;\n ", "\n }\n }\n\n div.special {\n ", "\n }\n\n /* @media (min-width: 381px) {\n padding: 15px 0px 0px 0px;\n } */\n @media (min-width: 769px) {\n ", "\n }\n @media (min-width: 992px) {\n width: ", ";\n }\n"])), function (props) {
|
|
14
14
|
return props.theme.colors.backgroundPage;
|
|
15
15
|
}, function (props) {
|
|
16
|
-
|
|
17
|
-
return (_props$w = props.w) !== null && _props$w !== void 0 ? _props$w : '100%';
|
|
16
|
+
return props.w || '100%';
|
|
18
17
|
}, function (props) {
|
|
19
18
|
return props.theme.rtl && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 15px;\n margin-right: 15px;\n "])));
|
|
20
19
|
}, function (props) {
|
|
@@ -23,7 +22,7 @@ var CategoriesContainer = _styledComponents.default.div(_templateObject || (_tem
|
|
|
23
22
|
var isProfessional = _ref.isProfessional;
|
|
24
23
|
return isProfessional && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
25
24
|
}, function (props) {
|
|
26
|
-
var _props$
|
|
27
|
-
return (_props$
|
|
25
|
+
var _props$w;
|
|
26
|
+
return (_props$w = props.w) !== null && _props$w !== void 0 ? _props$w : 'auto';
|
|
28
27
|
});
|
|
29
28
|
exports.CategoriesContainer = CategoriesContainer;
|
|
@@ -42,7 +42,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
42
42
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
43
|
var PIXELS_TO_SCROLL = 300;
|
|
44
44
|
var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
45
|
-
var _Object$values$find, _businessState$busine, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _currentCart$products, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _error$, _theme$defaultLanguag11, _currentCart$products2, _theme$defaultLanguag12, _theme$defaultLanguag13, _theme$defaultLanguag14, _theme$defaultLanguag15, _currentCart$products3, _currentCart$products4, _currentCart$products5, _productModal$error$, _theme$defaultLanguag16, _productModal$product2, _business$professiona2;
|
|
45
|
+
var _Object$values$find, _businessState$busine, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _currentCart$products, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _error$, _theme$defaultLanguag11, _currentCart$products2, _theme$defaultLanguag12, _theme$defaultLanguag13, _theme$defaultLanguag14, _theme$defaultLanguag15, _currentCart$products3, _currentCart$products4, _currentCart$products5, _productModal$error$, _theme$defaultLanguag16, _productModal$product2, _business$professiona2, _currentCart$products6, _currentCart$products7;
|
|
46
46
|
var errors = props.errors,
|
|
47
47
|
openCategories = props.openCategories,
|
|
48
48
|
isInitialRender = props.isInitialRender,
|
|
@@ -446,13 +446,21 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
446
446
|
onSave: handlerProductAction,
|
|
447
447
|
professionalList: business === null || business === void 0 ? void 0 : business.professionals,
|
|
448
448
|
professionalSelected: professionalSelected,
|
|
449
|
-
handleChangeProfessional: handleChangeProfessionalSelected
|
|
449
|
+
handleChangeProfessional: handleChangeProfessionalSelected,
|
|
450
|
+
productAddedToCartLength: (currentCart === null || currentCart === void 0 ? void 0 : (_currentCart$products6 = currentCart.products) === null || _currentCart$products6 === void 0 ? void 0 : _currentCart$products6.reduce(function (productsLength, Cproduct) {
|
|
451
|
+
var _ref2;
|
|
452
|
+
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === ((_ref2 = productModal.product || curProduct) === null || _ref2 === void 0 ? void 0 : _ref2.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
453
|
+
}, 0)) || 0
|
|
450
454
|
}) : /*#__PURE__*/_react.default.createElement(_ProductForm.ProductForm, {
|
|
451
455
|
businessSlug: business === null || business === void 0 ? void 0 : business.slug,
|
|
452
456
|
useKioskApp: props.useKioskApp,
|
|
453
457
|
product: productModal.product || curProduct,
|
|
454
458
|
businessId: business === null || business === void 0 ? void 0 : business.id,
|
|
455
|
-
onSave: handlerProductAction
|
|
459
|
+
onSave: handlerProductAction,
|
|
460
|
+
productAddedToCartLength: (currentCart === null || currentCart === void 0 ? void 0 : (_currentCart$products7 = currentCart.products) === null || _currentCart$products7 === void 0 ? void 0 : _currentCart$products7.reduce(function (productsLength, Cproduct) {
|
|
461
|
+
var _ref3;
|
|
462
|
+
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === ((_ref3 = productModal.product || curProduct) === null || _ref3 === void 0 ? void 0 : _ref3.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
463
|
+
}, 0)) || 0
|
|
456
464
|
}))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
|
|
457
465
|
title: t('ERROR', 'Error'),
|
|
458
466
|
open: alertState === null || alertState === void 0 ? void 0 : alertState.open,
|
|
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var ProductsContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 95%;\n margin: 20px auto 0px;\n
|
|
13
|
+
var ProductsContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 95%;\n margin: 20px auto 0px;\n > svg {\n color: ", ";\n font-size: 24px;\n cursor: pointer;\n margin-bottom: 5px;\n }\n"])), function (props) {
|
|
14
14
|
return props.theme.colors.headingColor;
|
|
15
15
|
});
|
|
16
16
|
exports.ProductsContainer = ProductsContainer;
|
|
@@ -18,7 +18,7 @@ var ProductLoading = _styledComponents.default.div(_templateObject2 || (_templat
|
|
|
18
18
|
exports.ProductLoading = ProductLoading;
|
|
19
19
|
var SkeletonItem = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 80%;\n margin: 30px auto;\n\n span {\n margin-bottom: 10px;\n }\n"])));
|
|
20
20
|
exports.SkeletonItem = SkeletonItem;
|
|
21
|
-
var MobileCartViewWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: fixed;\n width: 100vw;\n left: 0;\n bottom: 0;\n background-color: white;\n padding:
|
|
21
|
+
var MobileCartViewWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: fixed;\n width: 100vw;\n left: 0;\n bottom: 0;\n background-color: white;\n padding: 15px 25px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n z-index: 1006;\n box-shadow: 0px 4px 10px rgb(0 0 0 / 12%);\n\n span {\n font-weight: 600;\n font-size: 16px;\n\n @media (min-width: 1200px) {\n font-size: 18px;\n padding-left: 20px;\n }\n }\n\n button {\n height: 44px;\n border-radius: 7.6px;\n }\n"])));
|
|
22
22
|
exports.MobileCartViewWrapper = MobileCartViewWrapper;
|
|
23
23
|
var BusinessCartContent = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: white;\n padding: 30px;\n position: relative;\n margin-bottom: 30px;\n max-height: ", ";\n overflow: auto;\n\n .product.accordion {\n margin: 0;\n }\n\n /* .accordion.active {\n padding-bottom: 10px;\n } */\n\n ", "\n\n @media (min-width: 1200px) {\n position: sticky;\n top: 0;\n }\n\n @media (min-width: 768px) {\n padding: 35px 30px;\n }\n"])), function (_ref) {
|
|
24
24
|
var maxHeight = _ref.maxHeight;
|
|
@@ -11,6 +11,7 @@ var _ThemeContext = require("../../../../../contexts/ThemeContext");
|
|
|
11
11
|
var _moment = _interopRequireDefault(require("moment"));
|
|
12
12
|
var _styles = require("./styles");
|
|
13
13
|
var _BsFillStarFill = _interopRequireDefault(require("@meronex/icons/bs/BsFillStarFill"));
|
|
14
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -30,7 +31,8 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
30
31
|
var _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _orderingTheme$theme16, _orderingTheme$theme17, _orderingTheme$theme18, _orderingTheme$theme19, _props$beforeElements, _props$beforeComponen, _theme$images, _theme$images$general, _props$afterComponent, _props$afterElements;
|
|
31
32
|
var stars = props.stars,
|
|
32
33
|
reviewsList = props.reviewsList,
|
|
33
|
-
handleClickOption = props.handleClickOption
|
|
34
|
+
handleClickOption = props.handleClickOption,
|
|
35
|
+
onChangeReview = props.onChangeReview;
|
|
34
36
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
35
37
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
36
38
|
t = _useLanguage2[1];
|
|
@@ -41,14 +43,17 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
41
43
|
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
42
44
|
orderingTheme = _useOrderingTheme2[0];
|
|
43
45
|
var handleOnChange = function handleOnChange(evt) {
|
|
44
|
-
if (evt.target.value
|
|
46
|
+
if (evt.target.value) onChangeReview(evt.target.value);else onChangeReview('');
|
|
47
|
+
};
|
|
48
|
+
var handleClickRaiting = function handleClickRaiting(raiting) {
|
|
49
|
+
if (raiting) handleClickOption(raiting);
|
|
45
50
|
};
|
|
46
51
|
var showRanking = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme = orderingTheme.theme) !== null && _orderingTheme$theme !== void 0 && (_orderingTheme$theme$ = _orderingTheme$theme.business_view) !== null && _orderingTheme$theme$ !== void 0 && (_orderingTheme$theme$2 = _orderingTheme$theme$.components) !== null && _orderingTheme$theme$2 !== void 0 && (_orderingTheme$theme$3 = _orderingTheme$theme$2.reviews) !== null && _orderingTheme$theme$3 !== void 0 && (_orderingTheme$theme$4 = _orderingTheme$theme$3.components) !== null && _orderingTheme$theme$4 !== void 0 && (_orderingTheme$theme$5 = _orderingTheme$theme$4.ranking) !== null && _orderingTheme$theme$5 !== void 0 && _orderingTheme$theme$5.hidden);
|
|
47
52
|
var showReviewDate = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme2 = orderingTheme.theme) !== null && _orderingTheme$theme2 !== void 0 && (_orderingTheme$theme3 = _orderingTheme$theme2.business_view) !== null && _orderingTheme$theme3 !== void 0 && (_orderingTheme$theme4 = _orderingTheme$theme3.components) !== null && _orderingTheme$theme4 !== void 0 && (_orderingTheme$theme5 = _orderingTheme$theme4.reviews) !== null && _orderingTheme$theme5 !== void 0 && (_orderingTheme$theme6 = _orderingTheme$theme5.components) !== null && _orderingTheme$theme6 !== void 0 && (_orderingTheme$theme7 = _orderingTheme$theme6.review_date) !== null && _orderingTheme$theme7 !== void 0 && _orderingTheme$theme7.hidden);
|
|
48
53
|
var showCustomerComments = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme8 = orderingTheme.theme) !== null && _orderingTheme$theme8 !== void 0 && (_orderingTheme$theme9 = _orderingTheme$theme8.business_view) !== null && _orderingTheme$theme9 !== void 0 && (_orderingTheme$theme10 = _orderingTheme$theme9.components) !== null && _orderingTheme$theme10 !== void 0 && (_orderingTheme$theme11 = _orderingTheme$theme10.reviews) !== null && _orderingTheme$theme11 !== void 0 && (_orderingTheme$theme12 = _orderingTheme$theme11.components) !== null && _orderingTheme$theme12 !== void 0 && (_orderingTheme$theme13 = _orderingTheme$theme12.customer_comments) !== null && _orderingTheme$theme13 !== void 0 && _orderingTheme$theme13.hidden);
|
|
49
54
|
var showSearch = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme14 = orderingTheme.theme) !== null && _orderingTheme$theme14 !== void 0 && (_orderingTheme$theme15 = _orderingTheme$theme14.business_view) !== null && _orderingTheme$theme15 !== void 0 && (_orderingTheme$theme16 = _orderingTheme$theme15.components) !== null && _orderingTheme$theme16 !== void 0 && (_orderingTheme$theme17 = _orderingTheme$theme16.reviews) !== null && _orderingTheme$theme17 !== void 0 && (_orderingTheme$theme18 = _orderingTheme$theme17.components) !== null && _orderingTheme$theme18 !== void 0 && (_orderingTheme$theme19 = _orderingTheme$theme18.search) !== null && _orderingTheme$theme19 !== void 0 && _orderingTheme$theme19.hidden);
|
|
50
55
|
var hideElement = !(!showReviewDate && !showCustomerComments);
|
|
51
|
-
var reviewPoints = [
|
|
56
|
+
var reviewPoints = [1, 2, 3, 4, 5];
|
|
52
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) {
|
|
53
58
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
54
59
|
key: i
|
|
@@ -63,9 +68,7 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
63
68
|
width: 100,
|
|
64
69
|
height: 30
|
|
65
70
|
})), showSearch && /*#__PURE__*/_react.default.createElement(_styles.ReviewOf, null, !reviewsList.loading ? /*#__PURE__*/_react.default.createElement(_styles.SearchContainer, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
66
|
-
type: "
|
|
67
|
-
min: "1",
|
|
68
|
-
max: "5",
|
|
71
|
+
type: "text",
|
|
69
72
|
onChange: handleOnChange,
|
|
70
73
|
placeholder: t('SEARCH', 'Search'),
|
|
71
74
|
style: {
|
|
@@ -74,7 +77,7 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
74
77
|
})) : /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
75
78
|
width: 200,
|
|
76
79
|
height: 30
|
|
77
|
-
})), showRanking && /*#__PURE__*/_react.default.createElement(_styles.ReviewsProgressWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, t('
|
|
80
|
+
})), showRanking && /*#__PURE__*/_react.default.createElement(_styles.ReviewsProgressWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, t('CUSTOMER_REVIEWS', 'Customers reviews')), /*#__PURE__*/_react.default.createElement(_styles.ReviewsProgressContent, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewsProgressBar, {
|
|
78
81
|
style: {
|
|
79
82
|
width: "".concat(stars / 5 * 100, "%")
|
|
80
83
|
}
|
|
@@ -82,11 +85,16 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
82
85
|
var isLastReviewPoint = i === (reviewPoints === null || reviewPoints === void 0 ? void 0 : reviewPoints.length) - 1;
|
|
83
86
|
return /*#__PURE__*/_react.default.createElement(_styles.ReviewsMarkPoint, {
|
|
84
87
|
key: i,
|
|
88
|
+
onClick: function onClick() {
|
|
89
|
+
return handleClickRaiting(i + 1);
|
|
90
|
+
},
|
|
85
91
|
style: {
|
|
86
92
|
left: theme.rtl !== isLastReviewPoint ? 'initial' : "".concat(25 * (isLastReviewPoint ? 0 : i), "%"),
|
|
87
93
|
right: theme.rtl !== isLastReviewPoint ? "".concat(25 * (isLastReviewPoint ? 0 : i), "%") : 'initial'
|
|
88
94
|
}
|
|
89
|
-
}, reviewPoint
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.ReviewStars, null, reviewPoint, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.StarFill, {
|
|
96
|
+
className: "start"
|
|
97
|
+
})));
|
|
90
98
|
}))), hideElement && /*#__PURE__*/_react.default.createElement(_styles.Content, {
|
|
91
99
|
id: "content"
|
|
92
100
|
}, !reviewsList.loading ? reviewsList === null || reviewsList === void 0 ? void 0 : reviewsList.reviews.map(function (review) {
|
|
@@ -4,9 +4,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.SkeletonContainer = exports.SearchContainer = exports.ReviewsProgressWrapper = exports.ReviewsProgressContent = exports.ReviewsProgressBar = exports.ReviewsNotFound = exports.ReviewsMarkPoint = exports.ReviewsHeaderWrapper = exports.ReviewTime = exports.ReviewOf = exports.ReviewItemHeader = exports.ReviewItemContent = exports.Review = exports.Content = exports.BusinessReviewsContainer = void 0;
|
|
7
|
+
exports.SkeletonContainer = exports.SearchContainer = exports.ReviewsProgressWrapper = exports.ReviewsProgressContent = exports.ReviewsProgressBar = exports.ReviewsNotFound = exports.ReviewsMarkPoint = exports.ReviewsHeaderWrapper = exports.ReviewTime = exports.ReviewStars = exports.ReviewOf = exports.ReviewItemHeader = exports.ReviewItemContent = exports.Review = exports.Content = exports.BusinessReviewsContainer = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -50,7 +50,7 @@ var ReviewsProgressContent = _styledComponents.default.div(_templateObject12 ||
|
|
|
50
50
|
exports.ReviewsProgressContent = ReviewsProgressContent;
|
|
51
51
|
var ReviewsProgressBar = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n height: 4px;\n border-radius: 50px;\n background: #344050;\n"])));
|
|
52
52
|
exports.ReviewsProgressBar = ReviewsProgressBar;
|
|
53
|
-
var ReviewsMarkPoint = _styledComponents.default.span(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: absolute;\n top: 15px;\n font-size: 12px;\n color: #CED4DA;\n"])));
|
|
53
|
+
var ReviewsMarkPoint = _styledComponents.default.span(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: absolute;\n top: 15px;\n font-size: 12px;\n color: #CED4DA;\n cursor: pointer\n"])));
|
|
54
54
|
exports.ReviewsMarkPoint = ReviewsMarkPoint;
|
|
55
55
|
var ReviewTime = _styledComponents.default.p(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n font-size: 12px;\n color: #909BA9;\n margin: 0;\n"])));
|
|
56
56
|
exports.ReviewTime = ReviewTime;
|
|
@@ -65,4 +65,6 @@ var SearchContainer = _styledComponents.default.div(_templateObject18 || (_templ
|
|
|
65
65
|
var _props$theme7;
|
|
66
66
|
return ((_props$theme7 = props.theme) === null || _props$theme7 === void 0 ? void 0 : _props$theme7.rtl) && (0, _styledComponents.css)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n padding: 7px 30px 7px 0;\n background-position: right center;\n "])));
|
|
67
67
|
});
|
|
68
|
-
exports.SearchContainer = SearchContainer;
|
|
68
|
+
exports.SearchContainer = SearchContainer;
|
|
69
|
+
var ReviewStars = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
|
|
70
|
+
exports.ReviewStars = ReviewStars;
|
|
@@ -11,8 +11,10 @@ var _FiMap = _interopRequireDefault(require("@meronex/icons/fi/FiMap"));
|
|
|
11
11
|
var _FiFilter = _interopRequireDefault(require("@meronex/icons/fi/FiFilter"));
|
|
12
12
|
var _IosRadioButtonOff = _interopRequireDefault(require("@meronex/icons/ios/IosRadioButtonOff"));
|
|
13
13
|
var _RiRadioButtonFill = _interopRequireDefault(require("@meronex/icons/ri/RiRadioButtonFill"));
|
|
14
|
+
var _FaMapMarkerAlt = _interopRequireDefault(require("@meronex/icons/fa/FaMapMarkerAlt"));
|
|
14
15
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
15
16
|
var _styles = require("./styles");
|
|
17
|
+
var _useWindowSize = require("../../../../../../../hooks/useWindowSize");
|
|
16
18
|
var _Buttons = require("../../../../styles/Buttons");
|
|
17
19
|
var _NotFoundSource = require("../../../NotFoundSource");
|
|
18
20
|
var _Modal = require("../../../Modal");
|
|
@@ -28,6 +30,8 @@ var _HighestRated = require("../../../HighestRated");
|
|
|
28
30
|
var _BusinessPreorder = require("../../../BusinessPreorder");
|
|
29
31
|
var _OrderProgress = require("../../../OrderProgress");
|
|
30
32
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
33
|
+
var _MomentPopover = require("../../../../../../pwa/src/components/MomentPopover");
|
|
34
|
+
var _OrderTypeSelectorHeader = require("../../../../../../../components/OrderTypeSelectorHeader");
|
|
31
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
36
|
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); }
|
|
33
37
|
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; }
|
|
@@ -47,7 +51,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
47
51
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
48
52
|
var PIXELS_TO_SCROLL = 300;
|
|
49
53
|
var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
50
|
-
var _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _theme$business_listi4, _businessesList$busin, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _theme$images2, _theme$images2$genera, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _citiesState$cities2, _citiesState$cities3, _citiesState$cities3$, _configs$advanced_bus, _orderState$
|
|
54
|
+
var _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _theme$business_listi4, _businessesList$busin, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _orderState$options3, _orderState$options3$, _theme$images2, _theme$images2$genera, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _Object$values, _citiesState$cities2, _citiesState$cities3, _citiesState$cities3$, _configs$advanced_bus, _orderState$options5, _orderState$options5$, _configs$advanced_bus2, _orderState$options6, _orderState$options6$, _businessesList$busin6, _businessesList$busin7, _orderState$options9, _citiesState$cities4, _props$afterComponent, _props$afterElements;
|
|
51
55
|
var businessesList = props.businessesList,
|
|
52
56
|
paginationProps = props.paginationProps,
|
|
53
57
|
searchValue = props.searchValue,
|
|
@@ -77,6 +81,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
77
81
|
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
78
82
|
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
79
83
|
configs = _useConfig2[0].configs;
|
|
84
|
+
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
80
85
|
var theme = (0, _styledComponents.useTheme)();
|
|
81
86
|
var _useState = (0, _react.useState)({
|
|
82
87
|
listOpen: false,
|
|
@@ -97,27 +102,31 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
97
102
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
98
103
|
activeMap = _useState6[0],
|
|
99
104
|
setActiveMap = _useState6[1];
|
|
100
|
-
var _useState7 = (0, _react.useState)(
|
|
105
|
+
var _useState7 = (0, _react.useState)({}),
|
|
101
106
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var _useState9 = (0, _react.useState)(
|
|
107
|
+
openPopover = _useState8[0],
|
|
108
|
+
setOpenPopover = _useState8[1];
|
|
109
|
+
var _useState9 = (0, _react.useState)(''),
|
|
105
110
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var _useState11 = (0, _react.useState)(
|
|
111
|
+
mapErrors = _useState10[0],
|
|
112
|
+
setMapErrors = _useState10[1];
|
|
113
|
+
var _useState11 = (0, _react.useState)(false),
|
|
109
114
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var _useState13 = (0, _react.useState)(
|
|
115
|
+
isPreorder = _useState12[0],
|
|
116
|
+
setIsPreorder = _useState12[1];
|
|
117
|
+
var _useState13 = (0, _react.useState)(null),
|
|
113
118
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
var
|
|
117
|
-
var _useState15 = (0, _react.useState)([]),
|
|
119
|
+
preorderBusiness = _useState14[0],
|
|
120
|
+
setPreorderBusiness = _useState14[1];
|
|
121
|
+
var _useState15 = (0, _react.useState)(true),
|
|
118
122
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
hasHighRatedBusiness = _useState16[0],
|
|
124
|
+
setHasHighRatedBusiness = _useState16[1];
|
|
125
|
+
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
126
|
+
var _useState17 = (0, _react.useState)([]),
|
|
127
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
128
|
+
favoriteIds = _useState18[0],
|
|
129
|
+
setFavoriteIds = _useState18[1];
|
|
121
130
|
var hideCities = (_theme$business_listi = theme === null || theme === void 0 ? void 0 : (_theme$business_listi2 = theme.business_listing_view) === null || _theme$business_listi2 === void 0 ? void 0 : (_theme$business_listi3 = _theme$business_listi2.components) === null || _theme$business_listi3 === void 0 ? void 0 : (_theme$business_listi4 = _theme$business_listi3.cities) === null || _theme$business_listi4 === void 0 ? void 0 : _theme$business_listi4.hidden) !== null && _theme$business_listi !== void 0 ? _theme$business_listi : true;
|
|
122
131
|
var businessesIds = isCustomLayout && businessesList.businesses && ((_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.map(function (business) {
|
|
123
132
|
return business.id;
|
|
@@ -147,6 +156,12 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
147
156
|
}));
|
|
148
157
|
}
|
|
149
158
|
};
|
|
159
|
+
var handleTogglePopover = function handleTogglePopover(type) {
|
|
160
|
+
setOpenPopover(_objectSpread(_objectSpread({}, openPopover), {}, _defineProperty({}, type, !openPopover[type])));
|
|
161
|
+
};
|
|
162
|
+
var handleClosePopover = function handleClosePopover(type) {
|
|
163
|
+
setOpenPopover(_objectSpread(_objectSpread({}, openPopover), {}, _defineProperty({}, type, false)));
|
|
164
|
+
};
|
|
150
165
|
var handleFindBusinesses = function handleFindBusinesses() {
|
|
151
166
|
var _orderState$options, _orderState$options$a;
|
|
152
167
|
if (!(orderState !== null && orderState !== void 0 && (_orderState$options = orderState.options) !== null && _orderState$options !== void 0 && (_orderState$options$a = _orderState$options.address) !== null && _orderState$options$a !== void 0 && _orderState$options$a.location)) {
|
|
@@ -275,10 +290,23 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
275
290
|
return /*#__PURE__*/_react.default.createElement(BeforeComponent, _extends({
|
|
276
291
|
key: i
|
|
277
292
|
}, props));
|
|
278
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, /*#__PURE__*/_react.default.createElement(_styles.
|
|
293
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessBanner, null, windowSize.width < 576 && /*#__PURE__*/_react.default.createElement(_styles.BusinessFeatures, null, /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
|
|
294
|
+
onClick: function onClick() {
|
|
295
|
+
return handleClickAddress();
|
|
296
|
+
}
|
|
297
|
+
}, /*#__PURE__*/_react.default.createElement(_FaMapMarkerAlt.default, null), /*#__PURE__*/_react.default.createElement("span", null, ((_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : (_orderState$options3$ = _orderState$options3.address) === null || _orderState$options3$ === void 0 ? void 0 : _orderState$options3$.address) || t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?'))), /*#__PURE__*/_react.default.createElement(_styles.FeatureItems, null, /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorHeader.OrderTypeSelectorHeader, null)), /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_MomentPopover.MomentPopover, {
|
|
298
|
+
open: openPopover.moment,
|
|
299
|
+
onClick: function onClick() {
|
|
300
|
+
return handleTogglePopover('moment');
|
|
301
|
+
},
|
|
302
|
+
onClose: function onClose() {
|
|
303
|
+
return handleClosePopover('moment');
|
|
304
|
+
},
|
|
305
|
+
isBanner: true
|
|
306
|
+
})))), /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
279
307
|
bgimage: (_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$genera = _theme$images2.general) === null || _theme$images2$genera === void 0 ? void 0 : _theme$images2$genera.businessHero,
|
|
280
308
|
height: theme === null || theme === void 0 ? void 0 : (_theme$business_listi5 = theme.business_listing_view) === null || _theme$business_listi5 === void 0 ? void 0 : (_theme$business_listi6 = _theme$business_listi5.components) === null || _theme$business_listi6 === void 0 ? void 0 : (_theme$business_listi7 = _theme$business_listi6.business_hero) === null || _theme$business_listi7 === void 0 ? void 0 : (_theme$business_listi8 = _theme$business_listi7.style) === null || _theme$business_listi8 === void 0 ? void 0 : _theme$business_listi8.height
|
|
281
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.OrderProgressWrapper, null, /*#__PURE__*/_react.default.createElement(_OrderProgress.OrderProgress, {
|
|
309
|
+
})), !!((_Object$values = Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts)) !== null && _Object$values !== void 0 && _Object$values.length) && /*#__PURE__*/_react.default.createElement(_styles.OrderProgressWrapper, null, /*#__PURE__*/_react.default.createElement(_OrderProgress.OrderProgress, {
|
|
282
310
|
franchiseId: props.franchiseId,
|
|
283
311
|
userCustomerId: userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
|
|
284
312
|
asDashboard: isCustomerMode,
|
|
@@ -303,8 +331,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
303
331
|
color: "primary",
|
|
304
332
|
onClick: handleOpenCities
|
|
305
333
|
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities3 = citiesState.cities) === null || _citiesState$cities3 === void 0 ? void 0 : (_citiesState$cities3$ = _citiesState$cities3.find(function (city) {
|
|
306
|
-
var _orderState$
|
|
307
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
334
|
+
var _orderState$options4;
|
|
335
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.city_id);
|
|
308
336
|
})) === null || _citiesState$cities3$ === void 0 ? void 0 : _citiesState$cities3$.name) || t('SELECT_A_CITY', 'Select a city')), (configs === null || configs === void 0 ? void 0 : (_configs$advanced_bus = configs.advanced_business_search_enabled) === null || _configs$advanced_bus === void 0 ? void 0 : _configs$advanced_bus.value) === '1' && /*#__PURE__*/_react.default.createElement(_FiFilter.default, {
|
|
309
337
|
onClick: function onClick() {
|
|
310
338
|
return onRedirectPage({
|
|
@@ -315,7 +343,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
315
343
|
onClick: toggleMap
|
|
316
344
|
})), activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
317
345
|
businessList: businessesList.businesses,
|
|
318
|
-
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
346
|
+
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : (_orderState$options5$ = _orderState$options5.address) === null || _orderState$options5$ === void 0 ? void 0 : _orderState$options5$.location,
|
|
319
347
|
setErrors: setMapErrors
|
|
320
348
|
})), hasHighRatedBusiness && !props.franchiseId && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_HighestRated.HighestRated, {
|
|
321
349
|
handleClickAddress: handleClickAddress,
|
|
@@ -350,7 +378,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
350
378
|
onClick: toggleMap
|
|
351
379
|
}))), isCustomerMode && activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
352
380
|
businessList: businessesList.businesses,
|
|
353
|
-
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
381
|
+
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : (_orderState$options6$ = _orderState$options6.address) === null || _orderState$options6$ === void 0 ? void 0 : _orderState$options6$.location,
|
|
354
382
|
setErrors: setMapErrors
|
|
355
383
|
}), !isCustomerMode && /*#__PURE__*/_react.default.createElement(OrdersSection, null), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 ? void 0 : (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
356
384
|
content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
|
|
@@ -364,14 +392,14 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
364
392
|
height: '44px'
|
|
365
393
|
}
|
|
366
394
|
}, t('CHANGE_ADDRESS', 'Select other Address'))), (_businessesList$busin7 = businessesList.businesses) === null || _businessesList$busin7 === void 0 ? void 0 : _businessesList$busin7.map(function (business) {
|
|
367
|
-
var _orderState$
|
|
395
|
+
var _orderState$options7, _business$reviews;
|
|
368
396
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
369
397
|
key: business.id,
|
|
370
398
|
className: "card",
|
|
371
399
|
business: business,
|
|
372
400
|
isBusinessOpen: business.open,
|
|
373
401
|
handleCustomClick: handleBusinessClick,
|
|
374
|
-
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
402
|
+
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 ? void 0 : _orderState$options7.type,
|
|
375
403
|
isCustomLayout: isCustomLayout,
|
|
376
404
|
isCustomerMode: isCustomerMode,
|
|
377
405
|
onPreorderBusiness: setPreorderBusiness,
|
|
@@ -389,18 +417,14 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
389
417
|
setFavoriteIds: setFavoriteIds
|
|
390
418
|
});
|
|
391
419
|
}), businessesList.loading && _toConsumableArray(Array((paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.nextPageItems) > 4 ? paginationProps.nextPageItems : 8).keys()).map(function (i) {
|
|
392
|
-
var _orderState$
|
|
420
|
+
var _orderState$options8;
|
|
393
421
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
394
422
|
key: i,
|
|
395
423
|
className: "card",
|
|
396
424
|
business: {},
|
|
397
425
|
isSkeleton: true,
|
|
398
|
-
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
426
|
+
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.type
|
|
399
427
|
});
|
|
400
|
-
}), businessesList.error && businessesList.error.length > 0 && businessesList.businesses.length === 0 && businessesList.error.map(function (e, i) {
|
|
401
|
-
return /*#__PURE__*/_react.default.createElement(_styles.ErrorMessage, {
|
|
402
|
-
key: i
|
|
403
|
-
}, t('ERROR', 'ERROR'), ": [", (e === null || e === void 0 ? void 0 : e.message) || e, "]");
|
|
404
428
|
}))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
405
429
|
open: isPreorder,
|
|
406
430
|
width: "760px",
|
|
@@ -421,7 +445,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
421
445
|
}
|
|
422
446
|
}, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
|
|
423
447
|
useValidationFileds: true,
|
|
424
|
-
address: (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
448
|
+
address: (orderState === null || orderState === void 0 ? void 0 : (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.address) || {},
|
|
425
449
|
onClose: function onClose() {
|
|
426
450
|
return setModals(_objectSpread(_objectSpread({}, modals), {}, {
|
|
427
451
|
formOpen: false
|
|
@@ -475,7 +499,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
475
499
|
marginBottom: '10px'
|
|
476
500
|
}
|
|
477
501
|
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities4 = citiesState.cities) === null || _citiesState$cities4 === void 0 ? void 0 : _citiesState$cities4.map(function (city) {
|
|
478
|
-
var _orderState$
|
|
502
|
+
var _orderState$options10;
|
|
479
503
|
return /*#__PURE__*/_react.default.createElement(_styles.CityItem, {
|
|
480
504
|
key: city === null || city === void 0 ? void 0 : city.id,
|
|
481
505
|
onClick: function onClick() {
|
|
@@ -483,7 +507,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
483
507
|
}
|
|
484
508
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
485
509
|
className: "radio"
|
|
486
|
-
}, (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
510
|
+
}, (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.city_id) ? /*#__PURE__*/_react.default.createElement(_RiRadioButtonFill.default, {
|
|
487
511
|
className: "city-checked"
|
|
488
512
|
}) : /*#__PURE__*/_react.default.createElement(_IosRadioButtonOff.default, null)), city === null || city === void 0 ? void 0 : city.name);
|
|
489
513
|
})))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
|