ordering-ui-external 10.10.22 → 11.0.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/{7.ordering-ui.912d728f17fd4dc8bb87.js → 7.ordering-ui.fa5f19340751cb2d73a3.js} +1 -1
- package/_bundles/{ordering-ui.912d728f17fd4dc8bb87.js → ordering-ui.fa5f19340751cb2d73a3.js} +2 -2
- package/_modules/components/BusinessProductsList/index.js +15 -4
- package/_modules/themes/callcenterOriginal/src/components/CartPopover/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +0 -1
- package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsList/SubcategoriesComponent/index.js +57 -0
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +21 -63
- package/_modules/themes/five/src/components/Cart/index.js +1 -1
- package/_modules/themes/five/src/components/HighestRated/index.js +40 -7
- package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +4 -1
- package/_modules/themes/five/src/components/OrderDetails/index.js +2 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +2 -2
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +14 -13
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +1 -1
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +3 -2
- package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +3 -2
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +7 -13
- package/package.json +2 -2
- package/src/components/BusinessProductsList/index.js +9 -1
- package/src/themes/callcenterOriginal/src/components/CartPopover/styles.js +1 -1
- package/src/themes/callcenterOriginal/src/components/Header/index.js +0 -1
- package/src/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
- package/src/themes/five/src/components/BusinessProductsList/SubcategoriesComponent/index.js +57 -0
- package/src/themes/five/src/components/BusinessProductsList/index.js +13 -64
- package/src/themes/five/src/components/Cart/index.js +1 -1
- package/src/themes/five/src/components/HighestRated/index.js +35 -1
- package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +2 -1
- package/src/themes/five/src/components/ProductForm/index.js +2 -2
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +11 -12
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +1 -1
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +3 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +3 -2
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +12 -17
- package/template/pages/SignUpDriver/index.js +5 -1
- /package/_bundles/{0.ordering-ui.912d728f17fd4dc8bb87.js → 0.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{1.ordering-ui.912d728f17fd4dc8bb87.js → 1.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{2.ordering-ui.912d728f17fd4dc8bb87.js → 2.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{4.ordering-ui.912d728f17fd4dc8bb87.js → 4.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{5.ordering-ui.912d728f17fd4dc8bb87.js → 5.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{6.ordering-ui.912d728f17fd4dc8bb87.js → 6.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{7.ordering-ui.912d728f17fd4dc8bb87.js.LICENSE.txt → 7.ordering-ui.fa5f19340751cb2d73a3.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.912d728f17fd4dc8bb87.js → 8.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{9.ordering-ui.912d728f17fd4dc8bb87.js → 9.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{ordering-ui.912d728f17fd4dc8bb87.js.LICENSE.txt → ordering-ui.fa5f19340751cb2d73a3.js.LICENSE.txt} +0 -0
- /package/template/{utils → Utils}/index.js +0 -0
|
@@ -16,11 +16,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
18
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
20
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
20
21
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
22
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
23
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
25
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
26
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -28,7 +28,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
28
28
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
30
|
var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
31
|
-
var _props$beforeElements, _props$beforeComponen, _categoryState$produc, _categoryState$produc2, _categoryState$produc3, _props$afterComponent, _props$afterElements;
|
|
31
|
+
var _props$beforeElements, _props$beforeComponen, _categoryState$produc, _categoryState$produc2, _uniqueFeaturedProduc, _categoryState$produc3, _props$afterComponent, _props$afterElements;
|
|
32
32
|
var errors = props.errors,
|
|
33
33
|
businessId = props.businessId,
|
|
34
34
|
category = props.category,
|
|
@@ -47,6 +47,11 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
47
47
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
48
48
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
49
49
|
t = _useLanguage2[1];
|
|
50
|
+
var uniqueFeaturedProducts = function uniqueFeaturedProducts(data, key) {
|
|
51
|
+
return _toConsumableArray(new Map(data.map(function (p) {
|
|
52
|
+
return [key(p), p];
|
|
53
|
+
})).values());
|
|
54
|
+
};
|
|
50
55
|
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) {
|
|
51
56
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
52
57
|
key: i
|
|
@@ -73,11 +78,17 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
73
78
|
});
|
|
74
79
|
})), !(category !== null && category !== void 0 && category.id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, featured && (categoryState === null || categoryState === void 0 || (_categoryState$produc2 = categoryState.products) === null || _categoryState$produc2 === void 0 ? void 0 : _categoryState$produc2.find(function (product) {
|
|
75
80
|
return product.featured;
|
|
76
|
-
})) && /*#__PURE__*/_react.default.createElement(_styles.WrapAllCategories, null, /*#__PURE__*/_react.default.createElement("h3", null, t('FEATURED', 'Featured')), /*#__PURE__*/_react.default.createElement(_styles.ProductsListing, null, (_categoryState$produc3 = categoryState.products) === null || _categoryState$produc3 === void 0 ? void 0 : _categoryState$produc3.sort(function (a, b) {
|
|
81
|
+
})) && /*#__PURE__*/_react.default.createElement(_styles.WrapAllCategories, null, /*#__PURE__*/_react.default.createElement("h3", null, t('FEATURED', 'Featured')), /*#__PURE__*/_react.default.createElement(_styles.ProductsListing, null, (_uniqueFeaturedProduc = uniqueFeaturedProducts((_categoryState$produc3 = categoryState.products) === null || _categoryState$produc3 === void 0 ? void 0 : _categoryState$produc3.sort(function (a, b) {
|
|
82
|
+
return a.rank - b.rank;
|
|
83
|
+
}).filter(function (p, i, hash) {
|
|
84
|
+
return p.featured;
|
|
85
|
+
}), function (product) {
|
|
86
|
+
return product.name;
|
|
87
|
+
})) === null || _uniqueFeaturedProduc === void 0 ? void 0 : _uniqueFeaturedProduc.sort(function (a, b) {
|
|
77
88
|
return a.rank - b.rank;
|
|
78
89
|
}).map(function (product) {
|
|
79
90
|
var _currentCart$products2;
|
|
80
|
-
return
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
81
92
|
key: product === null || product === void 0 ? void 0 : product.id,
|
|
82
93
|
isSoldOut: product.inventoried && !product.quantity,
|
|
83
94
|
product: product,
|
|
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
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 HeaderItem = exports.HeaderItem = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n > span {\n padding: 10px;\n display: flex;\n align-items: center;\n background: ", ";\n color: #FFFFFF;\n border-radius: 7.6px;\n\n span {\n margin: 0;\n font-size: 14px;\n ", "\n }\n svg {\n font-size: 16px;\n }\n }\n"])), function (props) {
|
|
13
|
+
var HeaderItem = exports.HeaderItem = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n > span {\n padding: 10px;\n display: flex;\n align-items: center;\n background: ", ";\n color: #FFFFFF;\n border-radius: 7.6px;\n\n span {\n margin: 0;\n font-size: 14px;\n ", " \n }\n svg {\n font-size: 16px;\n }\n }\n"])), function (props) {
|
|
14
14
|
return props.theme.colors.primary;
|
|
15
15
|
}, function (props) {
|
|
16
16
|
var _props$theme;
|
|
@@ -29,7 +29,6 @@ var _HeaderOption = require("../HeaderOption");
|
|
|
29
29
|
var _SidebarMenu = require("../SidebarMenu");
|
|
30
30
|
var _UserDetails = require("../UserDetails");
|
|
31
31
|
var _Confirm = require("../Confirm");
|
|
32
|
-
var _utils = require("../../../../../utils");
|
|
33
32
|
var _BusinessPreorder = require("../BusinessPreorder");
|
|
34
33
|
var _AdminAreaPopover = require("../AdminAreaPopover");
|
|
35
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -24,7 +24,7 @@ var LeftHeader = exports.LeftHeader = _styledComponents.default.div(_templateObj
|
|
|
24
24
|
var RightHeader = exports.RightHeader = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n align-self: center;\n display: flex;\n\n #select-input {\n div {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
25
25
|
return props.theme.colors.darkTextColor;
|
|
26
26
|
});
|
|
27
|
-
var Menu = exports.Menu = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n #select-input {\n border-radius: 7.6px;\n\n #list {\n border-radius: 7.6px;\n }\n }\n\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: 50px;\n margin: 0 20px;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n\n @media (min-width: 821px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 35px;\n margin-right: 10px;\n }\n \n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n margin-right: 15px;\n }\n\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin-left: 75px;\n margin-right: 20px\n }\n }\n\n > *:not(:last-child) {\n margin: 0 5px;\n }\n\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n justify-content: center;\n width: 200px;\n display: none;\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n\n .order-type {\n padding: 0 5px;\n\n > div {\n min-width: auto;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 40px;\n }\n\n @media (min-width: 1123px) {\n padding: 0 10px;\n > div {\n min-width: fit-content;\n }\n }\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n\n\n @media (min-width: 821px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])));
|
|
27
|
+
var Menu = exports.Menu = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n #select-input {\n border-radius: 7.6px;\n\n #list {\n border-radius: 7.6px;\n }\n }\n\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: 50px;\n margin: 0 20px;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n\n @media (min-width: 821px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 35px;\n margin-right: 10px;\n }\n \n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n margin-right: 15px;\n }\n\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin-left: 75px;\n margin-right: 20px\n }\n }\n\n > *:not(:last-child) {\n margin: 0 5px;\n }\n\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n justify-content: center;\n width: 200px;\n display: none;\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n\n .order-type {\n padding: 0 5px;\n\n > div {\n min-width: auto;\n text-overflow: ellipsis;\n overflow: hidden;\n min-width: 40px;\n }\n\n @media (min-width: 1123px) {\n padding: 0 10px;\n > div {\n min-width: fit-content;\n }\n }\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n\n\n @media (min-width: 821px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])));
|
|
28
28
|
var MenuItem = exports.MenuItem = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
29
29
|
var MenuLink = exports.MenuLink = _styledComponents.default.a(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n text-decoration: none;\n font-size: 14px;\n padding: 10px;\n color: #333;\n cursor: pointer;\n\n ", "\n"])), function (_ref2) {
|
|
30
30
|
var highlight = _ref2.highlight;
|
|
@@ -49,7 +49,7 @@ var AddressMenu = exports.AddressMenu = _styledComponents.default.div(_templateO
|
|
|
49
49
|
var _props$theme2;
|
|
50
50
|
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n margin-left: 10px;\n margin-right: 0;\n "])));
|
|
51
51
|
});
|
|
52
|
-
var MomentMenu = exports.MomentMenu = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n \n @media (min-width: 821px) {\n display: flex;\n }\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n\n @media (min-width: 1400px) {\n width:
|
|
52
|
+
var MomentMenu = exports.MomentMenu = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n \n @media (min-width: 821px) {\n display: flex;\n }\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n\n @media (min-width: 1400px) {\n width: 300px;\n }\n\n > div {\n cursor: pointer;\n font-size: 14px;\n color: #909BA9;\n display: flex;\n align-items: center;\n text-align: center;\n white-space: nowrap;\n padding: 0 10px;\n }\n"])));
|
|
53
53
|
var FarAwayMessage = exports.FarAwayMessage = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n display: flex;\n align-items: center;\n top: 100%;\n background: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);\n border-radius: 7.6px;\n padding: 6px 15px;\n box-sizing: border-box;\n z-index: 2000;\n margin: 10px 0px 0px 0px !important;\n\n left: 5px;\n ", "\n\n svg {\n font-size: 20px;\n color: ", ";\n margin-right: 10px;\n ", "\n }\n span {\n font-size: 12px;\n line-height: 18px;\n color: ", ";\n }\n\n @media (min-width: 400px) {\n padding: 8px 20px;\n font-size: 14px;\n line-height: 24px;\n left: 10px;\n ", "\n }\n"])), function (props) {
|
|
54
54
|
return props.theme.colors.warning100;
|
|
55
55
|
}, function (props) {
|
package/_modules/themes/five/src/components/BusinessProductsList/SubcategoriesComponent/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SubcategoriesComponent = void 0;
|
|
7
|
+
var _orderingComponentsExternal = require("ordering-components-external");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _styles = require("../styles");
|
|
10
|
+
var _AutoScroll = require("../../AutoScroll");
|
|
11
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
12
|
+
var _Buttons = require("../../../styles/Buttons");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
var subcategoriesComponentPropsAreEqual = function subcategoriesComponentPropsAreEqual(prevProps, nextProps) {
|
|
21
|
+
return JSON.stringify(prevProps.category) === JSON.stringify(nextProps.category) && JSON.stringify(prevProps.subcategoriesSelected) === JSON.stringify(nextProps.subcategoriesSelected);
|
|
22
|
+
};
|
|
23
|
+
var SubcategoriesComponent = exports.SubcategoriesComponent = /*#__PURE__*/_react.default.memo(function (props) {
|
|
24
|
+
var _category$subcategori;
|
|
25
|
+
var category = props.category,
|
|
26
|
+
subcategoriesSelected = props.subcategoriesSelected,
|
|
27
|
+
onClickSubcategory = props.onClickSubcategory;
|
|
28
|
+
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
29
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
30
|
+
t = _useLanguage2[1];
|
|
31
|
+
var allsubcategorySelected = !(subcategoriesSelected !== null && subcategoriesSelected !== void 0 && subcategoriesSelected.some(function (subcategory) {
|
|
32
|
+
return (category === null || category === void 0 ? void 0 : category.id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.parent_category_id);
|
|
33
|
+
}));
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_styles.SubCategoriesContainer, null, /*#__PURE__*/_react.default.createElement(_styles.SubCategoriesInnerContainer, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
35
|
+
scrollId: "scroll_".concat(category === null || category === void 0 ? void 0 : category.id)
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.ContainerButton, {
|
|
37
|
+
isSelected: allsubcategorySelected
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
return onClickSubcategory(null, category);
|
|
41
|
+
},
|
|
42
|
+
color: allsubcategorySelected ? 'primary' : 'lightGray'
|
|
43
|
+
}, t('ALL', 'All'))), category === null || category === void 0 || (_category$subcategori = category.subcategories) === null || _category$subcategori === void 0 ? void 0 : _category$subcategori.map(function (subcategory) {
|
|
44
|
+
var isSubcategorySelected = subcategoriesSelected === null || subcategoriesSelected === void 0 ? void 0 : subcategoriesSelected.find(function (_subcategory) {
|
|
45
|
+
return (_subcategory === null || _subcategory === void 0 ? void 0 : _subcategory.id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.id);
|
|
46
|
+
});
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_styles.ContainerButton, {
|
|
48
|
+
key: subcategory === null || subcategory === void 0 ? void 0 : subcategory.id,
|
|
49
|
+
isSelected: isSubcategorySelected
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
return onClickSubcategory(subcategory, category);
|
|
53
|
+
},
|
|
54
|
+
color: isSubcategorySelected ? 'primary' : 'lightGray'
|
|
55
|
+
}, subcategory === null || subcategory === void 0 ? void 0 : subcategory.name, " ", isSubcategorySelected && /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.XLg, null)));
|
|
56
|
+
}))));
|
|
57
|
+
}, subcategoriesComponentPropsAreEqual);
|
|
@@ -12,9 +12,8 @@ var _NotFoundSource = require("../NotFoundSource");
|
|
|
12
12
|
var _Modal = require("../Modal");
|
|
13
13
|
var _utils = require("../../../../../utils");
|
|
14
14
|
var _AutoScroll = require("../AutoScroll");
|
|
15
|
-
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
16
15
|
var _styles = require("./styles");
|
|
17
|
-
var
|
|
16
|
+
var _SubcategoriesComponent = require("./SubcategoriesComponent");
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -22,7 +21,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
22
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
22
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
23
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
25
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
26
24
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
25
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
26
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -34,7 +32,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
34
32
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
35
33
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
34
|
var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
37
|
-
var _configs$use_parent_c, _configs$use_parent_c2, _categoryState$produc,
|
|
35
|
+
var _configs$use_parent_c, _configs$use_parent_c2, _categoryState$produc, _category$subcategori, _category$subcategori2, _category$subcategori3, _headerRef$current, _categoryState$produc2, _categoryState$produc3, _categoryState$produc4, _categoryState$produc9;
|
|
38
36
|
var errors = props.errors,
|
|
39
37
|
businessId = props.businessId,
|
|
40
38
|
isLazy = props.isLazy,
|
|
@@ -91,36 +89,6 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
91
89
|
setSubcategoriesSelected([].concat(_toConsumableArray(subcategoriesSelected), [subCategory]));
|
|
92
90
|
}
|
|
93
91
|
};
|
|
94
|
-
var SubcategoriesComponent = function SubcategoriesComponent(_ref) {
|
|
95
|
-
var _category$subcategori;
|
|
96
|
-
var category = _ref.category;
|
|
97
|
-
var allsubcategorySelected = !(subcategoriesSelected !== null && subcategoriesSelected !== void 0 && subcategoriesSelected.some(function (subcategory) {
|
|
98
|
-
return (category === null || category === void 0 ? void 0 : category.id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.parent_category_id);
|
|
99
|
-
}));
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement(_styles.SubCategoriesContainer, null, /*#__PURE__*/_react.default.createElement(_styles.SubCategoriesInnerContainer, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
101
|
-
scrollId: "scroll_".concat(category === null || category === void 0 ? void 0 : category.id)
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.ContainerButton, {
|
|
103
|
-
isSelected: allsubcategorySelected
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
105
|
-
onClick: function onClick() {
|
|
106
|
-
return onClickSubcategory(null, category);
|
|
107
|
-
},
|
|
108
|
-
color: allsubcategorySelected ? 'primary' : 'lightGray'
|
|
109
|
-
}, t('ALL', 'All'))), category === null || category === void 0 || (_category$subcategori = category.subcategories) === null || _category$subcategori === void 0 ? void 0 : _category$subcategori.map(function (subcategory) {
|
|
110
|
-
var isSubcategorySelected = subcategoriesSelected === null || subcategoriesSelected === void 0 ? void 0 : subcategoriesSelected.find(function (_subcategory) {
|
|
111
|
-
return (_subcategory === null || _subcategory === void 0 ? void 0 : _subcategory.id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.id);
|
|
112
|
-
});
|
|
113
|
-
return /*#__PURE__*/_react.default.createElement(_styles.ContainerButton, {
|
|
114
|
-
key: subcategory === null || subcategory === void 0 ? void 0 : subcategory.id,
|
|
115
|
-
isSelected: isSubcategorySelected
|
|
116
|
-
}, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
117
|
-
onClick: function onClick() {
|
|
118
|
-
return onClickSubcategory(subcategory, category);
|
|
119
|
-
},
|
|
120
|
-
color: isSubcategorySelected ? 'primary' : 'lightGray'
|
|
121
|
-
}, subcategory === null || subcategory === void 0 ? void 0 : subcategory.name, " ", isSubcategorySelected && /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.XLg, null)));
|
|
122
|
-
}))));
|
|
123
|
-
};
|
|
124
92
|
var productsCategorySelected = (_categoryState$produc = categoryState.products) === null || _categoryState$produc === void 0 ? void 0 : _categoryState$produc.filter(function (product) {
|
|
125
93
|
return !(subcategoriesSelected !== null && subcategoriesSelected !== void 0 && subcategoriesSelected.find(function (subcategory) {
|
|
126
94
|
return (subcategory === null || subcategory === void 0 ? void 0 : subcategory.parent_category_id) === (category === null || category === void 0 ? void 0 : category.id);
|
|
@@ -128,16 +96,10 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
128
96
|
return subcategory.id === (product === null || product === void 0 ? void 0 : product.category_id);
|
|
129
97
|
}));
|
|
130
98
|
});
|
|
131
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}), (_props$beforeComponen = props.beforeComponents) === null || _props$beforeComponen === void 0 ? void 0 : _props$beforeComponen.map(function (BeforeComponent, i) {
|
|
136
|
-
return /*#__PURE__*/_react.default.createElement(BeforeComponent, _extends({
|
|
137
|
-
key: i
|
|
138
|
-
}, props));
|
|
139
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.ProductsContainer, null, (category === null || category === void 0 ? void 0 : category.id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.HeaderWrapper, null, (category === null || category === void 0 || (_category$subcategori2 = category.subcategories) === null || _category$subcategori2 === void 0 ? void 0 : _category$subcategori2.length) > 0 && !isSearchMode && /*#__PURE__*/_react.default.createElement(SubcategoriesComponent, {
|
|
140
|
-
category: category
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ProductsContainer, null, (category === null || category === void 0 ? void 0 : category.id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.HeaderWrapper, null, (category === null || category === void 0 || (_category$subcategori = category.subcategories) === null || _category$subcategori === void 0 ? void 0 : _category$subcategori.length) > 0 && !isSearchMode && /*#__PURE__*/_react.default.createElement(_SubcategoriesComponent.SubcategoriesComponent, {
|
|
100
|
+
category: category,
|
|
101
|
+
subcategoriesSelected: subcategoriesSelected,
|
|
102
|
+
onClickSubcategory: onClickSubcategory
|
|
141
103
|
})), /*#__PURE__*/_react.default.createElement(_styles.ProductsListing, null, productsCategorySelected.map(function (product, i) {
|
|
142
104
|
var _currentCart$products;
|
|
143
105
|
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
@@ -153,11 +115,11 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
153
115
|
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
154
116
|
}, 0)
|
|
155
117
|
});
|
|
156
|
-
})), isSearchMode && (category === null || category === void 0 || (_category$
|
|
118
|
+
})), isSearchMode && (category === null || category === void 0 || (_category$subcategori2 = category.subcategories) === null || _category$subcategori2 === void 0 ? void 0 : _category$subcategori2.length) > 0 && (category === null || category === void 0 || (_category$subcategori3 = category.subcategories) === null || _category$subcategori3 === void 0 || (_category$subcategori3 = _category$subcategori3.filter(function (subcategory) {
|
|
157
119
|
return productsCategorySelected === null || productsCategorySelected === void 0 ? void 0 : productsCategorySelected.some(function (product) {
|
|
158
120
|
return (product === null || product === void 0 ? void 0 : product.category_id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.id);
|
|
159
121
|
});
|
|
160
|
-
})) === null || _category$
|
|
122
|
+
})) === null || _category$subcategori3 === void 0 ? void 0 : _category$subcategori3.map(function (subcategory) {
|
|
161
123
|
var _productsCategorySele;
|
|
162
124
|
return /*#__PURE__*/_react.default.createElement(_styles.SubcategorySearchContainer, {
|
|
163
125
|
key: subcategory === null || subcategory === void 0 ? void 0 : subcategory.id
|
|
@@ -221,7 +183,9 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
221
183
|
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
222
184
|
}, 0)
|
|
223
185
|
});
|
|
224
|
-
}), !(business !== null && business !== void 0 && business.food) && !(categoryState !== null && categoryState !== void 0 && categoryState.loading) && (categoryState === null || categoryState === void 0 || (_categoryState$produc4 = categoryState.products) === null || _categoryState$produc4 === void 0
|
|
186
|
+
}), !(business !== null && business !== void 0 && business.food) && !(categoryState !== null && categoryState !== void 0 && categoryState.loading) && (categoryState === null || categoryState === void 0 || (_categoryState$produc4 = categoryState.products) === null || _categoryState$produc4 === void 0 || (_categoryState$produc4 = _categoryState$produc4.filter(function (product) {
|
|
187
|
+
return product.featured;
|
|
188
|
+
})) === null || _categoryState$produc4 === void 0 ? void 0 : _categoryState$produc4.length) > 9 && /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
225
189
|
useCustomFunctionality: true,
|
|
226
190
|
onCustomClick: function onCustomClick() {
|
|
227
191
|
return onClickCategory(category);
|
|
@@ -236,7 +200,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
236
200
|
})))), !(category !== null && category !== void 0 && category.id) && categories.filter(function (category) {
|
|
237
201
|
return (category === null || category === void 0 ? void 0 : category.id) !== null;
|
|
238
202
|
}).map(function (category, i, _categories) {
|
|
239
|
-
var _categoryState$produc5, _categoryState$produc6, _categoryState$produc7, _categoryState$produc8, _category$description, _category$description2, _category$
|
|
203
|
+
var _categoryState$produc5, _categoryState$produc6, _categoryState$produc7, _categoryState$produc8, _category$description, _category$description2, _category$subcategori4, _category$subcategori5, _category$ribbon, _category$ribbon2, _category$ribbon3, _category$ribbon4, _category$ribbon5, _headerRef$current2, _category$description3, _category$subcategori6, _category$subcategori7, _products$filter, _category$subcategori8, _category$subcategori9;
|
|
240
204
|
var _products = !isUseParentCategory ? (_categoryState$produc5 = categoryState === null || categoryState === void 0 || (_categoryState$produc6 = categoryState.products) === null || _categoryState$produc6 === void 0 ? void 0 : _categoryState$produc6.filter(function (product) {
|
|
241
205
|
return (product === null || product === void 0 ? void 0 : product.category_id) === (category === null || category === void 0 ? void 0 : category.id);
|
|
242
206
|
})) !== null && _categoryState$produc5 !== void 0 ? _categoryState$produc5 : [] : (_categoryState$produc7 = categoryState === null || categoryState === void 0 || (_categoryState$produc8 = categoryState.products) === null || _categoryState$produc8 === void 0 ? void 0 : _categoryState$produc8.filter(function (product) {
|
|
@@ -256,7 +220,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
256
220
|
});
|
|
257
221
|
}) : _products;
|
|
258
222
|
var shortCategoryDescription = (category === null || category === void 0 || (_category$description = category.description) === null || _category$description === void 0 ? void 0 : _category$description.length) > 200 ? "".concat(category === null || category === void 0 || (_category$description2 = category.description) === null || _category$description2 === void 0 ? void 0 : _category$description2.substring(0, 200), "...") : category === null || category === void 0 ? void 0 : category.description;
|
|
259
|
-
var isSubcategorySearch = isSearchMode && (category === null || category === void 0 || (_category$
|
|
223
|
+
var isSubcategorySearch = isSearchMode && (category === null || category === void 0 || (_category$subcategori4 = category.subcategories) === null || _category$subcategori4 === void 0 ? void 0 : _category$subcategori4.length) > 0 && (category === null || category === void 0 || (_category$subcategori5 = category.subcategories) === null || _category$subcategori5 === void 0 ? void 0 : _category$subcategori5.some(function (subcategory) {
|
|
260
224
|
return products === null || products === void 0 ? void 0 : products.some(function (product) {
|
|
261
225
|
return (product === null || product === void 0 ? void 0 : product.category_id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.id);
|
|
262
226
|
});
|
|
@@ -281,11 +245,13 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
281
245
|
onClick: function onClick() {
|
|
282
246
|
return setOpenDescription(category);
|
|
283
247
|
}
|
|
284
|
-
}, t('VIEW_MORE', 'View more'))), (category === null || category === void 0 || (_category$
|
|
285
|
-
category: category
|
|
248
|
+
}, t('VIEW_MORE', 'View more'))), (category === null || category === void 0 || (_category$subcategori6 = category.subcategories) === null || _category$subcategori6 === void 0 ? void 0 : _category$subcategori6.length) > 0 && !isSearchMode && /*#__PURE__*/_react.default.createElement(_SubcategoriesComponent.SubcategoriesComponent, {
|
|
249
|
+
category: category,
|
|
250
|
+
subcategoriesSelected: subcategoriesSelected,
|
|
251
|
+
onClickSubcategory: onClickSubcategory
|
|
286
252
|
})), /*#__PURE__*/_react.default.createElement(_styles.ProductsListing, {
|
|
287
253
|
isSubcategorySearch: isSubcategorySearch
|
|
288
|
-
}, isSearchMode && (category === null || category === void 0 || (_category$
|
|
254
|
+
}, isSearchMode && (category === null || category === void 0 || (_category$subcategori7 = category.subcategories) === null || _category$subcategori7 === void 0 ? void 0 : _category$subcategori7.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, products === null || products === void 0 || (_products$filter = products.filter(function (product, i) {
|
|
289
255
|
return i < 9 && (product === null || product === void 0 ? void 0 : product.category_id) === (category === null || category === void 0 ? void 0 : category.id) || (business === null || business === void 0 ? void 0 : business.food);
|
|
290
256
|
})) === null || _products$filter === void 0 ? void 0 : _products$filter.map(function (product, i) {
|
|
291
257
|
var _currentCart$products5;
|
|
@@ -348,11 +314,11 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
348
314
|
key: "skeleton:".concat(i),
|
|
349
315
|
isSkeleton: true
|
|
350
316
|
});
|
|
351
|
-
})), isSearchMode && (category === null || category === void 0 || (_category$
|
|
317
|
+
})), isSearchMode && (category === null || category === void 0 || (_category$subcategori8 = category.subcategories) === null || _category$subcategori8 === void 0 ? void 0 : _category$subcategori8.length) > 0 && (category === null || category === void 0 || (_category$subcategori9 = category.subcategories) === null || _category$subcategori9 === void 0 || (_category$subcategori9 = _category$subcategori9.filter(function (subcategory) {
|
|
352
318
|
return products === null || products === void 0 ? void 0 : products.some(function (product) {
|
|
353
319
|
return (product === null || product === void 0 ? void 0 : product.category_id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.id);
|
|
354
320
|
});
|
|
355
|
-
})) === null || _category$
|
|
321
|
+
})) === null || _category$subcategori9 === void 0 ? void 0 : _category$subcategori9.map(function (subcategory) {
|
|
356
322
|
var _products$filter2;
|
|
357
323
|
return /*#__PURE__*/_react.default.createElement(_styles.SubcategorySearchContainer, {
|
|
358
324
|
key: subcategory === null || subcategory === void 0 ? void 0 : subcategory.id
|
|
@@ -400,15 +366,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
400
366
|
}
|
|
401
367
|
}, /*#__PURE__*/_react.default.createElement(_styles.DescriptionModalContainer, null, (openDescription === null || openDescription === void 0 ? void 0 : openDescription.image) && /*#__PURE__*/_react.default.createElement("img", {
|
|
402
368
|
src: openDescription.image
|
|
403
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, openDescription === null || openDescription === void 0 ? void 0 : openDescription.description))))))
|
|
404
|
-
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
405
|
-
key: i
|
|
406
|
-
}, props));
|
|
407
|
-
}), (_props$afterElements = props.afterElements) === null || _props$afterElements === void 0 ? void 0 : _props$afterElements.map(function (AfterElement, i) {
|
|
408
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
409
|
-
key: i
|
|
410
|
-
}, AfterElement);
|
|
411
|
-
}));
|
|
369
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, openDescription === null || openDescription === void 0 ? void 0 : openDescription.description)))))));
|
|
412
370
|
};
|
|
413
371
|
var BusinessProductsList = exports.BusinessProductsList = function BusinessProductsList(props) {
|
|
414
372
|
var businessProductsListProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -419,7 +419,7 @@ var CartUI = function CartUI(props) {
|
|
|
419
419
|
})), (cart === null || cart === void 0 || (_cart$offers4 = cart.offers) === null || _cart$offers4 === void 0 || (_cart$offers4 = _cart$offers4.filter(function (offer) {
|
|
420
420
|
return (offer === null || offer === void 0 ? void 0 : offer.target) === 1;
|
|
421
421
|
})) === null || _cart$offers4 === void 0 ? void 0 : _cart$offers4.length) > 0 && (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.total) >= 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')), (cart === null || cart === void 0 || (_cart$business = cart.business) === null || _cart$business === void 0 ? void 0 : _cart$business.tax_type) === 1 ? /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_ref = (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) + getIncludedTaxesDiscounts()) !== null && _ref !== void 0 ? _ref : 0)) : /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_cart$subtotal_with_d = cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) !== null && _cart$subtotal_with_d !== void 0 ? _cart$subtotal_with_d : 0))), (cart === null || cart === void 0 || (_cart$taxes3 = cart.taxes) === null || _cart$taxes3 === void 0 ? void 0 : _cart$taxes3.length) > 0 && (cart === null || cart === void 0 || (_cart$taxes4 = cart.taxes) === null || _cart$taxes4 === void 0 ? void 0 : _cart$taxes4.filter(function (tax) {
|
|
422
|
-
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0;
|
|
422
|
+
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'product';
|
|
423
423
|
}).map(function (tax) {
|
|
424
424
|
var _ref2, _tax$summary$tax_afte2, _tax$summary4, _tax$summary5;
|
|
425
425
|
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
@@ -12,6 +12,10 @@ var _Buttons = require("../../styles/Buttons");
|
|
|
12
12
|
var _NotFoundSource = require("../NotFoundSource");
|
|
13
13
|
var _styles = require("./styles");
|
|
14
14
|
var _AutoScroll = require("../AutoScroll");
|
|
15
|
+
var _Modal = _interopRequireDefault(require("../Modal"));
|
|
16
|
+
var _BusinessPreorder = require("../BusinessPreorder");
|
|
17
|
+
var _utils = require("../../../../../utils");
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -31,7 +35,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
35
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
32
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
37
|
var HighestRatedUI = function HighestRatedUI(props) {
|
|
34
|
-
var _businessesList$busin, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _businessesList$busin4, _props$afterComponent, _props$afterElements;
|
|
38
|
+
var _businessesList$busin, _orderState$options, _orderState$options2, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _businessesList$busin4, _props$afterComponent, _props$afterElements;
|
|
35
39
|
var businessesList = props.businessesList,
|
|
36
40
|
handleBusinessClick = props.handleBusinessClick,
|
|
37
41
|
isCustomLayout = props.isCustomLayout,
|
|
@@ -46,10 +50,27 @@ var HighestRatedUI = function HighestRatedUI(props) {
|
|
|
46
50
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
47
51
|
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
48
52
|
orderState = _useOrder2[0];
|
|
53
|
+
var _useState = (0, _react.useState)(false),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
isPreorder = _useState2[0],
|
|
56
|
+
setIsPreorder = _useState2[1];
|
|
57
|
+
var _useState3 = (0, _react.useState)(null),
|
|
58
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
|
+
preorderBusiness = _useState4[0],
|
|
60
|
+
setPreorderBusiness = _useState4[1];
|
|
49
61
|
var isBusinessWithReviews = businessesList === null || businessesList === void 0 || (_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.every(function (business) {
|
|
50
62
|
var _business$reviews;
|
|
51
63
|
return (business === null || business === void 0 || (_business$reviews = business.reviews) === null || _business$reviews === void 0 ? void 0 : _business$reviews.total) === 0;
|
|
52
64
|
});
|
|
65
|
+
var cateringTypeString = (orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) === 8 ? 'catering_pickup' : null;
|
|
66
|
+
var cateringValues = (preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs) && (0, _utils.getCateringValues)(cateringTypeString, preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs);
|
|
67
|
+
var handleClosePreorder = function handleClosePreorder() {
|
|
68
|
+
setIsPreorder(false);
|
|
69
|
+
setPreorderBusiness(null);
|
|
70
|
+
};
|
|
71
|
+
(0, _react.useEffect)(function () {
|
|
72
|
+
if (preorderBusiness) setIsPreorder(true);
|
|
73
|
+
}, [preorderBusiness]);
|
|
53
74
|
(0, _react.useEffect)(function () {
|
|
54
75
|
if (!businessesList.loading) {
|
|
55
76
|
setHasHighRatedBusiness(!isBusinessWithReviews);
|
|
@@ -85,33 +106,45 @@ var HighestRatedUI = function HighestRatedUI(props) {
|
|
|
85
106
|
}, t('CHANGE_ADDRESS', 'Select other Address'))), /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
86
107
|
scrollId: "highestRated"
|
|
87
108
|
}, !(businessesList !== null && businessesList !== void 0 && businessesList.loading) && (businessesList === null || businessesList === void 0 || (_businessesList$busin4 = businessesList.businesses) === null || _businessesList$busin4 === void 0 ? void 0 : _businessesList$busin4.map(function (business) {
|
|
88
|
-
var _business$reviews2, _orderState$
|
|
109
|
+
var _business$reviews2, _orderState$options3;
|
|
89
110
|
return (business === null || business === void 0 || (_business$reviews2 = business.reviews) === null || _business$reviews2 === void 0 ? void 0 : _business$reviews2.total) > 0 && /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
90
111
|
key: business.id,
|
|
91
112
|
className: "card",
|
|
92
113
|
business: business,
|
|
93
114
|
isBusinessOpen: business.open,
|
|
94
115
|
handleCustomClick: handleBusinessClick,
|
|
95
|
-
orderType: orderState === null || orderState === void 0 || (_orderState$
|
|
116
|
+
orderType: orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type,
|
|
96
117
|
isCustomLayout: isCustomLayout,
|
|
97
118
|
isCustomerMode: isCustomerMode,
|
|
98
119
|
favoriteIds: favoriteIds,
|
|
99
|
-
setFavoriteIds: setFavoriteIds
|
|
120
|
+
setFavoriteIds: setFavoriteIds,
|
|
121
|
+
onPreorderBusiness: setPreorderBusiness
|
|
100
122
|
});
|
|
101
123
|
}))), businessesList.loading && _toConsumableArray(Array(8).keys()).map(function (i) {
|
|
102
|
-
var _orderState$
|
|
124
|
+
var _orderState$options4;
|
|
103
125
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
104
126
|
key: i,
|
|
105
127
|
className: "card",
|
|
106
128
|
business: {},
|
|
107
129
|
isSkeleton: true,
|
|
108
|
-
orderType: orderState === null || orderState === void 0 || (_orderState$
|
|
130
|
+
orderType: orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type
|
|
109
131
|
});
|
|
110
132
|
}), businessesList.error && businessesList.error.length > 0 && businessesList.businesses.length === 0 && businessesList.error.map(function (e, i) {
|
|
111
133
|
return /*#__PURE__*/_react.default.createElement(_styles.ErrorMessage, {
|
|
112
134
|
key: i
|
|
113
135
|
}, t('ERROR', 'ERROR'), ": [", (e === null || e === void 0 ? void 0 : e.message) || e, "]");
|
|
114
|
-
})))),
|
|
136
|
+
})))), /*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
137
|
+
open: isPreorder,
|
|
138
|
+
width: "760px",
|
|
139
|
+
onClose: function onClose() {
|
|
140
|
+
return handleClosePreorder();
|
|
141
|
+
}
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_BusinessPreorder.BusinessPreorder, _extends({
|
|
143
|
+
business: preorderBusiness,
|
|
144
|
+
handleClick: handleBusinessClick,
|
|
145
|
+
showButton: true,
|
|
146
|
+
cateringPreorder: !!cateringTypeString
|
|
147
|
+
}, cateringValues))), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
|
|
115
148
|
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
116
149
|
key: i
|
|
117
150
|
}, props));
|
|
@@ -81,7 +81,7 @@ var OrderBillSection = exports.OrderBillSection = function OrderBillSection(prop
|
|
|
81
81
|
color: theme.colors.primary
|
|
82
82
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 || (_offer$summary = offer.summary) === null || _offer$summary === void 0 ? void 0 : _offer$summary.discount)));
|
|
83
83
|
})), (order === null || order === void 0 || (_order$summary5 = order.summary) === null || _order$summary5 === void 0 ? void 0 : _order$summary5.subtotal_with_discount) > 0 && (order === null || order === void 0 || (_order$summary6 = order.summary) === null || _order$summary6 === void 0 ? void 0 : _order$summary6.discount) > 0 && (order === null || order === void 0 || (_order$summary7 = order.summary) === null || _order$summary7 === void 0 ? void 0 : _order$summary7.total) >= 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')), (order === null || order === void 0 ? void 0 : order.tax_type) === 1 ? /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_ref2 = (order === null || order === void 0 || (_order$summary8 = order.summary) === null || _order$summary8 === void 0 ? void 0 : _order$summary8.subtotal_with_discount) + getIncludedTaxesDiscounts()) !== null && _ref2 !== void 0 ? _ref2 : 0)) : /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_order$summary$subtot2 = order === null || order === void 0 || (_order$summary9 = order.summary) === null || _order$summary9 === void 0 ? void 0 : _order$summary9.subtotal_with_discount) !== null && _order$summary$subtot2 !== void 0 ? _order$summary$subtot2 : 0))), (order === null || order === void 0 || (_order$taxes3 = order.taxes) === null || _order$taxes3 === void 0 ? void 0 : _order$taxes3.length) === 0 && (order === null || order === void 0 ? void 0 : order.tax_type) === 2 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('TAX', 'Tax'), /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(order === null || order === void 0 ? void 0 : order.tax, parseNumber), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_order$summary$tax2 = order === null || order === void 0 || (_order$summary10 = order.summary) === null || _order$summary10 === void 0 ? void 0 : _order$summary10.tax) !== null && _order$summary$tax2 !== void 0 ? _order$summary$tax2 : 0))), (order === null || order === void 0 || (_order$fees = order.fees) === null || _order$fees === void 0 ? void 0 : _order$fees.length) === 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SERVICE_FEE', 'Service fee'), /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(order === null || order === void 0 ? void 0 : order.service_fee, parseNumber), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_order$summary$servic = order === null || order === void 0 || (_order$summary11 = order.summary) === null || _order$summary11 === void 0 ? void 0 : _order$summary11.service_fee) !== null && _order$summary$servic !== void 0 ? _order$summary$servic : 0))), (order === null || order === void 0 || (_order$taxes4 = order.taxes) === null || _order$taxes4 === void 0 ? void 0 : _order$taxes4.length) > 0 && (order === null || order === void 0 || (_order$taxes5 = order.taxes) === null || _order$taxes5 === void 0 ? void 0 : _order$taxes5.filter(function (tax) {
|
|
84
|
-
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0;
|
|
84
|
+
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'product';
|
|
85
85
|
}).map(function (tax) {
|
|
86
86
|
var _tax$name, _ref3, _tax$summary$tax_afte2, _tax$summary4, _tax$summary5;
|
|
87
87
|
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
@@ -70,7 +70,10 @@ var OrderEta = exports.OrderEta = function OrderEta(props) {
|
|
|
70
70
|
var _estimatedTime = outputFormat ? (0, _moment.default)(estimatedUtcTime).local().format(outputFormat) : parseDate(estimatedUtcTime, {
|
|
71
71
|
utc: false
|
|
72
72
|
});
|
|
73
|
-
setEstimatedDeliveryTime(
|
|
73
|
+
setEstimatedDeliveryTime((order === null || order === void 0 ? void 0 : order.status) === 13 ? parseDate(_delivery, {
|
|
74
|
+
utc: !!(order !== null && order !== void 0 && order.delivery_datetime_utc),
|
|
75
|
+
outputFormat: outputFormat
|
|
76
|
+
}) : _estimatedTime);
|
|
74
77
|
};
|
|
75
78
|
(0, _react.useEffect)(function () {
|
|
76
79
|
getEstimatedDeliveryTime();
|
|
@@ -183,6 +183,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
183
183
|
var completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17];
|
|
184
184
|
var placeSpotTypes = [3, 4, 5];
|
|
185
185
|
var activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23];
|
|
186
|
+
var preorderStatus = [0, 13];
|
|
186
187
|
var googleMapsApiKey = configs === null || configs === void 0 || (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value;
|
|
187
188
|
var enabledPoweredByOrdering = configs === null || configs === void 0 || (_configs$powered_by_o = configs.powered_by_ordering_module) === null || _configs$powered_by_o === void 0 ? void 0 : _configs$powered_by_o.value;
|
|
188
189
|
var hideOrderActions = (order === null || order === void 0 ? void 0 : order.delivery_type) === 1;
|
|
@@ -585,7 +586,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
585
586
|
var _order$business11;
|
|
586
587
|
return window.open("http://maps.google.com/?q=".concat(order === null || order === void 0 || (_order$business11 = order.business) === null || _order$business11 === void 0 ? void 0 : _order$business11.address));
|
|
587
588
|
}
|
|
588
|
-
}, t('GET_DIRECTIONS', 'Get Directions')))), !hideOrderActions && /*#__PURE__*/_react.default.createElement(_styles.BtsOrderStatus, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
589
|
+
}, t('GET_DIRECTIONS', 'Get Directions')))), !hideOrderActions && !preorderStatus.includes(order === null || order === void 0 ? void 0 : order.status) && /*#__PURE__*/_react.default.createElement(_styles.BtsOrderStatus, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
589
590
|
style: {
|
|
590
591
|
fontSize: 14
|
|
591
592
|
},
|
|
@@ -72,7 +72,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
72
72
|
handleChangeSuboptionState = props.handleChangeSuboptionState,
|
|
73
73
|
handleChangeCommentState = props.handleChangeCommentState,
|
|
74
74
|
productAddedToCartLength = props.productAddedToCartLength,
|
|
75
|
-
|
|
75
|
+
pizzaState = props.pizzaState,
|
|
76
76
|
handleFavoriteProduct = props.handleFavoriteProduct,
|
|
77
77
|
handleCreateGuestUser = props.handleCreateGuestUser,
|
|
78
78
|
actionStatus = props.actionStatus,
|
|
@@ -619,7 +619,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
619
619
|
isSoldOut: isSoldOut,
|
|
620
620
|
scrollDown: scrollDown,
|
|
621
621
|
setIsScrollAvailable: setIsScrollAvailable,
|
|
622
|
-
|
|
622
|
+
pizzaState: pizzaState,
|
|
623
623
|
productCart: productCart
|
|
624
624
|
});
|
|
625
625
|
}))));
|