ordering-ui-external 1.9.1 → 1.9.3
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.ea0875b41af5b7f1d809.js +1 -0
- package/_bundles/{1.ordering-ui.a97bdaf67c563ada4c74.js → 1.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{2.ordering-ui.a97bdaf67c563ada4c74.js → 2.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{4.ordering-ui.a97bdaf67c563ada4c74.js → 4.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{5.ordering-ui.a97bdaf67c563ada4c74.js → 5.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{6.ordering-ui.a97bdaf67c563ada4c74.js → 6.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{7.ordering-ui.a97bdaf67c563ada4c74.js → 7.ordering-ui.ea0875b41af5b7f1d809.js} +2 -2
- package/_bundles/{7.ordering-ui.a97bdaf67c563ada4c74.js.LICENSE.txt → 7.ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a97bdaf67c563ada4c74.js → 8.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{9.ordering-ui.a97bdaf67c563ada4c74.js → 9.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/ordering-ui.ea0875b41af5b7f1d809.js +2 -0
- package/_bundles/{ordering-ui.a97bdaf67c563ada4c74.js.LICENSE.txt → ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt} +0 -0
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +9 -10
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/AddressList/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +50 -14
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +9 -2
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +10 -6
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +34 -129
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +29 -40
- package/_modules/themes/five/src/components/Cart/index.js +6 -3
- package/_modules/themes/five/src/components/CartContent/index.js +97 -2
- package/_modules/themes/five/src/components/CartContent/styles.js +6 -4
- package/_modules/themes/five/src/components/Checkout/index.js +8 -2
- package/_modules/themes/five/src/components/Checkout/styles.js +10 -4
- package/_modules/themes/five/src/components/Header/index.js +26 -34
- package/_modules/themes/five/src/components/Header/styles.js +46 -35
- package/_modules/themes/five/src/components/HeaderOption/index.js +3 -2
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +3 -2
- package/_modules/themes/five/src/components/MultiCheckout/index.js +20 -10
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +11 -8
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +2 -0
- package/_modules/themes/five/src/components/OrderContextUI/index.js +192 -0
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +41 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +5 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +8 -2
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +17 -8
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +27 -27
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +7 -2
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +17 -14
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +16 -16
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +49 -41
- package/package.json +2 -1
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +12 -12
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/AddressList/index.js +3 -2
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +54 -18
- package/src/themes/five/src/components/BusinessProductsListing/index.js +14 -2
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +18 -6
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -85
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -77
- package/src/themes/five/src/components/Cart/index.js +6 -3
- package/src/themes/five/src/components/CartContent/index.js +61 -3
- package/src/themes/five/src/components/CartContent/styles.js +6 -0
- package/src/themes/five/src/components/Checkout/index.js +16 -2
- package/src/themes/five/src/components/Checkout/styles.js +19 -6
- package/src/themes/five/src/components/Header/index.js +281 -277
- package/src/themes/five/src/components/Header/styles.js +20 -51
- package/src/themes/five/src/components/HeaderOption/index.js +3 -2
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +2 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +26 -6
- package/src/themes/five/src/components/MultiCheckout/styles.js +8 -13
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +2 -0
- package/src/themes/five/src/components/OrderContextUI/index.js +133 -0
- package/src/themes/five/src/components/OrderContextUI/styles.js +86 -0
- package/src/themes/five/src/components/OrderDetails/index.js +6 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +5 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +4 -0
- package/src/themes/five/src/components/ProductItemAccordion/index.js +58 -40
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +4 -3
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +8 -1
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +6 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +12 -13
- package/src/themes/five/src/components/SingleOrderCard/styles.js +26 -7
- package/template/app.js +1 -1
- package/template/components/ListenPageChanges/index.js +3 -2
- package/template/components/OrderingThemeUpdated/index.js +41 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/MessagesList/index.js +2 -0
- package/template/pages/MultiCart/index.js +24 -0
- package/template/pages/MultiCheckout/index.js +86 -10
- package/template/pages/MultiOrdersDetails/index.js +9 -4
- package/_bundles/0.ordering-ui.a97bdaf67c563ada4c74.js +0 -1
- package/_bundles/ordering-ui.a97bdaf67c563ada4c74.js +0 -2
|
@@ -10,8 +10,13 @@ var _styledComponents = require("styled-components");
|
|
|
10
10
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
11
11
|
var _styles = require("./styles");
|
|
12
12
|
var _Cart = require("../Cart");
|
|
13
|
+
var _Buttons = require("../../styles/Buttons");
|
|
13
14
|
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); }
|
|
14
15
|
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; }
|
|
16
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
+
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."); }
|
|
18
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
19
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
21
|
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."); }
|
|
17
22
|
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); }
|
|
@@ -19,7 +24,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
19
24
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
26
|
var CartContent = function CartContent(props) {
|
|
22
|
-
var _theme$images, _theme$images$general;
|
|
27
|
+
var _configs$checkout_mul, _Object$values, _theme$images, _theme$images$general;
|
|
23
28
|
var carts = props.carts,
|
|
24
29
|
isOrderStateCarts = props.isOrderStateCarts,
|
|
25
30
|
isCartPopover = props.isCartPopover,
|
|
@@ -34,15 +39,102 @@ var CartContent = function CartContent(props) {
|
|
|
34
39
|
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
35
40
|
_useEvent2 = _slicedToArray(_useEvent, 1),
|
|
36
41
|
events = _useEvent2[0];
|
|
42
|
+
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
43
|
+
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
44
|
+
orderState = _useOrder2[0];
|
|
45
|
+
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
46
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
47
|
+
configs = _useConfig2[0].configs;
|
|
37
48
|
var _useState = (0, _react.useState)(null),
|
|
38
49
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
50
|
currentCartUuid = _useState2[0],
|
|
40
51
|
setCurrentCartUuid = _useState2[1];
|
|
52
|
+
var checkoutMultiBusinessEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$checkout_mul = configs.checkout_multi_business_enabled) === null || _configs$checkout_mul === void 0 ? void 0 : _configs$checkout_mul.value) === '1';
|
|
53
|
+
var openCarts = ((_Object$values = Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts)) === null || _Object$values === void 0 ? void 0 : _Object$values.filter(function (cart) {
|
|
54
|
+
var _cart$products;
|
|
55
|
+
return (cart === null || cart === void 0 ? void 0 : cart.products) && (cart === null || cart === void 0 ? void 0 : (_cart$products = cart.products) === null || _cart$products === void 0 ? void 0 : _cart$products.length) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (cart === null || cart === void 0 ? void 0 : cart.valid_schedule) && (cart === null || cart === void 0 ? void 0 : cart.valid_products) && (cart === null || cart === void 0 ? void 0 : cart.valid_address) && (cart === null || cart === void 0 ? void 0 : cart.valid_maximum) && (cart === null || cart === void 0 ? void 0 : cart.valid_minimum) && !(cart !== null && cart !== void 0 && cart.wallets);
|
|
56
|
+
})) || null || [];
|
|
41
57
|
var handleAddProduct = function handleAddProduct(product, cart) {
|
|
42
58
|
setCurrentCartUuid(cart === null || cart === void 0 ? void 0 : cart.uuid);
|
|
43
59
|
};
|
|
44
60
|
var handleSetCurrentCartUuid = function handleSetCurrentCartUuid() {
|
|
45
61
|
setCurrentCartUuid(null);
|
|
62
|
+
props.onClose && props.onClose();
|
|
63
|
+
};
|
|
64
|
+
var handleClickCheckout = function handleClickCheckout() {
|
|
65
|
+
var _cart$group2, _Object$values$filter, _Object$values$filter2;
|
|
66
|
+
var cart = carts.find(function (cart) {
|
|
67
|
+
var _cart$group;
|
|
68
|
+
return cart === null || cart === void 0 ? void 0 : (_cart$group = cart.group) === null || _cart$group === void 0 ? void 0 : _cart$group.uuid;
|
|
69
|
+
});
|
|
70
|
+
var cartSelectedHasGroup = cart === null || cart === void 0 ? void 0 : (_cart$group2 = cart.group) === null || _cart$group2 === void 0 ? void 0 : _cart$group2.uuid;
|
|
71
|
+
var cartFilterValidation = function cartFilterValidation(cart) {
|
|
72
|
+
return (cart === null || cart === void 0 ? void 0 : cart.valid) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2;
|
|
73
|
+
};
|
|
74
|
+
var cartsGroupLength = cartSelectedHasGroup ? (_Object$values$filter = Object.values(orderState.carts).filter(function (_cart) {
|
|
75
|
+
var _cart$group3;
|
|
76
|
+
return (_cart === null || _cart === void 0 ? void 0 : (_cart$group3 = _cart.group) === null || _cart$group3 === void 0 ? void 0 : _cart$group3.uuid) === cartSelectedHasGroup && cartFilterValidation(_cart);
|
|
77
|
+
})) === null || _Object$values$filter === void 0 ? void 0 : _Object$values$filter.length : 0;
|
|
78
|
+
if (cartsGroupLength > 1 && checkoutMultiBusinessEnabled) {
|
|
79
|
+
var _cart$group4;
|
|
80
|
+
events.emit('go_to_page', {
|
|
81
|
+
page: 'multi_checkout',
|
|
82
|
+
params: {
|
|
83
|
+
cartUuid: cart === null || cart === void 0 ? void 0 : (_cart$group4 = cart.group) === null || _cart$group4 === void 0 ? void 0 : _cart$group4.uuid
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
events.emit('cart_popover_closed');
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
var cartGroupsCount = {};
|
|
90
|
+
// eslint-disable-next-line no-unused-expressions
|
|
91
|
+
(_Object$values$filter2 = Object.values(orderState.carts).filter(function (_cart) {
|
|
92
|
+
return cartFilterValidation(_cart);
|
|
93
|
+
})) === null || _Object$values$filter2 === void 0 ? void 0 : _Object$values$filter2.forEach(function (_cart) {
|
|
94
|
+
var _cart$group5;
|
|
95
|
+
if (cartGroupsCount[_cart === null || _cart === void 0 ? void 0 : (_cart$group5 = _cart.group) === null || _cart$group5 === void 0 ? void 0 : _cart$group5.uuid]) {
|
|
96
|
+
var _cart$group6;
|
|
97
|
+
cartGroupsCount[_cart === null || _cart === void 0 ? void 0 : (_cart$group6 = _cart.group) === null || _cart$group6 === void 0 ? void 0 : _cart$group6.uuid] += 1;
|
|
98
|
+
} else {
|
|
99
|
+
var _cart$group7;
|
|
100
|
+
cartGroupsCount[_cart === null || _cart === void 0 ? void 0 : (_cart$group7 = _cart.group) === null || _cart$group7 === void 0 ? void 0 : _cart$group7.uuid] = 1;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
var groupForTheCart;
|
|
104
|
+
var groupForAddCartArray = Object.keys(cartGroupsCount).filter(function (cartGroupUuid) {
|
|
105
|
+
return cartGroupsCount[cartGroupUuid] > 0 && cartGroupsCount[cartGroupUuid] < 5;
|
|
106
|
+
});
|
|
107
|
+
var max = Math.max.apply(Math, _toConsumableArray(groupForAddCartArray.map(function (uuid) {
|
|
108
|
+
return cartGroupsCount[uuid];
|
|
109
|
+
})));
|
|
110
|
+
var indexes = groupForAddCartArray.filter(function (uuid) {
|
|
111
|
+
return cartGroupsCount[uuid] === max;
|
|
112
|
+
});
|
|
113
|
+
if ((indexes === null || indexes === void 0 ? void 0 : indexes.length) > 1) {
|
|
114
|
+
groupForTheCart = indexes.find(function (uuid) {
|
|
115
|
+
return uuid !== 'undefined';
|
|
116
|
+
});
|
|
117
|
+
} else {
|
|
118
|
+
groupForTheCart = indexes[0];
|
|
119
|
+
}
|
|
120
|
+
if (checkoutMultiBusinessEnabled && (openCarts === null || openCarts === void 0 ? void 0 : openCarts.length) > 1 && groupForTheCart) {
|
|
121
|
+
events.emit('go_to_page', {
|
|
122
|
+
page: 'multi_cart',
|
|
123
|
+
params: {
|
|
124
|
+
cartUuid: cart === null || cart === void 0 ? void 0 : cart.uuid,
|
|
125
|
+
cartGroup: groupForTheCart === 'undefined' ? 'create' : groupForTheCart
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
events.emit('go_to_page', {
|
|
130
|
+
page: 'checkout',
|
|
131
|
+
params: {
|
|
132
|
+
cartUuid: cart === null || cart === void 0 ? void 0 : cart.uuid
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
events.emit('cart_popover_closed');
|
|
137
|
+
props.onClose && props.onClose();
|
|
46
138
|
};
|
|
47
139
|
(0, _react.useEffect)(function () {
|
|
48
140
|
events.on('cart_popover_closed', handleSetCurrentCartUuid);
|
|
@@ -52,7 +144,10 @@ var CartContent = function CartContent(props) {
|
|
|
52
144
|
events.off('cart_product_added', handleAddProduct);
|
|
53
145
|
};
|
|
54
146
|
}, []);
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, null, !isSlideBar && /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('YOUR_CART', 'Your cart')),
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, null, !isSlideBar && /*#__PURE__*/_react.default.createElement(_styles.WrapperContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('YOUR_CART', 'Your cart')), checkoutMultiBusinessEnabled && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
148
|
+
onClick: handleClickCheckout,
|
|
149
|
+
color: "primary"
|
|
150
|
+
}, t('CHECKOUT', 'Checkout'))), isOrderStateCarts && (carts === null || carts === void 0 ? void 0 : carts.length) > 0 && carts.map(function (cart) {
|
|
56
151
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
57
152
|
key: cart.uuid
|
|
58
153
|
}, cart.products.length > 0 && /*#__PURE__*/_react.default.createElement(_Cart.Cart, {
|
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.Title = exports.NotCarts = exports.Container = void 0;
|
|
6
|
+
exports.WrapperContainer = exports.Title = exports.NotCarts = exports.Container = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
8
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
11
|
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0px 10px;\n\n div:not(:last-child) {\n padding-bottom: 5px;\n }\n\n @media (min-width: 769px) {\n margin-bottom: 10px;\n padding: 15px;\n }\n"])));
|
|
12
12
|
exports.Container = Container;
|
|
13
|
-
var
|
|
13
|
+
var WrapperContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n justify-content: space-between;\n"])));
|
|
14
|
+
exports.WrapperContainer = WrapperContainer;
|
|
15
|
+
var NotCarts = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 300px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 80%;\n margin: auto;\n\n img {\n width: 200px;\n height: auto;\n aspect-ratio: attr(width) / attr(height)\n }\n h1 {\n margin: 5px 0px 0px;\n opacity: 0.5;\n text-align: center;\n font-size: 24px;\n }\n"])));
|
|
14
16
|
exports.NotCarts = NotCarts;
|
|
15
|
-
var Title = _styledComponents.default.h1(
|
|
17
|
+
var Title = _styledComponents.default.h1(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-weight: 600;\n font-size: 20px;\n color: ", ";\n margin-bottom: 8px;\n line-height: 30px;\n margin-top: 0;\n text-align: center;\n\n @media (min-width: 576px) {\n text-align: left;\n }\n"])), function (props) {
|
|
16
18
|
return props.theme.colors.darkTextColor;
|
|
17
19
|
});
|
|
18
20
|
exports.Title = Title;
|
|
@@ -30,6 +30,7 @@ var _Confirm = require("../Confirm");
|
|
|
30
30
|
var _CartContent = require("../CartContent");
|
|
31
31
|
var _Select = require("../../styles/Select");
|
|
32
32
|
var _PlaceSpot = require("../PlaceSpot");
|
|
33
|
+
var _OrderContextUI = require("../OrderContextUI");
|
|
33
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
35
|
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); }
|
|
35
36
|
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; }
|
|
@@ -262,12 +263,17 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
262
263
|
if (cart !== null && cart !== void 0 && (_cart$products = cart.products) !== null && _cart$products !== void 0 && _cart$products.length) return;
|
|
263
264
|
handleStoreRedirect(cart === null || cart === void 0 ? void 0 : (_cart$business = cart.business) === null || _cart$business === void 0 ? void 0 : _cart$business.slug);
|
|
264
265
|
}, [cart === null || cart === void 0 ? void 0 : cart.products]);
|
|
265
|
-
|
|
266
|
+
(0, _react.useEffect)(function () {
|
|
267
|
+
window.scrollTo(0, 0);
|
|
268
|
+
}, []);
|
|
269
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperLeftContainer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperLeftContent, null, /*#__PURE__*/_react.default.createElement(_styles.HeaderContent, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ArrowLeft, {
|
|
266
270
|
className: "back-arrow",
|
|
267
271
|
onClick: function onClick() {
|
|
268
272
|
return history.goBack();
|
|
269
273
|
}
|
|
270
|
-
}),
|
|
274
|
+
}), (windowSize === null || windowSize === void 0 ? void 0 : windowSize.width) < 576 && /*#__PURE__*/_react.default.createElement(_styles.OrderContextUIWrapper, null, /*#__PURE__*/_react.default.createElement(_OrderContextUI.OrderContextUI, {
|
|
275
|
+
isCheckOut: true
|
|
276
|
+
}))), !cartState.loading && (cart === null || cart === void 0 ? void 0 : cart.status) === 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningMessage, null, /*#__PURE__*/_react.default.createElement(_VscWarning.default, null), /*#__PURE__*/_react.default.createElement("h1", null, t('CART_STATUS_PENDING_MESSAGE', 'Your order is being processed, please wait a little more. if you\'ve been waiting too long, please reload the page'))), /*#__PURE__*/_react.default.createElement("h2", {
|
|
271
277
|
className: "checkout-title"
|
|
272
278
|
}, t('CHECK_OUT', 'Checkout')), !useKioskApp ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, businessDetails !== null && businessDetails !== void 0 && businessDetails.loading || cartState.loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
273
279
|
style: {
|
|
@@ -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.WrapperUserDetails = exports.WrapperRightContainer = exports.WrapperPlaceOrderButton = exports.WrapperLeftContent = exports.WrapperLeftContainer = exports.WrapperActionsInput = exports.WarningText = exports.WarningMessage = exports.WalletPaymentOptionContainer = exports.UserDetailsContainer = exports.SelectSpotContainer = exports.PaymentMethodContainer = exports.NotFoundImage = exports.MobileWrapperPlaceOrderButton = exports.DriverTipDivider = exports.DriverTipContainer = exports.DeliveryOptionsContainer = exports.Container = exports.CheckOutDivider = exports.CartsList = exports.CartHeader = exports.CartContainer = exports.BusinessDetailsContainer = void 0;
|
|
7
|
+
exports.WrapperUserDetails = exports.WrapperRightContainer = exports.WrapperPlaceOrderButton = exports.WrapperLeftContent = exports.WrapperLeftContainer = exports.WrapperActionsInput = exports.WarningText = exports.WarningMessage = exports.WalletPaymentOptionContainer = exports.UserDetailsContainer = exports.SelectSpotContainer = exports.PaymentMethodContainer = exports.OrderContextUIWrapper = exports.NotFoundImage = exports.MobileWrapperPlaceOrderButton = exports.HeaderContent = exports.DriverTipDivider = exports.DriverTipContainer = exports.DeliveryOptionsContainer = exports.Container = exports.CheckOutDivider = exports.CartsList = exports.CartHeader = exports.CartContainer = exports.BusinessDetailsContainer = 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, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27;
|
|
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) } })); }
|
|
@@ -49,7 +49,7 @@ var WarningText = _styledComponents.default.p(_templateObject16 || (_templateObj
|
|
|
49
49
|
return props.theme.colors.primary;
|
|
50
50
|
});
|
|
51
51
|
exports.WarningText = WarningText;
|
|
52
|
-
var WrapperLeftContent = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n width: 100%;\n\n .checkout-title {\n margin: 0;\n font-weight: 600;\n font-size: 32px;\n color: ", ";\n }\n
|
|
52
|
+
var WrapperLeftContent = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n width: 100%;\n\n .checkout-title {\n margin: 0;\n font-weight: 600;\n font-size: 32px;\n color: ", ";\n }\n"])), function (props) {
|
|
53
53
|
var _props$theme2;
|
|
54
54
|
return (_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.colors.darkTextColor;
|
|
55
55
|
});
|
|
@@ -69,4 +69,10 @@ exports.SelectSpotContainer = SelectSpotContainer;
|
|
|
69
69
|
var WrapperActionsInput = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n input {\n width: 100%;\n }\n h1 {\n font-size: 20px;\n }\n"])));
|
|
70
70
|
exports.WrapperActionsInput = WrapperActionsInput;
|
|
71
71
|
var MobileWrapperPlaceOrderButton = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _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 min-height: 44px;\n border-radius: 7.6px;\n }\n"])));
|
|
72
|
-
exports.MobileWrapperPlaceOrderButton = MobileWrapperPlaceOrderButton;
|
|
72
|
+
exports.MobileWrapperPlaceOrderButton = MobileWrapperPlaceOrderButton;
|
|
73
|
+
var OrderContextUIWrapper = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n flex: 1;\n margin-left: 15px;\n ", "\n"])), function (props) {
|
|
74
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n margin-left: 0px;\n margin-right: 15px;\n "])));
|
|
75
|
+
});
|
|
76
|
+
exports.OrderContextUIWrapper = OrderContextUIWrapper;
|
|
77
|
+
var HeaderContent = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-bottom: 10px;\n .back-arrow {\n font-size: 24px;\n cursor: pointer;\n }\n"])));
|
|
78
|
+
exports.HeaderContent = HeaderContent;
|
|
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.Header = void 0;
|
|
7
|
+
exports.default = exports.Header = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactRouterDom = require("react-router-dom");
|
|
10
10
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
@@ -51,7 +51,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
51
51
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
52
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
53
|
var Header = function Header(props) {
|
|
54
|
-
var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _customerState$user, _orderState$options3, _orderState$options3$,
|
|
54
|
+
var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _theme$header, _theme$header$compone, _theme$header$compone2, _customerState$user, _orderState$options3, _orderState$options3$, _theme$images, _theme$images$logos, _orderingTheme$my_pro, _orderingTheme$my_pro2, _orderingTheme$my_pro3, _orderingTheme$my_pro4, _orderingTheme$my_pro5, _orderingTheme$my_pro6, _theme$images2, _theme$images2$logos, _theme$images3, _theme$images3$logos, _orderingTheme$my_pro7, _orderingTheme$my_pro8, _orderingTheme$my_pro9, _orderingTheme$my_pro10, _orderingTheme$my_pro11, _orderingTheme$my_pro12, _theme$images4, _theme$images4$logos, _theme$images5, _theme$images5$logos, _orderState$options5, _orderState$options5$, _orderState$options6, _orderState$options6$, _configState$configs4, _configState$configs5, _configState$configs6, _configState$configs7, _configState$configs8, _configState$configs9, _orderState$options7, _orderState$options8, _configState$configs10, _configState$configs11, _theme$defaultLanguag2, _theme$defaultLanguag3, _orderState$options9, _orderState$options9$, _configState$configs12, _configState$configs13, _orderState$options10, _configState$configs14, _configState$configs15, _configState$configs16, _configState$configs17, _orderState$options11, _orderState$options12, _configState$configs18, _configState$configs19, _orderState$options13, _configState$configs20, _configState$configs21, _configState$configs22, _configState$configs23, _orderState$options14, _orderState$options15, _customerState$user2, _customerState$user3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9;
|
|
55
55
|
var isHome = props.isHome,
|
|
56
56
|
location = props.location,
|
|
57
57
|
isShowOrderOptions = props.isShowOrderOptions,
|
|
@@ -151,6 +151,7 @@ var Header = function Header(props) {
|
|
|
151
151
|
})) || [];
|
|
152
152
|
var isPreOrderSetting = (configState === null || configState === void 0 ? void 0 : (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 ? void 0 : (_configState$configs3 = _configState$configs2.preorder_status_enabled) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) === '1';
|
|
153
153
|
var isChew = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme = orderingTheme.theme) === null || _orderingTheme$theme === void 0 ? void 0 : (_orderingTheme$theme$ = _orderingTheme$theme.header) === null || _orderingTheme$theme$ === void 0 ? void 0 : (_orderingTheme$theme$2 = _orderingTheme$theme$.components) === null || _orderingTheme$theme$2 === void 0 ? void 0 : (_orderingTheme$theme$3 = _orderingTheme$theme$2.layout) === null || _orderingTheme$theme$3 === void 0 ? void 0 : (_orderingTheme$theme$4 = _orderingTheme$theme$3.type) === null || _orderingTheme$theme$4 === void 0 ? void 0 : _orderingTheme$theme$4.toLowerCase()) === 'chew';
|
|
154
|
+
var isHideLanguages = theme === null || theme === void 0 ? void 0 : (_theme$header = theme.header) === null || _theme$header === void 0 ? void 0 : (_theme$header$compone = _theme$header.components) === null || _theme$header$compone === void 0 ? void 0 : (_theme$header$compone2 = _theme$header$compone.language_selector) === null || _theme$header$compone2 === void 0 ? void 0 : _theme$header$compone2.hidden;
|
|
154
155
|
var handleSuccessSignup = function handleSuccessSignup(user) {
|
|
155
156
|
var _user$session;
|
|
156
157
|
login({
|
|
@@ -256,17 +257,9 @@ var Header = function Header(props) {
|
|
|
256
257
|
maximumAge: 0
|
|
257
258
|
});
|
|
258
259
|
}, [orderState === null || orderState === void 0 ? void 0 : (_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$.location, pathname]);
|
|
259
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
260
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
261
|
-
key: i
|
|
262
|
-
}, BeforeElement);
|
|
263
|
-
}), (_props$beforeComponen = props.beforeComponents) === null || _props$beforeComponen === void 0 ? void 0 : _props$beforeComponen.map(function (BeforeComponent, i) {
|
|
264
|
-
return /*#__PURE__*/_react.default.createElement(BeforeComponent, _extends({
|
|
265
|
-
key: i
|
|
266
|
-
}, props));
|
|
267
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.Header, {
|
|
260
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Header, {
|
|
268
261
|
isChew: isChew
|
|
269
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.InnerHeader, null, /*#__PURE__*/_react.default.createElement(_styles.LeftHeader, {
|
|
262
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.InnerHeader, null, /*#__PURE__*/_react.default.createElement(_styles.LeftSide, null, /*#__PURE__*/_react.default.createElement(_styles.LeftHeader, {
|
|
270
263
|
id: "left-side"
|
|
271
264
|
}, /*#__PURE__*/_react.default.createElement(_SidebarMenu.SidebarMenu, {
|
|
272
265
|
auth: auth,
|
|
@@ -293,7 +286,7 @@ var Header = function Header(props) {
|
|
|
293
286
|
height: isChew ? '20px' : '45px',
|
|
294
287
|
src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$logos = _theme$images3.logos) === null || _theme$images3$logos === void 0 ? void 0 : _theme$images3$logos.chewLogo : (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$my_pro7 = orderingTheme.my_products) === null || _orderingTheme$my_pro7 === void 0 ? void 0 : (_orderingTheme$my_pro8 = _orderingTheme$my_pro7.components) === null || _orderingTheme$my_pro8 === void 0 ? void 0 : (_orderingTheme$my_pro9 = _orderingTheme$my_pro8.images) === null || _orderingTheme$my_pro9 === void 0 ? void 0 : (_orderingTheme$my_pro10 = _orderingTheme$my_pro9.components) === null || _orderingTheme$my_pro10 === void 0 ? void 0 : (_orderingTheme$my_pro11 = _orderingTheme$my_pro10.logo) === null || _orderingTheme$my_pro11 === void 0 ? void 0 : (_orderingTheme$my_pro12 = _orderingTheme$my_pro11.components) === null || _orderingTheme$my_pro12 === void 0 ? void 0 : _orderingTheme$my_pro12.image) || (isHome ? theme === null || theme === void 0 ? void 0 : (_theme$images4 = theme.images) === null || _theme$images4 === void 0 ? void 0 : (_theme$images4$logos = _theme$images4.logos) === null || _theme$images4$logos === void 0 ? void 0 : _theme$images4$logos.isotypeInvert : theme === null || theme === void 0 ? void 0 : (_theme$images5 = theme.images) === null || _theme$images5 === void 0 ? void 0 : (_theme$images5$logos = _theme$images5.logos) === null || _theme$images5$logos === void 0 ? void 0 : _theme$images5$logos.isotype),
|
|
295
288
|
loading: "lazy"
|
|
296
|
-
}))), isShowOrderOptions && !props.isCustomLayout && /*#__PURE__*/_react.default.createElement(_styles.Menu, {
|
|
289
|
+
}))), isShowOrderOptions && !props.isCustomLayout && windowSize.width >= 576 && /*#__PURE__*/_react.default.createElement(_styles.Menu, {
|
|
297
290
|
id: "center-side",
|
|
298
291
|
className: "left-header",
|
|
299
292
|
isCustomerMode: isCustomerMode,
|
|
@@ -330,7 +323,7 @@ var Header = function Header(props) {
|
|
|
330
323
|
return openModal(variant);
|
|
331
324
|
},
|
|
332
325
|
orderTypeList: orderTypeList
|
|
333
|
-
})), windowSize.width > 1200 && window.location.pathname === '/search' && /*#__PURE__*/_react.default.createElement(_styles.HeaderSearchMode, null, /*#__PURE__*/_react.default.createElement(_SearchBar.SearchBar, {
|
|
326
|
+
}))), windowSize.width > 1200 && window.location.pathname === '/search' && /*#__PURE__*/_react.default.createElement(_styles.HeaderSearchMode, null, /*#__PURE__*/_react.default.createElement(_SearchBar.SearchBar, {
|
|
334
327
|
lazyLoad: true,
|
|
335
328
|
search: searchValue,
|
|
336
329
|
placeholder: t('SEARCH_BUSINESSES', 'Search Businesses'),
|
|
@@ -348,22 +341,23 @@ var Header = function Header(props) {
|
|
|
348
341
|
}, /*#__PURE__*/_react.default.createElement(_styles.Menu, {
|
|
349
342
|
isCustomerMode: isCustomerMode
|
|
350
343
|
}, !auth && windowSize.width > 920 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.MenuLink, {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
},
|
|
344
|
+
name: "signin",
|
|
345
|
+
highlight: isChew && 1,
|
|
354
346
|
style: {
|
|
355
347
|
whiteSpace: 'nowrap'
|
|
356
348
|
},
|
|
357
|
-
name: "signin"
|
|
358
|
-
}, t('LOGIN', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.LOGIN) || 'Login')), !isHideSignup && /*#__PURE__*/_react.default.createElement(_styles.MenuLink, {
|
|
359
349
|
onClick: function onClick() {
|
|
360
|
-
return handleOpenLoginSignUp('
|
|
361
|
-
}
|
|
350
|
+
return handleOpenLoginSignUp('login');
|
|
351
|
+
}
|
|
352
|
+
}, t('LOGIN', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.LOGIN) || 'Login')), !isHideSignup && /*#__PURE__*/_react.default.createElement(_styles.MenuLink, {
|
|
353
|
+
name: "signup",
|
|
362
354
|
highlight: 1,
|
|
363
355
|
style: {
|
|
364
356
|
whiteSpace: 'nowrap'
|
|
365
357
|
},
|
|
366
|
-
|
|
358
|
+
onClick: function onClick() {
|
|
359
|
+
return handleOpenLoginSignUp('signup');
|
|
360
|
+
}
|
|
367
361
|
}, t('SIGN_UP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag3 = theme.defaultLanguages) === null || _theme$defaultLanguag3 === void 0 ? void 0 : _theme$defaultLanguag3.SIGN_UP) || 'Sign up'))), auth && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isShowOrderOptions && (windowSize.width > 768 ? /*#__PURE__*/_react.default.createElement(_CartPopover.CartPopover, {
|
|
368
362
|
open: openPopover.cart,
|
|
369
363
|
carts: cartsWithProducts,
|
|
@@ -396,7 +390,8 @@ var Header = function Header(props) {
|
|
|
396
390
|
onClose: function onClose() {
|
|
397
391
|
return handleClosePopover('user');
|
|
398
392
|
}
|
|
399
|
-
})), /*#__PURE__*/_react.default.createElement(_styles.LanguageSelectorWrapper, null, /*#__PURE__*/_react.default.createElement(_LanguageSelector.LanguageSelector, null))))), onlineStatus && isShowOrderOptions && !props.isCustomLayout && !isCustomerMode && (windowSize.width > 768 && windowSize.width <= 820 ? /*#__PURE__*/_react.default.createElement(_styles.SubMenu, null, isFarAway && /*#__PURE__*/_react.default.createElement(_styles.FarAwayMessage, null, /*#__PURE__*/_react.default.createElement(_TiWarningOutline.default, null), /*#__PURE__*/_react.default.createElement("span", null, t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address'))), /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
|
|
393
|
+
})), !isHideLanguages && /*#__PURE__*/_react.default.createElement(_styles.LanguageSelectorWrapper, null, /*#__PURE__*/_react.default.createElement(_LanguageSelector.LanguageSelector, null))))), onlineStatus && isShowOrderOptions && !props.isCustomLayout && !isCustomerMode && (windowSize.width > 768 && windowSize.width <= 820 ? /*#__PURE__*/_react.default.createElement(_styles.SubMenu, null, isFarAway && /*#__PURE__*/_react.default.createElement(_styles.FarAwayMessage, null, /*#__PURE__*/_react.default.createElement(_TiWarningOutline.default, null), /*#__PURE__*/_react.default.createElement("span", null, t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address'))), /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
|
|
394
|
+
isChew: isChew,
|
|
400
395
|
onClick: function onClick() {
|
|
401
396
|
return openModal('address');
|
|
402
397
|
}
|
|
@@ -406,11 +401,14 @@ var Header = function Header(props) {
|
|
|
406
401
|
onClick: (configState === null || configState === void 0 ? void 0 : (_configState$configs14 = configState.configs) === null || _configState$configs14 === void 0 ? void 0 : (_configState$configs15 = _configState$configs14.max_days_preorder) === null || _configState$configs15 === void 0 ? void 0 : _configState$configs15.value) === -1 || (configState === null || configState === void 0 ? void 0 : (_configState$configs16 = configState.configs) === null || _configState$configs16 === void 0 ? void 0 : (_configState$configs17 = _configState$configs16.max_days_preorder) === null || _configState$configs17 === void 0 ? void 0 : _configState$configs17.value) === 0 ? null : function (variant) {
|
|
407
402
|
return openModal(variant);
|
|
408
403
|
}
|
|
409
|
-
})) : /*#__PURE__*/_react.default.createElement(_styles.SubMenu, null, isFarAway && /*#__PURE__*/_react.default.createElement(_styles.FarAwayMessage, null, /*#__PURE__*/_react.default.createElement(_TiWarningOutline.default, null), /*#__PURE__*/_react.default.createElement("span", null, t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address'))), /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
404
|
+
})) : windowSize.width >= 576 && /*#__PURE__*/_react.default.createElement(_styles.SubMenu, null, isFarAway && /*#__PURE__*/_react.default.createElement(_styles.FarAwayMessage, null, /*#__PURE__*/_react.default.createElement(_TiWarningOutline.default, null), /*#__PURE__*/_react.default.createElement("span", null, t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address'))), /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
410
405
|
variant: "address",
|
|
411
406
|
addressState: orderState === null || orderState === void 0 ? void 0 : (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : (_orderState$options12 = _orderState$options11.address) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.address,
|
|
412
407
|
onClick: function onClick(variant) {
|
|
413
408
|
return openModal(variant);
|
|
409
|
+
},
|
|
410
|
+
containerStyle: {
|
|
411
|
+
width: '80%'
|
|
414
412
|
}
|
|
415
413
|
}), !isCustomerMode && (isPreOrderSetting || (configState === null || configState === void 0 ? void 0 : (_configState$configs18 = configState.configs) === null || _configState$configs18 === void 0 ? void 0 : (_configState$configs19 = _configState$configs18.preorder_status_enabled) === null || _configState$configs19 === void 0 ? void 0 : _configState$configs19.value) === undefined) && /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
416
414
|
variant: "moment",
|
|
@@ -574,17 +572,11 @@ var Header = function Header(props) {
|
|
|
574
572
|
business: preorderBusiness,
|
|
575
573
|
handleClick: handleBusinessClick,
|
|
576
574
|
showButton: true
|
|
577
|
-
})))
|
|
578
|
-
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
579
|
-
key: i
|
|
580
|
-
}, props));
|
|
581
|
-
}), (_props$afterElements = props.afterElements) === null || _props$afterElements === void 0 ? void 0 : _props$afterElements.map(function (AfterElement, i) {
|
|
582
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
583
|
-
key: i
|
|
584
|
-
}, AfterElement);
|
|
585
|
-
}));
|
|
575
|
+
})));
|
|
586
576
|
};
|
|
587
577
|
exports.Header = Header;
|
|
588
578
|
Header.defaultProps = {
|
|
589
579
|
isShowOrderOptions: true
|
|
590
|
-
};
|
|
580
|
+
};
|
|
581
|
+
var _default = Header;
|
|
582
|
+
exports.default = _default;
|