ordering-ui-external 2.4.5 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{0.ordering-ui.83ddb51fdc85c2b920b0.js → 0.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{1.ordering-ui.83ddb51fdc85c2b920b0.js → 1.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{2.ordering-ui.83ddb51fdc85c2b920b0.js → 2.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{4.ordering-ui.83ddb51fdc85c2b920b0.js → 4.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{5.ordering-ui.83ddb51fdc85c2b920b0.js → 5.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{6.ordering-ui.83ddb51fdc85c2b920b0.js → 6.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{7.ordering-ui.83ddb51fdc85c2b920b0.js → 7.ordering-ui.5657c6a53b3791887fd7.js} +2 -2
- package/_bundles/{8.ordering-ui.83ddb51fdc85c2b920b0.js → 8.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{9.ordering-ui.83ddb51fdc85c2b920b0.js → 9.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/ordering-ui.5657c6a53b3791887fd7.js +2 -0
- package/_modules/components/OrdersOption/styles.js +1 -1
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
- package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
- package/_modules/contexts/ThemeContext/index.js +1 -0
- package/_modules/themes/five/src/components/AddressList/index.js +8 -7
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
- package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
- package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
- package/_modules/themes/five/src/components/Cart/index.js +7 -3
- package/_modules/themes/five/src/components/Checkout/index.js +12 -11
- package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +29 -21
- package/_modules/themes/five/src/components/Header/styles.js +44 -40
- package/_modules/themes/five/src/components/MultiCheckout/index.js +18 -16
- package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
- package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
- package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +5 -2
- package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
- package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
- package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
- package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
- package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
- package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
- package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
- package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
- package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
- package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
- package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
- package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
- package/_modules/utils/index.js +8 -2
- package/index.html +1 -1
- package/package.json +3 -2
- package/src/components/OrdersOption/styles.js +1 -0
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
- package/src/components/VerticalOrdersLayout/styles.js +9 -0
- package/src/contexts/ThemeContext/index.js +1 -0
- package/src/themes/five/src/components/AddressList/index.js +6 -6
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
- package/src/themes/five/src/components/BusinessController/index.js +4 -2
- package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
- package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
- package/src/themes/five/src/components/Cart/index.js +3 -4
- package/src/themes/five/src/components/Checkout/index.js +18 -4
- package/src/themes/five/src/components/Checkout/styles.js +22 -0
- package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
- package/src/themes/five/src/components/Header/index.js +17 -5
- package/src/themes/five/src/components/Header/styles.js +9 -6
- package/src/themes/five/src/components/MultiCheckout/index.js +9 -10
- package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
- package/src/themes/five/src/components/MyOrders/index.js +13 -9
- package/src/themes/five/src/components/MyOrders/styles.js +3 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +3 -2
- package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
- package/src/themes/five/src/components/OrderDetails/index.js +2 -2
- package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/src/themes/five/src/components/OrderProgress/index.js +16 -5
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
- package/src/themes/five/src/components/PageBanner/styles.js +1 -4
- package/src/themes/five/src/components/ProductForm/index.js +23 -5
- package/src/themes/five/src/components/ProductForm/styles.js +36 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
- package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
- package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
- package/src/themes/five/src/components/ServiceForm/index.js +22 -4
- package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
- package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
- package/src/themes/five/src/components/SignUpForm/index.js +4 -3
- package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
- package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
- package/src/themes/five/src/components/UserPopover/index.js +26 -15
- package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
- package/src/themes/five/src/styles/Buttons/index.js +11 -0
- package/src/themes/five/src/styles/Inputs/index.js +34 -0
- package/src/utils/index.js +5 -0
- package/template/app.js +5 -3
- package/template/theme.json +335 -24
- package/_bundles/ordering-ui.83ddb51fdc85c2b920b0.js +0 -2
- /package/_bundles/{7.ordering-ui.83ddb51fdc85c2b920b0.js.LICENSE.txt → 7.ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.83ddb51fdc85c2b920b0.js.LICENSE.txt → ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
|
@@ -14,6 +14,7 @@ var _MdClose = _interopRequireDefault(require("@meronex/icons/ios/MdClose"));
|
|
|
14
14
|
var _reactRouterDom = require("react-router-dom");
|
|
15
15
|
var _styles = require("./styles");
|
|
16
16
|
var _Tabs = require("../../styles/Tabs");
|
|
17
|
+
var _styledComponents = require("styled-components");
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
19
|
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); }
|
|
19
20
|
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; }
|
|
@@ -25,18 +26,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
25
26
|
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; } }
|
|
26
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
28
|
var MyOrders = function MyOrders(props) {
|
|
28
|
-
var
|
|
29
|
+
var _theme$orders, _theme$orders$compone, _theme$orders$compone2, _theme$orders2, _theme$orders2$compon, _theme$orders2$compon2, _theme$orders3, _theme$orders3$compon, _theme$orders3$compon2, _props$beforeElements, _props$beforeComponen, _props$afterComponent, _props$afterElements;
|
|
29
30
|
var hideOrders = props.hideOrders,
|
|
31
|
+
isFromBusinessListingSearch = props.isFromBusinessListingSearch,
|
|
30
32
|
businessesSearchList = props.businessesSearchList,
|
|
31
33
|
onProductRedirect = props.onProductRedirect;
|
|
32
34
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
33
35
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
34
36
|
t = _useLanguage2[1];
|
|
35
37
|
var history = (0, _reactRouterDom.useHistory)();
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
39
|
-
var layout = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme = orderingTheme.theme) === null || _orderingTheme$theme === void 0 ? void 0 : (_orderingTheme$theme$ = _orderingTheme$theme.orders) === 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$3.type) || 'original';
|
|
38
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
39
|
+
var layout = (theme === null || theme === void 0 ? void 0 : (_theme$orders = theme.orders) === null || _theme$orders === void 0 ? void 0 : (_theme$orders$compone = _theme$orders.components) === null || _theme$orders$compone === void 0 ? void 0 : (_theme$orders$compone2 = _theme$orders$compone.layout) === null || _theme$orders$compone2 === void 0 ? void 0 : _theme$orders$compone2.type) || 'original';
|
|
40
40
|
var _useState = (0, _react.useState)(false),
|
|
41
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
42
|
isEmptyActive = _useState2[0],
|
|
@@ -61,15 +61,20 @@ var MyOrders = function MyOrders(props) {
|
|
|
61
61
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
62
62
|
businessOrderIds = _useState12[0],
|
|
63
63
|
setBusinessOrderIds = _useState12[1];
|
|
64
|
+
var hideProductsTab = theme === null || theme === void 0 ? void 0 : (_theme$orders2 = theme.orders) === null || _theme$orders2 === void 0 ? void 0 : (_theme$orders2$compon = _theme$orders2.components) === null || _theme$orders2$compon === void 0 ? void 0 : (_theme$orders2$compon2 = _theme$orders2$compon.products_tab) === null || _theme$orders2$compon2 === void 0 ? void 0 : _theme$orders2$compon2.hidden;
|
|
65
|
+
var hideBusinessTab = theme === null || theme === void 0 ? void 0 : (_theme$orders3 = theme.orders) === null || _theme$orders3 === void 0 ? void 0 : (_theme$orders3$compon = _theme$orders3.components) === null || _theme$orders3$compon === void 0 ? void 0 : (_theme$orders3$compon2 = _theme$orders3$compon.business_tab) === null || _theme$orders3$compon2 === void 0 ? void 0 : _theme$orders3$compon2.hidden;
|
|
64
66
|
var MyOrdersMenu = [{
|
|
65
67
|
key: 'orders',
|
|
66
|
-
value: t('ORDERS', 'Orders')
|
|
68
|
+
value: t('ORDERS', 'Orders'),
|
|
69
|
+
disabled: false
|
|
67
70
|
}, {
|
|
68
71
|
key: 'business',
|
|
69
|
-
value: t('BUSINESS', 'Business')
|
|
72
|
+
value: t('BUSINESS', 'Business'),
|
|
73
|
+
disabled: hideBusinessTab
|
|
70
74
|
}, {
|
|
71
75
|
key: 'products',
|
|
72
|
-
value: t('PRODUCTS', 'Products')
|
|
76
|
+
value: t('PRODUCTS', 'Products'),
|
|
77
|
+
disabled: hideProductsTab
|
|
73
78
|
}];
|
|
74
79
|
var notOrderOptions = ['business', 'products', 'professionals'];
|
|
75
80
|
var allEmpty = isEmptyActive && isEmptyPast && isEmptyPreorder || (isEmptyBusinesses || (businessOrderIds === null || businessOrderIds === void 0 ? void 0 : businessOrderIds.length) === 0) && hideOrders;
|
|
@@ -82,13 +87,14 @@ var MyOrders = function MyOrders(props) {
|
|
|
82
87
|
key: i
|
|
83
88
|
}, props));
|
|
84
89
|
}), hideOrders && !allEmpty && /*#__PURE__*/_react.default.createElement("h2", null, t('PREVIOUSLY_ORDERED', 'Previously ordered')), /*#__PURE__*/_react.default.createElement(_styles.Container, {
|
|
85
|
-
hideOrders: hideOrders
|
|
90
|
+
hideOrders: hideOrders,
|
|
91
|
+
initialHeight: isFromBusinessListingSearch
|
|
86
92
|
}, !hideOrders && /*#__PURE__*/_react.default.createElement("h1", null, layout === 'appointments' ? t('MY_APPOINTMENTS', 'My appointments') : t('MY_ORDERS', 'My orders')), !allEmpty && /*#__PURE__*/_react.default.createElement(_styles.MyOrdersMenuContainer, {
|
|
87
93
|
className: "category-lists"
|
|
88
94
|
}, /*#__PURE__*/_react.default.createElement(_Tabs.Tabs, {
|
|
89
95
|
variant: "primary"
|
|
90
96
|
}, MyOrdersMenu.filter(function (option) {
|
|
91
|
-
return !hideOrders || option.key !== 'orders';
|
|
97
|
+
return (!hideOrders || option.key !== 'orders') && !option.disabled;
|
|
92
98
|
}).map(function (option) {
|
|
93
99
|
return /*#__PURE__*/_react.default.createElement(_Tabs.Tab, {
|
|
94
100
|
key: option.key,
|
|
@@ -6,30 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.OrderGroupFilterWrapper = exports.NoOrdersWrapper = exports.MyOrdersMenuContainer = exports.Divider = exports.Container = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n overflow: hidden;\n min-height: auto;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n
|
|
14
|
-
var
|
|
15
|
-
return !
|
|
13
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n overflow: hidden;\n min-height: auto;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n ", "\n\n > h1 {\n font-weight: 600;\n font-size: 32px;\n line-height: 48px;\n margin-bottom: 7px;\n margin-top: 0px;\n text-transform: capitalize;\n }\n\n @media (min-width: 769px) {\n ", "\n margin-left: auto;\n margin-right: auto;\n }\n\n"])), function (_ref) {
|
|
14
|
+
var initialHeight = _ref.initialHeight;
|
|
15
|
+
return !initialHeight && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-height: calc(100vh - 320px);\n "])));
|
|
16
|
+
}, function (_ref2) {
|
|
17
|
+
var hideOrders = _ref2.hideOrders;
|
|
18
|
+
return !hideOrders ? (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 40px;\n width: 100%;\n "]))) : (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0;\n width: 100%;\n\n @media (min-width: 993px) {\n min-height: 'auto';\n }\n "])));
|
|
16
19
|
});
|
|
17
20
|
exports.Container = Container;
|
|
18
|
-
var Divider = _styledComponents.default.div(
|
|
21
|
+
var Divider = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 25px;\n background: #F8F9FA;\n height: 8px;\n width: 100%;\n"])));
|
|
19
22
|
exports.Divider = Divider;
|
|
20
|
-
var OrderGroupFilterWrapper = _styledComponents.default.div(
|
|
21
|
-
return props.theme.rtl && (0, _styledComponents.css)(
|
|
23
|
+
var OrderGroupFilterWrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n padding-bottom: 15px;\n\n button {\n margin-top: 10px;\n display: flex;\n align-items: center;\n border-radius: 50px;\n margin-right: 10px;\n ", "\n > svg {\n margin-left: 5px;\n ", "\n }\n }\n"])), function (props) {
|
|
24
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: 0;\n margin-left: 10px;\n "])));
|
|
22
25
|
}, function (props) {
|
|
23
|
-
return props.theme.rtl && (0, _styledComponents.css)(
|
|
26
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0;\n "])));
|
|
24
27
|
});
|
|
25
28
|
exports.OrderGroupFilterWrapper = OrderGroupFilterWrapper;
|
|
26
|
-
var NoOrdersWrapper = _styledComponents.default.div(
|
|
29
|
+
var NoOrdersWrapper = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 50px 0px;\n position: absolute;\n box-sizing: border-box;\n min-height: calc(100% - 120px);\n width: 100%;\n\n > p {\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n margin-top: 0px;\n margin-bottom: 25px;\n }\n\n button {\n height: 44px;\n }\n"])));
|
|
27
30
|
exports.NoOrdersWrapper = NoOrdersWrapper;
|
|
28
|
-
var MyOrdersMenuContainer = _styledComponents.default.div(
|
|
31
|
+
var MyOrdersMenuContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n overflow-x: auto;\n padding: 5px 0px 0px 0px;\n background: ", ";\n z-index: 1000;\n position: sticky;\n top: 0;\n border-bottom: 1px solid #D9D9D9;\n text-align: center;\n width: 100%;\n margin-bottom: 30px;\n div.category {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding: 10px 0px;\n margin: 0 15px;\n &:nth-of-type(1) {\n margin-left: 0;\n ", "\n }\n }\n\n div.special {\n ", "\n }\n\n @media (min-width: 381px) {\n padding: 15px 0px 0px 0px;\n }\n @media (min-width: 992px) {\n width: auto;\n }\n"])), function (props) {
|
|
29
32
|
return props.theme.colors.backgroundPage;
|
|
30
33
|
}, function (props) {
|
|
31
|
-
return props.theme.rtl && (0, _styledComponents.css)(
|
|
34
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-left: 15px;\n margin-right: 15px;\n "])));
|
|
32
35
|
}, function (props) {
|
|
33
|
-
return !props.featured && (0, _styledComponents.css)(
|
|
36
|
+
return !props.featured && (0, _styledComponents.css)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: none\n "])));
|
|
34
37
|
});
|
|
35
38
|
exports.MyOrdersMenuContainer = MyOrdersMenuContainer;
|
|
@@ -28,7 +28,7 @@ var OrderEta = function OrderEta(props) {
|
|
|
28
28
|
estimatedDeliveryTime = _useState2[0],
|
|
29
29
|
setEstimatedDeliveryTime = _useState2[1];
|
|
30
30
|
var getEstimatedDeliveryTime = function getEstimatedDeliveryTime() {
|
|
31
|
-
var _estimatedTime;
|
|
31
|
+
var _estimatedTime = null;
|
|
32
32
|
var totalEta = 0;
|
|
33
33
|
var _delivery = order !== null && order !== void 0 && order.delivery_datetime_utc ? order === null || order === void 0 ? void 0 : order.delivery_datetime_utc : order === null || order === void 0 ? void 0 : order.delivery_datetime;
|
|
34
34
|
if (order !== null && order !== void 0 && order.eta_current_status_time) {
|
|
@@ -53,7 +53,10 @@ var OrderEta = function OrderEta(props) {
|
|
|
53
53
|
} else {
|
|
54
54
|
_estimatedTime = _moment.default.utc(_delivery).add(order === null || order === void 0 ? void 0 : order.eta_time, 'minutes');
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
if (order !== null && order !== void 0 && order.delivered_in) {
|
|
57
|
+
_estimatedTime = _moment.default.utc(_delivery).add(order === null || order === void 0 ? void 0 : order.delivered_in, 'minutes');
|
|
58
|
+
}
|
|
59
|
+
_estimatedTime = outputFormat ? (0, _moment.default)(_estimatedTime).local().format(outputFormat) : parseDate(_estimatedTime, {
|
|
57
60
|
utc: false
|
|
58
61
|
});
|
|
59
62
|
setEstimatedDeliveryTime(_estimatedTime);
|
|
@@ -109,10 +109,10 @@ var OrderHistory = function OrderHistory(props) {
|
|
|
109
109
|
return /*#__PURE__*/_react.default.createElement(_styles.OrderHistoryContainer, null, !(messages !== null && messages !== void 0 && messages.loading) && order && /*#__PURE__*/_react.default.createElement(_styles.HistoryItemWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, /*#__PURE__*/_react.default.createElement("h3", null, t('ORDER_PLACED', 'Order placed'), " ", ' ', t('VIA', 'Via'), ' ', order.app_id ? t(order.app_id.toUpperCase(), order.app_id) : t('OTHER', 'Other')), /*#__PURE__*/_react.default.createElement("p", null, parseDate(order.created_at, {
|
|
110
110
|
outputFormat: 'MMM DD, hh:mm A'
|
|
111
111
|
})))), messages && (messages === null || messages === void 0 ? void 0 : messages.messages.map(function (message, i) {
|
|
112
|
-
var _message$change, _message$change2, _message$driver, _message$driver2;
|
|
112
|
+
var _message$change, _message$change2, _message$change3, _message$driver, _message$driver2;
|
|
113
113
|
return message.type === 1 && /*#__PURE__*/_react.default.createElement(_styles.HistoryItemWrapper, {
|
|
114
114
|
key: i
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, ((_message$change = message.change) === null || _message$change === void 0 ? void 0 : _message$change.attribute) !== 'driver_id' ? /*#__PURE__*/_react.default.createElement("h3", null, ((_message$change2 = message.change) === null || _message$change2 === void 0 ? void 0 : _message$change2.attribute) === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : t(getStatus(parseInt(message.change.new, 10)))) : /*#__PURE__*/_react.default.createElement("h3", null, message.change.new ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("strong", null, (_message$driver = message.driver) === null || _message$driver === void 0 ? void 0 : _message$driver.name, " ", ' ', " ", ((_message$driver2 = message.driver) === null || _message$driver2 === void 0 ? void 0 : _message$driver2.lastname) && message.driver.lastname, " "), t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, t('DRIVER_UNASSIGNED', 'Driver unassigned'))), /*#__PURE__*/_react.default.createElement("p", null, parseDate(message.created_at, {
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, ((_message$change = message.change) === null || _message$change === void 0 ? void 0 : _message$change.attribute) !== 'driver_id' ? /*#__PURE__*/_react.default.createElement("h3", null, ((_message$change2 = message.change) === null || _message$change2 === void 0 ? void 0 : _message$change2.attribute) === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : ((_message$change3 = message.change) === null || _message$change3 === void 0 ? void 0 : _message$change3.attribute) === 'delivered_in' ? /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement("strong", null, t('TIME_ADDED_BY_DRIVER', 'Time added by driver')), /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.formatSeconds)(parseInt(message.change.new, 10))) : t(getStatus(parseInt(message.change.new, 10)))) : /*#__PURE__*/_react.default.createElement("h3", null, message.change.new ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("strong", null, (_message$driver = message.driver) === null || _message$driver === void 0 ? void 0 : _message$driver.name, " ", ' ', " ", ((_message$driver2 = message.driver) === null || _message$driver2 === void 0 ? void 0 : _message$driver2.lastname) && message.driver.lastname, " "), t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, t('DRIVER_UNASSIGNED', 'Driver unassigned'))), /*#__PURE__*/_react.default.createElement("p", null, parseDate(message.created_at, {
|
|
116
116
|
outputFormat: 'MMM DD, hh:mm A'
|
|
117
117
|
}))));
|
|
118
118
|
})), /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
@@ -181,7 +181,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
181
181
|
var acceptedStatus = [1, 2, 5, 6, 10, 11, 12];
|
|
182
182
|
var completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17];
|
|
183
183
|
var placeSpotTypes = [3, 4, 5];
|
|
184
|
-
var activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23];
|
|
184
|
+
var activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23];
|
|
185
185
|
var googleMapsApiKey = configs === null || configs === void 0 ? void 0 : (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value;
|
|
186
186
|
var enabledPoweredByOrdering = configs === null || configs === void 0 ? 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;
|
|
187
187
|
var hideOrderActions = (order === null || order === void 0 ? void 0 : order.delivery_type) === 1;
|
|
@@ -567,7 +567,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
567
567
|
actionType: "business",
|
|
568
568
|
showPhone: !hideBusinessPhone,
|
|
569
569
|
showMessages: !hideBusinessMessages
|
|
570
|
-
})), !hideBusinessEmail && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business8 = order.business) === null || _order$business8 === void 0 ? void 0 : _order$business8.email), !hideBusinessPhone && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business9 = order.business) === null || _order$business9 === void 0 ? void 0 : _order$business9.cellphone), !hideBusinessAddress && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business10 = order.business) === null || _order$business10 === void 0 ? void 0 : _order$business10.address), (order === null || order === void 0 ? void 0 : (_order$place = order.place) === null || _order$place === void 0 ? void 0 : _order$place.name) && /*#__PURE__*/_react.default.createElement(_styles.PlaceSpotSection, null, /*#__PURE__*/_react.default.createElement("p", null, yourSpotString, ": ", order === null || order === void 0 ? void 0 : (_order$place2 = order.place) === null || _order$place2 === void 0 ? void 0 : _order$place2.name)), hideOrderActions && /*#__PURE__*/_react.default.createElement(_styles.DirectionButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
570
|
+
})), !hideBusinessEmail && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business8 = order.business) === null || _order$business8 === void 0 ? void 0 : _order$business8.email), !hideBusinessPhone && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business9 = order.business) === null || _order$business9 === void 0 ? void 0 : _order$business9.cellphone), !hideBusinessAddress && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business10 = order.business) === null || _order$business10 === void 0 ? void 0 : _order$business10.address), (order === null || order === void 0 ? void 0 : (_order$place = order.place) === null || _order$place === void 0 ? void 0 : _order$place.name) && /*#__PURE__*/_react.default.createElement(_styles.PlaceSpotSection, null, /*#__PURE__*/_react.default.createElement("p", null, yourSpotString, ": ", order === null || order === void 0 ? void 0 : (_order$place2 = order.place) === null || _order$place2 === void 0 ? void 0 : _order$place2.name)), !hideOrderActions && /*#__PURE__*/_react.default.createElement(_styles.DirectionButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
571
571
|
color: "primary",
|
|
572
572
|
onClick: function onClick() {
|
|
573
573
|
var _order$business11;
|
|
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top:
|
|
13
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 25px;\n margin: 0px;\n ", "\n ", "\n @media (min-width: 993px) {\n margin-right: 30px;\n }\n"])), function (props) {
|
|
14
14
|
return props.theme.rtl && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 30px;\n margin-right: 0px;\n "])));
|
|
15
15
|
}, function (_ref) {
|
|
16
16
|
var isGroceries = _ref.isGroceries;
|
|
@@ -48,6 +48,7 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
48
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
49
|
lastOrder = _useState2[0],
|
|
50
50
|
setLastOrder = _useState2[1];
|
|
51
|
+
var statusToShow = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21];
|
|
51
52
|
var isChew = (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.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
|
|
52
53
|
var handleGoToPage = function handleGoToPage(index) {
|
|
53
54
|
events.emit('go_to_page', {
|
|
@@ -62,7 +63,17 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
62
63
|
var sortedOrders = orderList.orders.sort(function (a, b) {
|
|
63
64
|
return a.id > b.id ? -1 : 1;
|
|
64
65
|
});
|
|
65
|
-
|
|
66
|
+
var orderInProgress = sortedOrders.find(function (_ref) {
|
|
67
|
+
var status = _ref.status;
|
|
68
|
+
return statusToShow.includes(status);
|
|
69
|
+
});
|
|
70
|
+
var _lastOrder = null;
|
|
71
|
+
if (orderInProgress) {
|
|
72
|
+
_lastOrder = orderInProgress;
|
|
73
|
+
} else {
|
|
74
|
+
_lastOrder = sortedOrders[0];
|
|
75
|
+
}
|
|
76
|
+
setLastOrder(_lastOrder);
|
|
66
77
|
}
|
|
67
78
|
}, [orderList === null || orderList === void 0 ? void 0 : orderList.orders]);
|
|
68
79
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (orderList === null || orderList === void 0 ? void 0 : orderList.loading) && /*#__PURE__*/_react.default.createElement(_styles.OrderProgressWrapper, {
|
|
@@ -73,7 +84,7 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
73
84
|
isChew: props.isChew
|
|
74
85
|
}, /*#__PURE__*/_react.default.createElement(_styles.OrderProgressContainer, null, /*#__PURE__*/_react.default.createElement(_styles.OrderInfoWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.ProgressLogo, {
|
|
75
86
|
bgimage: (orderList === null || orderList === void 0 ? void 0 : orderList.orders.length) === 1 ? optimizeImage((lastOrder === null || lastOrder === void 0 ? void 0 : (_lastOrder$business = lastOrder.business) === null || _lastOrder$business === void 0 ? void 0 : _lastOrder$business.logo) || ((_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$dummies = _theme$images.dummies) === null || _theme$images$dummies === void 0 ? void 0 : _theme$images$dummies.businessLogo), 'h_91,c_limit') : isChew ? theme.images.logos.chewLogoReverse : theme.images.logos.logotype
|
|
76
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.ProgressDescriptionWrapper, null, /*#__PURE__*/_react.default.createElement("h2", null, t('ORDER_IN_PROGRESS', 'Order in progress')), /*#__PURE__*/_react.default.createElement("p", null, t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
87
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.ProgressDescriptionWrapper, null, /*#__PURE__*/_react.default.createElement("h2", null, statusToShow.includes(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.status) ? t('ORDER_IN_PROGRESS', 'Order in progress') : t('ORDER', 'Order')), statusToShow.includes(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.status) && /*#__PURE__*/_react.default.createElement("p", null, t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
77
88
|
color: "primaryContrast",
|
|
78
89
|
naked: true,
|
|
79
90
|
onClick: function onClick() {
|
|
@@ -83,7 +94,7 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
83
94
|
style: {
|
|
84
95
|
width: (_getOrderStatus = (0, _utils.getOrderStatus)(lastOrder.status)) !== null && _getOrderStatus !== void 0 && _getOrderStatus.percentage ? "".concat((0, _utils.getOrderStatus)(lastOrder.status).percentage, "%") : '0%'
|
|
85
96
|
}
|
|
86
|
-
})), /*#__PURE__*/_react.default.createElement(_styles.ProgressTextWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.StatusWrapper, null, (_getOrderStatus2 = (0, _utils.getOrderStatus)(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.status)) === null || _getOrderStatus2 === void 0 ? void 0 : _getOrderStatus2.value), /*#__PURE__*/_react.default.createElement(_styles.TimeWrapper, null, /*#__PURE__*/_react.default.createElement("span", null, t('ESTIMATED_DELIVERY', 'Estimated delivery'), ":\xA0"), /*#__PURE__*/_react.default.createElement("span", null, lastOrder !== null && lastOrder !== void 0 && lastOrder.delivery_datetime_utc ? parseTime(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.delivery_datetime_utc, {
|
|
97
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.ProgressTextWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.StatusWrapper, null, (_getOrderStatus2 = (0, _utils.getOrderStatus)(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.status)) === null || _getOrderStatus2 === void 0 ? void 0 : _getOrderStatus2.value), /*#__PURE__*/_react.default.createElement(_styles.TimeWrapper, null, /*#__PURE__*/_react.default.createElement("span", null, (lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.delivery_type) === 1 ? t('ESTIMATED_DELIVERY', 'Estimated delivery') : t('ESTIMATED_TIME', 'Estimated time'), ":\xA0"), /*#__PURE__*/_react.default.createElement("span", null, lastOrder !== null && lastOrder !== void 0 && lastOrder.delivery_datetime_utc ? parseTime(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.delivery_datetime_utc, {
|
|
87
98
|
outputFormat: 'hh:mm A',
|
|
88
99
|
utc: false
|
|
89
100
|
}) : parseTime(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.delivery_datetime, {
|
|
@@ -96,7 +107,7 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
96
107
|
var OrderProgress = function OrderProgress(props) {
|
|
97
108
|
var orderProgressProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
98
109
|
UIComponent: OrderProgressUI,
|
|
99
|
-
orderStatus: [0, 3, 4, 7, 8, 9, 13, 14,
|
|
110
|
+
orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
|
|
100
111
|
useDefualtSessionManager: true,
|
|
101
112
|
paginationSettings: {
|
|
102
113
|
initialPage: 1,
|
|
@@ -41,8 +41,20 @@ var OrderTypeSelectorContentUI = function OrderTypeSelectorContentUI(props) {
|
|
|
41
41
|
handleChangeOrderType && handleChangeOrderType(orderType);
|
|
42
42
|
};
|
|
43
43
|
var orderTypeImage = function orderTypeImage(type) {
|
|
44
|
-
var _theme$
|
|
45
|
-
return theme === null || theme === void 0 ? void 0 : (_theme$
|
|
44
|
+
var _theme$order_types, _theme$order_types$co, _theme$order_types$co2, _theme$order_types$co3;
|
|
45
|
+
return theme === null || theme === void 0 ? void 0 : (_theme$order_types = theme.order_types) === null || _theme$order_types === void 0 ? void 0 : (_theme$order_types$co = _theme$order_types.components) === null || _theme$order_types$co === void 0 ? void 0 : (_theme$order_types$co2 = _theme$order_types$co[type]) === null || _theme$order_types$co2 === void 0 ? void 0 : (_theme$order_types$co3 = _theme$order_types$co2.components) === null || _theme$order_types$co3 === void 0 ? void 0 : _theme$order_types$co3.image;
|
|
46
|
+
};
|
|
47
|
+
var orderTypeTitle = function orderTypeTitle(type) {
|
|
48
|
+
var _theme$order_types2, _theme$order_types2$c, _theme$order_types2$c2, _theme$order_types2$c3;
|
|
49
|
+
return theme === null || theme === void 0 ? void 0 : (_theme$order_types2 = theme.order_types) === null || _theme$order_types2 === void 0 ? void 0 : (_theme$order_types2$c = _theme$order_types2.components) === null || _theme$order_types2$c === void 0 ? void 0 : (_theme$order_types2$c2 = _theme$order_types2$c[type]) === null || _theme$order_types2$c2 === void 0 ? void 0 : (_theme$order_types2$c3 = _theme$order_types2$c2.components) === null || _theme$order_types2$c3 === void 0 ? void 0 : _theme$order_types2$c3.title;
|
|
50
|
+
};
|
|
51
|
+
var orderTypeDescription = function orderTypeDescription(type) {
|
|
52
|
+
var _theme$order_types3, _theme$order_types3$c, _theme$order_types3$c2, _theme$order_types3$c3;
|
|
53
|
+
return theme === null || theme === void 0 ? void 0 : (_theme$order_types3 = theme.order_types) === null || _theme$order_types3 === void 0 ? void 0 : (_theme$order_types3$c = _theme$order_types3.components) === null || _theme$order_types3$c === void 0 ? void 0 : (_theme$order_types3$c2 = _theme$order_types3$c[type]) === null || _theme$order_types3$c2 === void 0 ? void 0 : (_theme$order_types3$c3 = _theme$order_types3$c2.components) === null || _theme$order_types3$c3 === void 0 ? void 0 : _theme$order_types3$c3.description;
|
|
54
|
+
};
|
|
55
|
+
var orderTypeCallAction = function orderTypeCallAction(type) {
|
|
56
|
+
var _theme$order_types4, _theme$order_types4$c, _theme$order_types4$c2, _theme$order_types4$c3;
|
|
57
|
+
return theme === null || theme === void 0 ? void 0 : (_theme$order_types4 = theme.order_types) === null || _theme$order_types4 === void 0 ? void 0 : (_theme$order_types4$c = _theme$order_types4.components) === null || _theme$order_types4$c === void 0 ? void 0 : (_theme$order_types4$c2 = _theme$order_types4$c[type]) === null || _theme$order_types4$c2 === void 0 ? void 0 : (_theme$order_types4$c3 = _theme$order_types4$c2.components) === null || _theme$order_types4$c3 === void 0 ? void 0 : _theme$order_types4$c3.call_to_action;
|
|
46
58
|
};
|
|
47
59
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
48
60
|
className: "order-type",
|
|
@@ -60,7 +72,7 @@ var OrderTypeSelectorContentUI = function OrderTypeSelectorContentUI(props) {
|
|
|
60
72
|
}), /*#__PURE__*/_react.default.createElement(_styles.OrderTypeSelectorContainer, null, /*#__PURE__*/_react.default.createElement(_styles.OrderTypeListTitle, null, t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will you delivery type?')), orderTypes && (configTypes ? orderTypes.filter(function (type) {
|
|
61
73
|
return configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value);
|
|
62
74
|
}) : orderTypes).map(function (item, i) {
|
|
63
|
-
var _item$text, _item$text$replace, _orderStatus$options;
|
|
75
|
+
var _item$text, _item$text$replace, _orderStatus$options, _item$text2, _item$text2$replace, _item$text3, _item$text3$replace, _item$text4, _item$text4$replace;
|
|
64
76
|
return /*#__PURE__*/_react.default.createElement(_styles.OrderTypeListItemContainer, {
|
|
65
77
|
key: i,
|
|
66
78
|
bgimage: orderTypeImage(item === null || item === void 0 ? void 0 : (_item$text = item.text) === null || _item$text === void 0 ? void 0 : (_item$text$replace = _item$text.replace(' ', '_')) === null || _item$text$replace === void 0 ? void 0 : _item$text$replace.toLowerCase()) || (item === null || item === void 0 ? void 0 : item.image),
|
|
@@ -68,7 +80,7 @@ var OrderTypeSelectorContentUI = function OrderTypeSelectorContentUI(props) {
|
|
|
68
80
|
return handleClickOrderType(item.value);
|
|
69
81
|
},
|
|
70
82
|
active: (orderStatus === null || orderStatus === void 0 ? void 0 : (_orderStatus$options = orderStatus.options) === null || _orderStatus$options === void 0 ? void 0 : _orderStatus$options.type) === (item === null || item === void 0 ? void 0 : item.value)
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.OrderTypeTitle, null, item.text), /*#__PURE__*/_react.default.createElement(_styles.OrderTypeDescription, null, item.description), /*#__PURE__*/_react.default.createElement(_styles.OrderStartWrapper, null, /*#__PURE__*/_react.default.createElement("span", null, t('START_MY_ORDER', 'start my order')), /*#__PURE__*/_react.default.createElement(_BsArrowRight.default, null)), /*#__PURE__*/_react.default.createElement(_styles.OrderTypeOverlay, null));
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.OrderTypeTitle, null, orderTypeTitle(item === null || item === void 0 ? void 0 : (_item$text2 = item.text) === null || _item$text2 === void 0 ? void 0 : (_item$text2$replace = _item$text2.replace(' ', '_')) === null || _item$text2$replace === void 0 ? void 0 : _item$text2$replace.toLowerCase()) || item.text), /*#__PURE__*/_react.default.createElement(_styles.OrderTypeDescription, null, orderTypeDescription(item === null || item === void 0 ? void 0 : (_item$text3 = item.text) === null || _item$text3 === void 0 ? void 0 : (_item$text3$replace = _item$text3.replace(' ', '_')) === null || _item$text3$replace === void 0 ? void 0 : _item$text3$replace.toLowerCase()) || item.description), /*#__PURE__*/_react.default.createElement(_styles.OrderStartWrapper, null, /*#__PURE__*/_react.default.createElement("span", null, orderTypeCallAction(item === null || item === void 0 ? void 0 : (_item$text4 = item.text) === null || _item$text4 === void 0 ? void 0 : (_item$text4$replace = _item$text4.replace(' ', '_')) === null || _item$text4$replace === void 0 ? void 0 : _item$text4$replace.toLowerCase()) || t('START_MY_ORDER', 'start my order')), /*#__PURE__*/_react.default.createElement(_BsArrowRight.default, null)), /*#__PURE__*/_react.default.createElement(_styles.OrderTypeOverlay, null));
|
|
72
84
|
})), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
|
|
73
85
|
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
74
86
|
key: i
|
|
@@ -14,5 +14,5 @@ var BannerContainer = _styledComponents.default.div(_templateObject || (_templat
|
|
|
14
14
|
return props.theme.images.general.leftArrow;
|
|
15
15
|
});
|
|
16
16
|
exports.BannerContainer = BannerContainer;
|
|
17
|
-
var ImageWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n width: 100%;\n padding-top:
|
|
17
|
+
var ImageWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n width: 100%;\n padding-top: 18%;\n position: relative;\n .banner-img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n"])));
|
|
18
18
|
exports.ImageWrapper = ImageWrapper;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ProductForm = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
10
|
+
var _nanoid = require("nanoid");
|
|
10
11
|
var _FiMinusCircle = _interopRequireDefault(require("@meronex/icons/fi/FiMinusCircle"));
|
|
11
12
|
var _FiPlusCircle = _interopRequireDefault(require("@meronex/icons/fi/FiPlusCircle"));
|
|
12
13
|
var _MdcPlayCircleOutline = _interopRequireDefault(require("@meronex/icons/mdc/MdcPlayCircleOutline"));
|
|
@@ -54,7 +55,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
54
55
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
56
|
_swiper.default.use([_swiper.Navigation, _swiper.Thumbs]);
|
|
56
57
|
var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
57
|
-
var _configs$unaddressed_, _theme$defaultLanguag, _product$ingredients2, _product$extras, _product$ingredients3, _product$ingredients4, _product$ingredients5, _product$extras2, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$
|
|
58
|
+
var _configs$unaddressed_, _configs$guest_checko, _orderState$options, _configs$allowed_orde, _configs$allowed_orde2, _orderState$options2, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view$5, _theme$business_view$6, _theme$defaultLanguag, _product$ingredients2, _product$extras, _product$ingredients3, _product$ingredients4, _product$ingredients5, _product$extras2, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$options3, _orderState$options4, _orderState$options5, _orderState$options6, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _orderState$options7, _orderState$options8, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _theme$defaultLanguag11, _theme$defaultLanguag12, _theme$defaultLanguag13, _error$;
|
|
58
59
|
var businessSlug = props.businessSlug,
|
|
59
60
|
editMode = props.editMode,
|
|
60
61
|
isSoldOut = props.isSoldOut,
|
|
@@ -71,7 +72,9 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
71
72
|
handleChangeSuboptionState = props.handleChangeSuboptionState,
|
|
72
73
|
handleChangeCommentState = props.handleChangeCommentState,
|
|
73
74
|
productAddedToCartLength = props.productAddedToCartLength,
|
|
74
|
-
handleFavoriteProduct = props.handleFavoriteProduct
|
|
75
|
+
handleFavoriteProduct = props.handleFavoriteProduct,
|
|
76
|
+
handleCreateGuestUser = props.handleCreateGuestUser,
|
|
77
|
+
actionStatus = props.actionStatus;
|
|
75
78
|
var product = productObject.product,
|
|
76
79
|
loading = productObject.loading,
|
|
77
80
|
error = productObject.error;
|
|
@@ -161,6 +164,9 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
161
164
|
var unaddressedTypes = (configs === null || configs === void 0 ? void 0 : (_configs$unaddressed_ = configs.unaddressed_order_types_allowed) === null || _configs$unaddressed_ === void 0 ? void 0 : _configs$unaddressed_.value.split('|').map(function (value) {
|
|
162
165
|
return Number(value);
|
|
163
166
|
})) || [];
|
|
167
|
+
var guestCheckoutEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$guest_checko = configs.guest_checkout_enabled) === null || _configs$guest_checko === void 0 ? void 0 : _configs$guest_checko.value) === '1';
|
|
168
|
+
var orderTypeEnabled = !_utils.orderTypeList[(orderState === null || orderState === void 0 ? void 0 : (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) - 1] || (configs === null || configs === void 0 ? void 0 : (_configs$allowed_orde = configs.allowed_order_types_guest_checkout) === null || _configs$allowed_orde === void 0 ? void 0 : (_configs$allowed_orde2 = _configs$allowed_orde.value) === null || _configs$allowed_orde2 === void 0 ? void 0 : _configs$allowed_orde2.includes(_utils.orderTypeList[(orderState === null || orderState === void 0 ? void 0 : (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) - 1]));
|
|
169
|
+
var hideProductDescription = theme === null || theme === void 0 ? void 0 : (_theme$business_view = theme.business_view) === null || _theme$business_view === void 0 ? void 0 : (_theme$business_view$ = _theme$business_view.components) === null || _theme$business_view$ === void 0 ? void 0 : (_theme$business_view$2 = _theme$business_view$.products) === null || _theme$business_view$2 === void 0 ? void 0 : (_theme$business_view$3 = _theme$business_view$2.components) === null || _theme$business_view$3 === void 0 ? void 0 : (_theme$business_view$4 = _theme$business_view$3.product) === null || _theme$business_view$4 === void 0 ? void 0 : (_theme$business_view$5 = _theme$business_view$4.components) === null || _theme$business_view$5 === void 0 ? void 0 : (_theme$business_view$6 = _theme$business_view$5.description) === null || _theme$business_view$6 === void 0 ? void 0 : _theme$business_view$6.hidden;
|
|
164
170
|
var closeModal = function closeModal() {
|
|
165
171
|
setModalIsOpen(false);
|
|
166
172
|
setModalPageToShow('login');
|
|
@@ -268,6 +274,12 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
268
274
|
});
|
|
269
275
|
}
|
|
270
276
|
};
|
|
277
|
+
var handleUpdateGuest = function handleUpdateGuest() {
|
|
278
|
+
var guestToken = (0, _nanoid.nanoid)();
|
|
279
|
+
if (guestToken) handleCreateGuestUser({
|
|
280
|
+
guest_token: guestToken
|
|
281
|
+
});
|
|
282
|
+
};
|
|
271
283
|
var handleSlideChange = function handleSlideChange() {
|
|
272
284
|
var videos = document.querySelectorAll('iframe, video');
|
|
273
285
|
Array.prototype.forEach.call(videos, function (video) {
|
|
@@ -515,7 +527,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
515
527
|
className: "offer-price"
|
|
516
528
|
}, product !== null && product !== void 0 && product.offer_price ? parsePrice(product === null || product === void 0 ? void 0 : product.offer_price) : '')), /*#__PURE__*/_react.default.createElement(_styles.ProductMeta, null, (product === null || product === void 0 ? void 0 : product.calories) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
517
529
|
className: "calories"
|
|
518
|
-
}, product === null || product === void 0 ? void 0 : product.calories, ' ', "cal"), /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0")), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && /*#__PURE__*/_react.default.createElement(_styles.SkuContent, null, /*#__PURE__*/_react.default.createElement("span", null, t('SKU', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SKU) || 'Sku'), "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.sku)), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0"), (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement(_styles.EstimatedPersons, null, /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.estimated_person, "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, t('ESTIMATED_PERSONS', 'persons'))))), (product === null || product === void 0 ? void 0 : product.description) && /*#__PURE__*/_react.default.createElement(_styles.ProductDescription, null, /*#__PURE__*/_react.default.createElement(_LinkableText.LinkableText, {
|
|
530
|
+
}, product === null || product === void 0 ? void 0 : product.calories, ' ', "cal"), /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0")), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && /*#__PURE__*/_react.default.createElement(_styles.SkuContent, null, /*#__PURE__*/_react.default.createElement("span", null, t('SKU', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SKU) || 'Sku'), "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.sku)), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0"), (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement(_styles.EstimatedPersons, null, /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.estimated_person, "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, t('ESTIMATED_PERSONS', 'persons'))))), (product === null || product === void 0 ? void 0 : product.description) && !hideProductDescription && /*#__PURE__*/_react.default.createElement(_styles.ProductDescription, null, /*#__PURE__*/_react.default.createElement(_LinkableText.LinkableText, {
|
|
519
531
|
text: product === null || product === void 0 ? void 0 : product.description
|
|
520
532
|
}))), /*#__PURE__*/_react.default.createElement(_styles.ProductTagsListContainer, null, product.tags.map(function (tag) {
|
|
521
533
|
var _theme$images2, _theme$images2$dummie;
|
|
@@ -616,7 +628,9 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
616
628
|
return /*#__PURE__*/_react.default.createElement(MidComponent, _extends({
|
|
617
629
|
key: i
|
|
618
630
|
}, props));
|
|
619
|
-
})), /*#__PURE__*/_react.default.createElement(_styles.ProductActions,
|
|
631
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.ProductActions, {
|
|
632
|
+
isColumn: auth && !((_orderState$options3 = orderState.options) !== null && _orderState$options3 !== void 0 && _orderState$options3.address_id || unaddressedTypes.includes(orderState === null || orderState === void 0 ? void 0 : (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type))
|
|
633
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
620
634
|
className: "price-amount-block"
|
|
621
635
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
622
636
|
className: "price"
|
|
@@ -652,19 +666,20 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
652
666
|
return handleSwitchQtyUnit('weight_unit');
|
|
653
667
|
},
|
|
654
668
|
active: qtyBy === null || qtyBy === void 0 ? void 0 : qtyBy.weight_unit
|
|
655
|
-
}, product === null || product === void 0 ? void 0 : product.weight_unit)))), productCart && !isSoldOut && maxProductQuantity > 0 && auth && (((_orderState$
|
|
669
|
+
}, product === null || product === void 0 ? void 0 : product.weight_unit)))), productCart && !isSoldOut && maxProductQuantity > 0 && auth && (((_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.address_id) || unaddressedTypes.includes(orderState === null || orderState === void 0 ? void 0 : (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.type)) && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
656
670
|
className: "add ".concat(maxProductQuantity === 0 || Object.keys(errors).length > 0 ? 'disabled' : ''),
|
|
657
671
|
color: "primary",
|
|
658
672
|
onClick: function onClick() {
|
|
659
673
|
return handleSaveProduct();
|
|
660
674
|
},
|
|
661
675
|
disabled: orderState.loading || (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) === 0 || (product === null || product === void 0 ? void 0 : product.minimum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength < (product === null || product === void 0 ? void 0 : product.minimum_per_order) || (product === null || product === void 0 ? void 0 : product.maximum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength > (product === null || product === void 0 ? void 0 : product.maximum_per_order)
|
|
662
|
-
}, orderState.loading ? /*#__PURE__*/_react.default.createElement("span", null, t('LOADING', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.LOADING) || 'Loading')) : /*#__PURE__*/_react.default.createElement("span", null, editMode ? t('UPDATE', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag5 = theme.defaultLanguages) === null || _theme$defaultLanguag5 === void 0 ? void 0 : _theme$defaultLanguag5.UPDATE) || 'Update') : t('ADD', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag6 = theme.defaultLanguages) === null || _theme$defaultLanguag6 === void 0 ? void 0 : _theme$defaultLanguag6.ADD) || 'Add'))), auth && !((_orderState$
|
|
676
|
+
}, orderState.loading ? /*#__PURE__*/_react.default.createElement("span", null, t('LOADING', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.LOADING) || 'Loading')) : /*#__PURE__*/_react.default.createElement("span", null, editMode ? t('UPDATE', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag5 = theme.defaultLanguages) === null || _theme$defaultLanguag5 === void 0 ? void 0 : _theme$defaultLanguag5.UPDATE) || 'Update') : t('ADD', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag6 = theme.defaultLanguages) === null || _theme$defaultLanguag6 === void 0 ? void 0 : _theme$defaultLanguag6.ADD) || 'Add'))), auth && !((_orderState$options7 = orderState.options) !== null && _orderState$options7 !== void 0 && _orderState$options7.address_id || unaddressedTypes.includes(orderState === null || orderState === void 0 ? void 0 : (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.type)) && (orderState.loading ? /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
663
677
|
className: "add",
|
|
664
678
|
color: "primary",
|
|
665
679
|
disabled: true
|
|
666
680
|
}, t('LOADING', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag7 = theme.defaultLanguages) === null || _theme$defaultLanguag7 === void 0 ? void 0 : _theme$defaultLanguag7.LOADING) || 'Loading')) : /*#__PURE__*/_react.default.createElement(_AddressList.AddressList, {
|
|
667
681
|
isModal: true,
|
|
682
|
+
isProfile: true,
|
|
668
683
|
userId: isNaN(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id) ? null : userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
|
|
669
684
|
addressList: isNaN(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id) ? user.addresses : null,
|
|
670
685
|
isProductForm: true
|
|
@@ -676,7 +691,12 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
676
691
|
onClick: function onClick() {
|
|
677
692
|
return setModalIsOpen(true);
|
|
678
693
|
}
|
|
679
|
-
}, isSoldOut || maxProductQuantity <= 0 ? t('SOLD_OUT', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag8 = theme.defaultLanguages) === null || _theme$defaultLanguag8 === void 0 ? void 0 : _theme$defaultLanguag8.SOLD_OUT) || 'Sold out') : t('LOGIN_SIGNUP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag9 = theme.defaultLanguages) === null || _theme$defaultLanguag9 === void 0 ? void 0 : _theme$defaultLanguag9.LOGIN_SIGNUP) || 'Login / Sign Up'))
|
|
694
|
+
}, isSoldOut || maxProductQuantity <= 0 ? t('SOLD_OUT', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag8 = theme.defaultLanguages) === null || _theme$defaultLanguag8 === void 0 ? void 0 : _theme$defaultLanguag8.SOLD_OUT) || 'Sold out') : t('LOGIN_SIGNUP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag9 = theme.defaultLanguages) === null || _theme$defaultLanguag9 === void 0 ? void 0 : _theme$defaultLanguag9.LOGIN_SIGNUP) || 'Login / Sign Up')), !auth && guestCheckoutEnabled && orderTypeEnabled && /*#__PURE__*/_react.default.createElement(_styles.GuestUserLink, {
|
|
695
|
+
onClick: handleUpdateGuest
|
|
696
|
+
}, actionStatus !== null && actionStatus !== void 0 && actionStatus.loading ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
697
|
+
height: 25,
|
|
698
|
+
width: 70
|
|
699
|
+
}) : t('WITH_GUEST_USER', 'With Guest user'))))), modalIsOpen && !auth && /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
680
700
|
open: modalIsOpen,
|
|
681
701
|
onClose: function onClose() {
|
|
682
702
|
return closeModal();
|