ordering-ui-external 1.8.2 → 1.8.4
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.cf9ba81c5417ae8af84a.js → 0.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/{1.ordering-ui.cf9ba81c5417ae8af84a.js → 1.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/{2.ordering-ui.cf9ba81c5417ae8af84a.js → 2.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/{4.ordering-ui.cf9ba81c5417ae8af84a.js → 4.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/{5.ordering-ui.cf9ba81c5417ae8af84a.js → 5.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/6.ordering-ui.c12070c3ccac5ea49732.js +1 -0
- package/_bundles/{7.ordering-ui.cf9ba81c5417ae8af84a.js → 7.ordering-ui.c12070c3ccac5ea49732.js} +2 -2
- package/_bundles/{7.ordering-ui.cf9ba81c5417ae8af84a.js.LICENSE.txt → 7.ordering-ui.c12070c3ccac5ea49732.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.cf9ba81c5417ae8af84a.js → 8.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/{9.ordering-ui.cf9ba81c5417ae8af84a.js → 9.ordering-ui.c12070c3ccac5ea49732.js} +1 -1
- package/_bundles/ordering-ui.c12070c3ccac5ea49732.js +2 -0
- package/_bundles/{ordering-ui.cf9ba81c5417ae8af84a.js.LICENSE.txt → ordering-ui.c12070c3ccac5ea49732.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/AddressForm/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +2 -2
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +41 -62
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +10 -18
- package/_modules/themes/five/src/components/CartPopover/index.js +3 -4
- package/_modules/themes/five/src/components/Checkout/index.js +18 -10
- package/_modules/themes/five/src/components/CitiesControl/index.js +69 -0
- package/_modules/themes/five/src/components/CitiesControl/styles.js +18 -0
- package/_modules/themes/five/src/components/DriverTips/index.js +6 -22
- package/_modules/themes/five/src/components/Header/index.js +7 -6
- package/_modules/themes/five/src/components/HeaderOption/index.js +3 -3
- package/_modules/themes/five/src/components/MultiCheckout/index.js +21 -2
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +14 -10
- package/_modules/themes/five/src/components/OrderProgress/index.js +9 -8
- package/_modules/themes/five/src/components/OrderProgress/styles.js +21 -17
- package/_modules/themes/five/src/components/PaymentOptions/index.js +2 -2
- package/_modules/themes/five/src/components/UserPopover/index.js +2 -2
- package/package.json +2 -2
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/AddressForm/styles.js +2 -1
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +53 -78
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +15 -54
- package/src/themes/five/src/components/CartPopover/index.js +2 -2
- package/src/themes/five/src/components/Checkout/index.js +47 -16
- package/src/themes/five/src/components/CitiesControl/index.js +56 -0
- package/src/themes/five/src/components/CitiesControl/styles.js +32 -0
- package/src/themes/five/src/components/DriverTips/index.js +46 -63
- package/src/themes/five/src/components/Header/index.js +3 -3
- package/src/themes/five/src/components/HeaderOption/index.js +2 -2
- package/src/themes/five/src/components/MultiCheckout/index.js +35 -2
- package/src/themes/five/src/components/MultiCheckout/styles.js +19 -0
- package/src/themes/five/src/components/OrderProgress/index.js +53 -49
- package/src/themes/five/src/components/OrderProgress/styles.js +9 -0
- package/src/themes/five/src/components/PaymentOptions/index.js +1 -1
- package/src/themes/five/src/components/UserPopover/index.js +1 -1
- package/_bundles/6.ordering-ui.cf9ba81c5417ae8af84a.js +0 -1
- package/_bundles/ordering-ui.cf9ba81c5417ae8af84a.js +0 -2
|
File without changes
|
|
@@ -423,6 +423,12 @@ Object.defineProperty(exports, "OrdersOption", {
|
|
|
423
423
|
return _OrdersOption.OrdersOption;
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
|
+
Object.defineProperty(exports, "PageBanner", {
|
|
427
|
+
enumerable: true,
|
|
428
|
+
get: function get() {
|
|
429
|
+
return _PageBanner.PageBanner;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
426
432
|
Object.defineProperty(exports, "PaymentOptionCash", {
|
|
427
433
|
enumerable: true,
|
|
428
434
|
get: function get() {
|
|
@@ -778,6 +784,7 @@ var _OrdersOption = require("./src/components/OrdersOption");
|
|
|
778
784
|
var _OrderProgress = require("./src/components/OrderProgress");
|
|
779
785
|
var _OrderTypeSelectorContent = require("./src/components/OrderTypeSelectorContent");
|
|
780
786
|
var _OrderTypeSelectorHeader = require("./src/components/OrderTypeSelectorHeader");
|
|
787
|
+
var _PageBanner = require("./src/components/PageBanner");
|
|
781
788
|
var _PaymentOptionCash = require("./src/components/PaymentOptionCash");
|
|
782
789
|
var _PaymentOptions = require("./src/components/PaymentOptions");
|
|
783
790
|
var _PaymentOptionStripe = require("./src/components/PaymentOptionStripe");
|
|
@@ -13,7 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
13
13
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
14
|
var FormActions = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 35px;\n padding: 10px 0px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n button {\n height: 44px;\n width: 100%;\n text-transform: lowercase;\n &:first-letter {\n text-transform: uppercase;\n }\n }\n"])));
|
|
15
15
|
exports.FormActions = FormActions;
|
|
16
|
-
var FormControl = _styledComponents.default.form(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0px;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n\n input {\n box-sizing: border-box;\n margin: 10px 0px;\n height: 50px;\n width: 100%;\n &.internal_number,\n &.zipcode {\n flex: auto;\n }\n &::placeholder{\n color: #CBCBCB\n }\n }\n\n textarea {\n width: 100%;\n margin: 10px 0;\n border-radius: 7.6px;\n }\n\n .input-autocomplete {\n width: 100%;\n background: #FFF;\n border: 1px solid #BBB;\n border-radius: 30px;\n font-size: 16px;\n padding: 7px 15px;\n outline: none;\n ::placeholder {\n color: #DBDCDB;\n }\n\n &:-ms-input-placeholder {\n color: #DBDCDB;\n }\n\n &::-ms-input-placeholder { /* Microsoft Edge */\n color: #DBDCDB;\n }\n &:focus {\n border-color: ", ";\n }\n }\n\n .google-control {\n .gps-button {\n border-radius: 7.6px;\n }\n\n input {\n border-radius: 7.6px;\n border: 1px solid ", ";\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n\n .internal_number {\n width: 45%;\n ", "\n }\n\n .zipcode {\n width: 45%;\n }\n\n @media (min-width: 481px) {\n padding: 10px;\n }\n"])), function () {
|
|
16
|
+
var FormControl = _styledComponents.default.form(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0px;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n\n input {\n box-sizing: border-box;\n margin: 10px 0px;\n height: 50px;\n width: 100%;\n &.internal_number,\n &.zipcode {\n flex: auto;\n }\n &::placeholder{\n color: #CBCBCB\n }\n }\n\n textarea {\n width: 100%;\n margin: 10px 0;\n border-radius: 7.6px;\n }\n\n .input-autocomplete {\n width: 100%;\n background: #FFF;\n border: 1px solid #BBB;\n border-radius: 30px;\n font-size: 16px;\n padding: 7px 15px !important;\n height: 50px;\n outline: none;\n ::placeholder {\n color: #DBDCDB;\n }\n\n &:-ms-input-placeholder {\n color: #DBDCDB;\n }\n\n &::-ms-input-placeholder { /* Microsoft Edge */\n color: #DBDCDB;\n }\n &:focus {\n border-color: ", ";\n }\n }\n\n .google-control {\n .gps-button {\n border-radius: 7.6px;\n }\n\n input {\n border-radius: 7.6px;\n border: 1px solid ", ";\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n\n .internal_number {\n width: 45%;\n ", "\n }\n\n .zipcode {\n width: 45%;\n }\n\n @media (min-width: 481px) {\n padding: 10px;\n }\n"])), function () {
|
|
17
17
|
return (0, _polished.darken)(0.07, '#CCC');
|
|
18
18
|
}, function (props) {
|
|
19
19
|
return props.theme.colors.primary;
|
|
@@ -44,7 +44,7 @@ _dayjs.default.extend(_timezone.default);
|
|
|
44
44
|
_dayjs.default.extend(_isBetween.default);
|
|
45
45
|
var types = ['food', 'laundry', 'alcohol', 'groceries'];
|
|
46
46
|
var BusinessBasicInformation = function BusinessBasicInformation(props) {
|
|
47
|
-
var _configs$preorder_sta, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderingTheme$theme$6, _orderingTheme$theme$7, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _orderingTheme$theme16, _orderingTheme$theme17, _orderingTheme$theme18, _orderingTheme$theme19, _orderingTheme$theme20, _orderingTheme$theme21, _orderingTheme$theme22, _orderingTheme$theme23, _orderingTheme$theme24, _orderingTheme$theme25, _orderingTheme$theme26, _orderingTheme$theme27, _orderingTheme$theme28, _orderingTheme$theme29, _orderingTheme$theme30, _orderingTheme$theme31, _orderingTheme$theme32, _orderingTheme$theme33, _orderingTheme$theme34, _orderingTheme$theme35, _orderingTheme$theme36, _orderingTheme$theme37, _orderingTheme$theme38, _orderingTheme$theme39, _orderingTheme$theme40, _orderingTheme$theme41, _orderingTheme$theme42, _orderingTheme$theme43, _orderingTheme$theme44, _orderingTheme$theme45, _orderingTheme$theme46, _orderingTheme$theme47, _orderingTheme$theme48, _orderingTheme$theme49, _orderingTheme$theme50, _orderingTheme$theme51, _orderingTheme$theme52, _orderingTheme$theme53, _orderingTheme$theme54, _orderingTheme$theme55, _orderingTheme$theme56, _orderingTheme$theme57, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _orderingTheme$theme58, _orderingTheme$theme59, _orderingTheme$theme60, _orderingTheme$theme61, _orderingTheme$theme62, _orderingTheme$theme63, _orderingTheme$theme64, _orderingTheme$theme65, _orderingTheme$theme66, _orderingTheme$theme67, _orderingTheme$theme68, _orderingTheme$theme69, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _props$beforeElements, _props$beforeComponen, _business$reviews3, _business$reviews4, _props$afterComponent, _props$afterElements;
|
|
47
|
+
var _configs$preorder_sta, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderingTheme$theme$6, _orderingTheme$theme$7, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _orderingTheme$theme16, _orderingTheme$theme17, _orderingTheme$theme18, _orderingTheme$theme19, _orderingTheme$theme20, _orderingTheme$theme21, _orderingTheme$theme22, _orderingTheme$theme23, _orderingTheme$theme24, _orderingTheme$theme25, _orderingTheme$theme26, _orderingTheme$theme27, _orderingTheme$theme28, _orderingTheme$theme29, _orderingTheme$theme30, _orderingTheme$theme31, _orderingTheme$theme32, _orderingTheme$theme33, _orderingTheme$theme34, _orderingTheme$theme35, _orderingTheme$theme36, _orderingTheme$theme37, _orderingTheme$theme38, _orderingTheme$theme39, _orderingTheme$theme40, _orderingTheme$theme41, _orderingTheme$theme42, _orderingTheme$theme43, _orderingTheme$theme44, _orderingTheme$theme45, _orderingTheme$theme46, _orderingTheme$theme47, _orderingTheme$theme48, _orderingTheme$theme49, _orderingTheme$theme50, _orderingTheme$theme51, _orderingTheme$theme52, _orderingTheme$theme53, _orderingTheme$theme54, _orderingTheme$theme55, _orderingTheme$theme56, _orderingTheme$theme57, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _orderingTheme$theme58, _orderingTheme$theme59, _orderingTheme$theme60, _orderingTheme$theme61, _orderingTheme$theme62, _orderingTheme$theme63, _orderingTheme$theme64, _orderingTheme$theme65, _orderingTheme$theme66, _orderingTheme$theme67, _orderingTheme$theme68, _orderingTheme$theme69, _orderingTheme$theme70, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _props$beforeElements, _props$beforeComponen, _business$reviews3, _business$reviews4, _props$afterComponent, _props$afterElements;
|
|
48
48
|
var isSkeleton = props.isSkeleton,
|
|
49
49
|
businessState = props.businessState,
|
|
50
50
|
setOpenBusinessInformation = props.setOpenBusinessInformation,
|
|
@@ -103,7 +103,7 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
|
|
|
103
103
|
var isInfoShrunken = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme50 = orderingTheme.theme) === null || _orderingTheme$theme50 === void 0 ? void 0 : (_orderingTheme$theme51 = _orderingTheme$theme50.business_view) === null || _orderingTheme$theme51 === void 0 ? void 0 : (_orderingTheme$theme52 = _orderingTheme$theme51.components) === null || _orderingTheme$theme52 === void 0 ? void 0 : (_orderingTheme$theme53 = _orderingTheme$theme52.header) === null || _orderingTheme$theme53 === void 0 ? void 0 : (_orderingTheme$theme54 = _orderingTheme$theme53.components) === null || _orderingTheme$theme54 === void 0 ? void 0 : (_orderingTheme$theme55 = _orderingTheme$theme54.business) === null || _orderingTheme$theme55 === void 0 ? void 0 : (_orderingTheme$theme56 = _orderingTheme$theme55.components) === null || _orderingTheme$theme56 === void 0 ? void 0 : (_orderingTheme$theme57 = _orderingTheme$theme56.layout) === null || _orderingTheme$theme57 === void 0 ? void 0 : _orderingTheme$theme57.position) === 'shrunken';
|
|
104
104
|
var searchLayout = 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$.product_search) === 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.layout) === null || _theme$business_view$4 === void 0 ? void 0 : _theme$business_view$4.type;
|
|
105
105
|
var hideCity = orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme58 = orderingTheme.theme) === null || _orderingTheme$theme58 === void 0 ? void 0 : (_orderingTheme$theme59 = _orderingTheme$theme58.business_view) === null || _orderingTheme$theme59 === void 0 ? void 0 : (_orderingTheme$theme60 = _orderingTheme$theme59.components) === null || _orderingTheme$theme60 === void 0 ? void 0 : (_orderingTheme$theme61 = _orderingTheme$theme60.header) === null || _orderingTheme$theme61 === void 0 ? void 0 : (_orderingTheme$theme62 = _orderingTheme$theme61.components) === null || _orderingTheme$theme62 === void 0 ? void 0 : (_orderingTheme$theme63 = _orderingTheme$theme62.business) === null || _orderingTheme$theme63 === void 0 ? void 0 : (_orderingTheme$theme64 = _orderingTheme$theme63.components) === null || _orderingTheme$theme64 === void 0 ? void 0 : (_orderingTheme$theme65 = _orderingTheme$theme64.city) === null || _orderingTheme$theme65 === void 0 ? void 0 : _orderingTheme$theme65.hidden;
|
|
106
|
-
var isChew = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme66 = orderingTheme.theme) === null || _orderingTheme$theme66 === void 0 ? void 0 : (_orderingTheme$theme67 = _orderingTheme$theme66.header) === null || _orderingTheme$theme67 === void 0 ? void 0 : (_orderingTheme$theme68 = _orderingTheme$theme67.components) === null || _orderingTheme$theme68 === void 0 ? void 0 : (_orderingTheme$theme69 = _orderingTheme$theme68.layout) === null || _orderingTheme$theme69 === void 0 ? void 0 : _orderingTheme$theme69.type) === '
|
|
106
|
+
var isChew = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme66 = orderingTheme.theme) === null || _orderingTheme$theme66 === void 0 ? void 0 : (_orderingTheme$theme67 = _orderingTheme$theme66.header) === null || _orderingTheme$theme67 === void 0 ? void 0 : (_orderingTheme$theme68 = _orderingTheme$theme67.components) === null || _orderingTheme$theme68 === void 0 ? void 0 : (_orderingTheme$theme69 = _orderingTheme$theme68.layout) === null || _orderingTheme$theme69 === void 0 ? void 0 : (_orderingTheme$theme70 = _orderingTheme$theme69.type) === null || _orderingTheme$theme70 === void 0 ? void 0 : _orderingTheme$theme70.toLowerCase()) === 'chew';
|
|
107
107
|
var layoutsWithOldSearch = ['starbucks', 'old', 'floating'];
|
|
108
108
|
var hideSearch = layoutsWithOldSearch.includes(theme === null || theme === void 0 ? void 0 : (_theme$business_view2 = theme.business_view) === null || _theme$business_view2 === void 0 ? void 0 : (_theme$business_view3 = _theme$business_view2.components) === null || _theme$business_view3 === void 0 ? void 0 : (_theme$business_view4 = _theme$business_view3.product_search) === null || _theme$business_view4 === void 0 ? void 0 : (_theme$business_view5 = _theme$business_view4.components) === null || _theme$business_view5 === void 0 ? void 0 : (_theme$business_view6 = _theme$business_view5.layout) === null || _theme$business_view6 === void 0 ? void 0 : _theme$business_view6.type);
|
|
109
109
|
var getBusinessType = function getBusinessType() {
|
|
@@ -9,8 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _styledComponents = require("styled-components");
|
|
10
10
|
var _FiMap = _interopRequireDefault(require("@meronex/icons/fi/FiMap"));
|
|
11
11
|
var _FiFilter = _interopRequireDefault(require("@meronex/icons/fi/FiFilter"));
|
|
12
|
-
var _IosRadioButtonOff = _interopRequireDefault(require("@meronex/icons/ios/IosRadioButtonOff"));
|
|
13
|
-
var _RiRadioButtonFill = _interopRequireDefault(require("@meronex/icons/ri/RiRadioButtonFill"));
|
|
14
12
|
var _FaMapMarkerAlt = _interopRequireDefault(require("@meronex/icons/fa/FaMapMarkerAlt"));
|
|
15
13
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
16
14
|
var _styles = require("./styles");
|
|
@@ -33,8 +31,8 @@ var _PageBanner = require("../../../PageBanner");
|
|
|
33
31
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
34
32
|
var _MomentPopover = require("../../../../../../pwa/src/components/MomentPopover");
|
|
35
33
|
var _OrderTypeSelectorHeader = require("../../../../../../../components/OrderTypeSelectorHeader");
|
|
36
|
-
var _BsArrowRight = _interopRequireDefault(require("@meronex/icons/bs/BsArrowRight"));
|
|
37
34
|
var _AutoScroll = require("../../../AutoScroll");
|
|
35
|
+
var _CitiesControl = require("../../../CitiesControl");
|
|
38
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
37
|
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); }
|
|
40
38
|
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; }
|
|
@@ -56,7 +54,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
56
54
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
55
|
var PIXELS_TO_SCROLL = 300;
|
|
58
56
|
var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
59
|
-
var
|
|
57
|
+
var _ref, _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _orderState$options, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _theme$business_listi9, _theme$business_listi10, _theme$business_listi11, _theme$business_listi12, _businessesList$busin, _configState$configs, _configState$configs$, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _configs$business_lis, _orderState$options4, _orderState$options4$, _configs$business_lis2, _theme$images2, _theme$images2$genera, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _Object$values, _configs$business_lis3, _theme$images3, _theme$images3$genera, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _citiesState$cities2, _citiesState$cities3, _citiesState$cities3$, _configs$advanced_bus, _orderState$options6, _orderState$options6$, _configs$advanced_bus2, _orderState$options7, _orderState$options7$, _businessesList$busin6, _businessesList$busin7, _orderState$options10, _props$afterComponent, _props$afterElements;
|
|
60
58
|
var businessesList = props.businessesList,
|
|
61
59
|
paginationProps = props.paginationProps,
|
|
62
60
|
searchValue = props.searchValue,
|
|
@@ -92,7 +90,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
92
90
|
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
93
91
|
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
94
92
|
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
95
|
-
orderingTheme = _useOrderingTheme2[0]
|
|
93
|
+
orderingTheme = _useOrderingTheme2[0];
|
|
96
94
|
var theme = (0, _styledComponents.useTheme)();
|
|
97
95
|
var _useState = (0, _react.useState)({
|
|
98
96
|
listOpen: false,
|
|
@@ -121,39 +119,35 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
121
119
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
122
120
|
mapErrors = _useState10[0],
|
|
123
121
|
setMapErrors = _useState10[1];
|
|
124
|
-
var _useState11 = (0, _react.useState)(
|
|
122
|
+
var _useState11 = (0, _react.useState)(false),
|
|
125
123
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var _useState13 = (0, _react.useState)(
|
|
124
|
+
isPreorder = _useState12[0],
|
|
125
|
+
setIsPreorder = _useState12[1];
|
|
126
|
+
var _useState13 = (0, _react.useState)(null),
|
|
129
127
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
var _useState15 = (0, _react.useState)(
|
|
128
|
+
preorderBusiness = _useState14[0],
|
|
129
|
+
setPreorderBusiness = _useState14[1];
|
|
130
|
+
var _useState15 = (0, _react.useState)(true),
|
|
133
131
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
var _useState17 = (0, _react.useState)(true),
|
|
137
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
138
|
-
hasHighRatedBusiness = _useState18[0],
|
|
139
|
-
setHasHighRatedBusiness = _useState18[1];
|
|
132
|
+
hasHighRatedBusiness = _useState16[0],
|
|
133
|
+
setHasHighRatedBusiness = _useState16[1];
|
|
140
134
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
favoriteIds =
|
|
144
|
-
setFavoriteIds =
|
|
145
|
-
var hideCities = (
|
|
146
|
-
var hideSearch = theme === null || theme === void 0 ? void 0 : (_theme$
|
|
147
|
-
var hideFilter = theme === null || theme === void 0 ? void 0 : (_theme$
|
|
135
|
+
var _useState17 = (0, _react.useState)([]),
|
|
136
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
137
|
+
favoriteIds = _useState18[0],
|
|
138
|
+
setFavoriteIds = _useState18[1];
|
|
139
|
+
var hideCities = (_ref = (theme === null || theme === void 0 ? void 0 : (_theme$business_listi = theme.business_listing_view) === null || _theme$business_listi === void 0 ? void 0 : (_theme$business_listi2 = _theme$business_listi.components) === null || _theme$business_listi2 === void 0 ? void 0 : (_theme$business_listi3 = _theme$business_listi2.cities) === null || _theme$business_listi3 === void 0 ? void 0 : _theme$business_listi3.hidden) || (orderState === null || orderState === void 0 ? void 0 : (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) !== 2) !== null && _ref !== void 0 ? _ref : true;
|
|
140
|
+
var hideSearch = theme === null || theme === void 0 ? void 0 : (_theme$business_listi4 = theme.business_listing_view) === null || _theme$business_listi4 === void 0 ? void 0 : (_theme$business_listi5 = _theme$business_listi4.components) === null || _theme$business_listi5 === void 0 ? void 0 : (_theme$business_listi6 = _theme$business_listi5.search) === null || _theme$business_listi6 === void 0 ? void 0 : _theme$business_listi6.hidden;
|
|
141
|
+
var hideFilter = theme === null || theme === void 0 ? void 0 : (_theme$business_listi7 = theme.business_listing_view) === null || _theme$business_listi7 === void 0 ? void 0 : (_theme$business_listi8 = _theme$business_listi7.components) === null || _theme$business_listi8 === void 0 ? void 0 : (_theme$business_listi9 = _theme$business_listi8.filter) === null || _theme$business_listi9 === void 0 ? void 0 : _theme$business_listi9.hidden;
|
|
148
142
|
var hideSearchSection = hideCities && hideSearch && hideFilter;
|
|
149
|
-
var isAllCategoriesHidden = theme === null || theme === void 0 ? void 0 : (_theme$
|
|
143
|
+
var isAllCategoriesHidden = theme === null || theme === void 0 ? void 0 : (_theme$business_listi10 = theme.business_listing_view) === null || _theme$business_listi10 === void 0 ? void 0 : (_theme$business_listi11 = _theme$business_listi10.components) === null || _theme$business_listi11 === void 0 ? void 0 : (_theme$business_listi12 = _theme$business_listi11.categories) === null || _theme$business_listi12 === void 0 ? void 0 : _theme$business_listi12.hidden;
|
|
150
144
|
var businessesIds = isCustomLayout && businessesList.businesses && ((_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.map(function (business) {
|
|
151
145
|
return business.id;
|
|
152
146
|
}));
|
|
153
147
|
var configTypes = (configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_types_allowed) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value.split('|').map(function (value) {
|
|
154
148
|
return Number(value);
|
|
155
149
|
})) || [];
|
|
156
|
-
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$3.type) === '
|
|
150
|
+
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';
|
|
157
151
|
var handleScroll = (0, _react.useCallback)(function () {
|
|
158
152
|
var _document$documentEle, _document$documentEle2, _businessesList$error;
|
|
159
153
|
var innerHeightScrolltop = window.innerHeight + ((_document$documentEle = document.documentElement) === null || _document$documentEle === void 0 ? void 0 : _document$documentEle.scrollTop) + PIXELS_TO_SCROLL;
|
|
@@ -256,9 +250,9 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
256
250
|
});
|
|
257
251
|
setFavoriteIds(_toConsumableArray(new Set(ids)));
|
|
258
252
|
}, [businessesList === null || businessesList === void 0 ? void 0 : (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.length]);
|
|
259
|
-
var OrdersSection = function OrdersSection(
|
|
253
|
+
var OrdersSection = function OrdersSection(_ref2) {
|
|
260
254
|
var _getCustomArray;
|
|
261
|
-
var titleContent =
|
|
255
|
+
var titleContent = _ref2.titleContent;
|
|
262
256
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCustomLayout && onRedirectPage && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_OrdersOption.OrdersOption, {
|
|
263
257
|
horizontal: true,
|
|
264
258
|
isBusinessesPage: true,
|
|
@@ -295,11 +289,12 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
295
289
|
height: 75,
|
|
296
290
|
width: 75
|
|
297
291
|
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_businessesList$busin4 = businessesList.businesses) === null || _businessesList$busin4 === void 0 ? void 0 : (_businessesList$busin5 = _businessesList$busin4.filter(function (business) {
|
|
298
|
-
return
|
|
292
|
+
return business === null || business === void 0 ? void 0 : business.open;
|
|
299
293
|
})) === null || _businessesList$busin5 === void 0 ? void 0 : _businessesList$busin5.map(function (business) {
|
|
300
294
|
var _theme$images, _theme$images$dummies;
|
|
301
295
|
return /*#__PURE__*/_react.default.createElement(_styles.BusinessLogo, {
|
|
302
296
|
key: business === null || business === void 0 ? void 0 : business.id,
|
|
297
|
+
isActive: actualSlug === (business === null || business === void 0 ? void 0 : business.slug),
|
|
303
298
|
bgimage: (business === null || business === void 0 ? void 0 : 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),
|
|
304
299
|
onClick: function onClick() {
|
|
305
300
|
return onBusinessClick(business);
|
|
@@ -315,7 +310,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
315
310
|
return /*#__PURE__*/_react.default.createElement(BeforeComponent, _extends({
|
|
316
311
|
key: i
|
|
317
312
|
}, props));
|
|
318
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessBanner, null, windowSize.width < 576 && /*#__PURE__*/_react.default.createElement(_styles.BusinessFeatures, null, /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
|
|
313
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, (windowSize.width < 576 || (configs === null || configs === void 0 ? void 0 : (_configs$business_lis = configs.business_listing_hide_image) === null || _configs$business_lis === void 0 ? void 0 : _configs$business_lis.value) !== '1' && !isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessBanner, null, windowSize.width < 576 && /*#__PURE__*/_react.default.createElement(_styles.BusinessFeatures, null, /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
|
|
319
314
|
onClick: function onClick() {
|
|
320
315
|
return handleClickAddress();
|
|
321
316
|
}
|
|
@@ -330,19 +325,18 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
330
325
|
return handleClosePopover('moment');
|
|
331
326
|
},
|
|
332
327
|
isBanner: true
|
|
333
|
-
})))), (configs === null || configs === void 0 ? void 0 : (_configs$
|
|
328
|
+
})))), (configs === null || configs === void 0 ? void 0 : (_configs$business_lis2 = configs.business_listing_hide_image) === null || _configs$business_lis2 === void 0 ? void 0 : _configs$business_lis2.value) !== '1' && !isChew && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
334
329
|
bgimage: (_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$genera = _theme$images2.general) === null || _theme$images2$genera === void 0 ? void 0 : _theme$images2$genera.businessHero,
|
|
335
|
-
height: theme === null || theme === void 0 ? void 0 : (_theme$
|
|
336
|
-
})), !!((_Object$values = Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts)) !== null && _Object$values !== void 0 && _Object$values.length) && /*#__PURE__*/_react.default.createElement(
|
|
337
|
-
isChew: isChew
|
|
338
|
-
}, /*#__PURE__*/_react.default.createElement(_OrderProgress.OrderProgress, {
|
|
330
|
+
height: theme === null || theme === void 0 ? void 0 : (_theme$business_listi13 = theme.business_listing_view) === null || _theme$business_listi13 === void 0 ? void 0 : (_theme$business_listi14 = _theme$business_listi13.components) === null || _theme$business_listi14 === void 0 ? void 0 : (_theme$business_listi15 = _theme$business_listi14.business_hero) === null || _theme$business_listi15 === void 0 ? void 0 : (_theme$business_listi16 = _theme$business_listi15.style) === null || _theme$business_listi16 === void 0 ? void 0 : _theme$business_listi16.height
|
|
331
|
+
})), !!((_Object$values = Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts)) !== null && _Object$values !== void 0 && _Object$values.length) && /*#__PURE__*/_react.default.createElement(_OrderProgress.OrderProgress, {
|
|
332
|
+
isChew: isChew,
|
|
339
333
|
franchiseId: props.franchiseId,
|
|
340
334
|
userCustomerId: userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
|
|
341
335
|
asDashboard: isCustomerMode,
|
|
342
336
|
isCustomerMode: isCustomerMode
|
|
343
|
-
})
|
|
337
|
+
}), (configs === null || configs === void 0 ? void 0 : (_configs$business_lis3 = configs.business_listing_hide_image) === null || _configs$business_lis3 === void 0 ? void 0 : _configs$business_lis3.value) !== '1' && isChew && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
344
338
|
bgimage: (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$genera = _theme$images3.general) === null || _theme$images3$genera === void 0 ? void 0 : _theme$images3$genera.businessHero,
|
|
345
|
-
height: theme === null || theme === void 0 ? void 0 : (_theme$
|
|
339
|
+
height: theme === null || theme === void 0 ? void 0 : (_theme$business_listi17 = theme.business_listing_view) === null || _theme$business_listi17 === void 0 ? void 0 : (_theme$business_listi18 = _theme$business_listi17.components) === null || _theme$business_listi18 === void 0 ? void 0 : (_theme$business_listi19 = _theme$business_listi18.business_hero) === null || _theme$business_listi19 === void 0 ? void 0 : (_theme$business_listi20 = _theme$business_listi19.style) === null || _theme$business_listi20 === void 0 ? void 0 : _theme$business_listi20.height
|
|
346
340
|
}), isCustomerMode && /*#__PURE__*/_react.default.createElement(OrdersSection, {
|
|
347
341
|
titleContent: t('PREVIOUS_ORDERS', 'Previous orders')
|
|
348
342
|
}), !isCustomerMode && !hideSearchSection && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperSearch, {
|
|
@@ -414,7 +408,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
414
408
|
businessList: businessesList.businesses,
|
|
415
409
|
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 ? void 0 : (_orderState$options7$ = _orderState$options7.address) === null || _orderState$options7$ === void 0 ? void 0 : _orderState$options7$.location,
|
|
416
410
|
setErrors: setMapErrors
|
|
417
|
-
}), !isCustomerMode && /*#__PURE__*/_react.default.createElement(OrdersSection, null), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 ? void 0 : (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
411
|
+
}), !isCustomerMode && /*#__PURE__*/_react.default.createElement(OrdersSection, null), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (!isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 ? void 0 : (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.length) > 0 || isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
418
412
|
content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
|
|
419
413
|
}, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
420
414
|
outline: true,
|
|
@@ -526,30 +520,15 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
526
520
|
citiesOpen: false
|
|
527
521
|
}));
|
|
528
522
|
}
|
|
529
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
return /*#__PURE__*/_react.default.createElement(_styles.CityItem, {
|
|
537
|
-
key: city === null || city === void 0 ? void 0 : city.id,
|
|
538
|
-
onClick: function onClick() {
|
|
539
|
-
return setActualCity(city === null || city === void 0 ? void 0 : city.id);
|
|
540
|
-
}
|
|
541
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
542
|
-
className: "radio"
|
|
543
|
-
}, (city === null || city === void 0 ? void 0 : city.id) === actualCity ? /*#__PURE__*/_react.default.createElement(_RiRadioButtonFill.default, {
|
|
544
|
-
className: "city-checked"
|
|
545
|
-
}) : /*#__PURE__*/_react.default.createElement(_IosRadioButtonOff.default, null)), city === null || city === void 0 ? void 0 : city.name);
|
|
546
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
547
|
-
color: "primary",
|
|
548
|
-
disabled: actualCity === null,
|
|
549
|
-
onClick: function onClick() {
|
|
550
|
-
return handleChangeCity(actualCity);
|
|
523
|
+
}, /*#__PURE__*/_react.default.createElement(_CitiesControl.CitiesControl, {
|
|
524
|
+
cities: citiesState === null || citiesState === void 0 ? void 0 : citiesState.cities,
|
|
525
|
+
handleChangeCity: handleChangeCity,
|
|
526
|
+
onClose: function onClose() {
|
|
527
|
+
return setModals(_objectSpread(_objectSpread({}, modals), {}, {
|
|
528
|
+
citiesOpen: false
|
|
529
|
+
}));
|
|
551
530
|
}
|
|
552
|
-
}
|
|
531
|
+
})), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
|
|
553
532
|
title: !mapErrors ? t('SEARCH', 'Search') : t('BUSINESSES_MAP', 'Businesses Map'),
|
|
554
533
|
content: alertState.content,
|
|
555
534
|
acceptText: t('ACCEPT', 'Accept'),
|
|
@@ -4,10 +4,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrapperSearch = exports.SearchContainer = exports.PreviousOrders = exports.
|
|
7
|
+
exports.WrapperSearch = exports.SearchContainer = exports.PreviousOrders = exports.ItemInline = exports.HightestRatedWrapper = exports.FeatureItems = exports.ErrorMessage = exports.Divider = exports.BusinessesTitle = exports.BusinessSearch = exports.BusinessLogosWrapper = exports.BusinessLogosContainer = exports.BusinessLogo = exports.BusinessList = exports.BusinessHeroImgStyled = exports.BusinessHeroImg = exports.BusinessFeatures = exports.BusinessContainer = exports.BusinessBanner = exports.AddressMenu = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
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, _templateObject28
|
|
10
|
+
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, _templateObject28;
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
@@ -75,23 +75,15 @@ var HightestRatedWrapper = _styledComponents.default.div(_templateObject22 || (_
|
|
|
75
75
|
exports.HightestRatedWrapper = HightestRatedWrapper;
|
|
76
76
|
var Divider = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n background: #F8F9FA;\n height: 8px;\n width: 100%;\n"])));
|
|
77
77
|
exports.Divider = Divider;
|
|
78
|
-
var
|
|
79
|
-
return props.isChew ? '110px 20px 45px' : '45px 20px';
|
|
80
|
-
});
|
|
81
|
-
exports.OrderProgressWrapper = OrderProgressWrapper;
|
|
82
|
-
var SearchContainer = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
78
|
+
var SearchContainer = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
83
79
|
exports.SearchContainer = SearchContainer;
|
|
84
|
-
var
|
|
85
|
-
exports.BusinessCityList = BusinessCityList;
|
|
86
|
-
var ButtonWrapper = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n position: relative;\n svg {\n position: absolute;\n right: 10px;\n top: 8px;\n font-size: 25px;\n color: #ffffff;\n }\n button {\n width: 100%;\n padding: 5px;\n }\n"])));
|
|
87
|
-
exports.ButtonWrapper = ButtonWrapper;
|
|
88
|
-
var CityItem = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-start;\n align-items: center;\n padding: 15px 0px;\n cursor: pointer;\n span {\n margin-right: 15px;\n }\n .city-checked{\n color: ", ";\n }\n"])), function (props) {
|
|
89
|
-
return props.theme.colors.primary;
|
|
90
|
-
});
|
|
91
|
-
exports.CityItem = CityItem;
|
|
92
|
-
var BusinessLogosWrapper = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n overflow: scroll hidden;\n width: 100%;\n"])));
|
|
80
|
+
var BusinessLogosWrapper = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n overflow: scroll hidden;\n width: 100%;\n"])));
|
|
93
81
|
exports.BusinessLogosWrapper = BusinessLogosWrapper;
|
|
94
|
-
var BusinessLogoStyled = _styledComponents.default.div(
|
|
82
|
+
var BusinessLogoStyled = _styledComponents.default.div(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n min-width: 100px;\n min-height: 100px;\n height: 100px;\n width: 100px;\n box-sizing: border-box;\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: center;\n border-radius: 7.6px;\n margin-right: 15px;\n cursor: pointer;\n ", ";\n"])), function (props) {
|
|
83
|
+
return props.isActive && (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n border: 2px solid ", ";\n "])), function (props) {
|
|
84
|
+
return props.theme.colors.primary;
|
|
85
|
+
});
|
|
86
|
+
});
|
|
95
87
|
var BusinessLogo = function BusinessLogo(props) {
|
|
96
88
|
var style = {};
|
|
97
89
|
if (props.bgimage) {
|
|
@@ -102,5 +94,5 @@ var BusinessLogo = function BusinessLogo(props) {
|
|
|
102
94
|
}), props.children);
|
|
103
95
|
};
|
|
104
96
|
exports.BusinessLogo = BusinessLogo;
|
|
105
|
-
var BusinessLogosContainer = _styledComponents.default.div(
|
|
97
|
+
var BusinessLogosContainer = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n padding-bottom: 10px;\n"])));
|
|
106
98
|
exports.BusinessLogosContainer = BusinessLogosContainer;
|
|
@@ -31,7 +31,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
var CartPopover = function CartPopover(props) {
|
|
34
|
-
var _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _props$beforeElements, _props$beforeComponen, _props$carts, _props$carts2, _orderingTheme$theme7, _orderingTheme$theme8, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _props$afterComponent, _props$afterElements;
|
|
34
|
+
var _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _props$beforeElements, _props$beforeComponen, _props$carts, _props$carts2, _orderingTheme$theme7, _orderingTheme$theme8, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _props$afterComponent, _props$afterElements;
|
|
35
35
|
var open = props.open,
|
|
36
36
|
auth = props.auth,
|
|
37
37
|
location = props.location,
|
|
@@ -53,7 +53,7 @@ var CartPopover = function CartPopover(props) {
|
|
|
53
53
|
var referenceElement = (0, _react.useRef)();
|
|
54
54
|
var popperElement = (0, _react.useRef)();
|
|
55
55
|
var arrowElement = (0, _react.useRef)();
|
|
56
|
-
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$3.type) === '
|
|
56
|
+
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';
|
|
57
57
|
var popper = (0, _reactPopper.usePopper)(referenceElement.current, popperElement.current, {
|
|
58
58
|
placement: theme !== null && theme !== void 0 && theme.rtl ? 'bottom' : 'bottom-end',
|
|
59
59
|
modifiers: [{
|
|
@@ -69,8 +69,7 @@ var CartPopover = function CartPopover(props) {
|
|
|
69
69
|
}]
|
|
70
70
|
});
|
|
71
71
|
var styles = popper.styles,
|
|
72
|
-
attributes = popper.attributes
|
|
73
|
-
forceUpdate = popper.forceUpdate;
|
|
72
|
+
attributes = popper.attributes;
|
|
74
73
|
var isSlideBar = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme2 = orderingTheme.theme) === null || _orderingTheme$theme2 === void 0 ? void 0 : (_orderingTheme$theme3 = _orderingTheme$theme2.header) === null || _orderingTheme$theme3 === void 0 ? void 0 : (_orderingTheme$theme4 = _orderingTheme$theme3.components) === null || _orderingTheme$theme4 === void 0 ? void 0 : (_orderingTheme$theme5 = _orderingTheme$theme4.cart) === null || _orderingTheme$theme5 === void 0 ? void 0 : (_orderingTheme$theme6 = _orderingTheme$theme5.open_strategy) === null || _orderingTheme$theme6 === void 0 ? void 0 : _orderingTheme$theme6.type) === 'slide';
|
|
75
74
|
(0, _react.useEffect)(function () {
|
|
76
75
|
// forceUpdate && forceUpdate()
|
|
@@ -59,7 +59,7 @@ var mapConfigs = {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
var CheckoutUI = function CheckoutUI(props) {
|
|
62
|
-
var _businessDetails$busi, _businessDetails$busi2, _businessConfigs$find, _businessConfigs$find2, _configs$cash_wallet, _configs$wallet_enabl, _cartState$cart, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _instructionsOptions$, _instructionsOptions$2, _businessDetails$busi3, _businessDetails$busi4, _theme$images, _theme$images$dummies, _configs$google_maps_, _customerState$user, _customerState$user2, _Object$values, _businessDetails$busi5, _businessDetails$busi6, _businessDetails$busi7, _businessDetails$busi8, _businessDetails$erro, _businessDetails$erro2, _businessDetails$busi9, _businessDetails$busi10, _businessDetails$busi11, _cartState$cart$spot_, _cartState$cart2, _validationFields$
|
|
62
|
+
var _businessDetails$busi, _businessDetails$busi2, _businessConfigs$find, _businessConfigs$find2, _configs$cash_wallet, _configs$wallet_enabl, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _cartState$cart, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _instructionsOptions$, _instructionsOptions$2, _businessDetails$busi3, _businessDetails$busi4, _theme$images, _theme$images$dummies, _configs$google_maps_, _customerState$user, _customerState$user2, _Object$values, _businessDetails$busi5, _businessDetails$busi6, _businessDetails$busi7, _businessDetails$busi8, _businessDetails$erro, _businessDetails$erro2, _businessDetails$busi9, _businessDetails$busi10, _businessDetails$busi11, _validationFields$fie15, _validationFields$fie16, _validationFields$fie17, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _cartState$cart$spot_, _cartState$cart2, _validationFields$fie18, _validationFields$fie19, _validationFields$fie20, _configs$driver_tip_t3, _configs$driver_tip_u2, _configs$driver_tip_t4, _cart$products2, _validationFields$fie21, _validationFields$fie22, _validationFields$fie23, _validationFields$fie24, _validationFields$fie25, _validationFields$fie26, _customerState$user3;
|
|
63
63
|
var cart = props.cart,
|
|
64
64
|
errors = props.errors,
|
|
65
65
|
placing = props.placing,
|
|
@@ -82,7 +82,9 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
82
82
|
var _useValidationFields = (0, _orderingComponentsExternal.useValidationFields)(),
|
|
83
83
|
_useValidationFields2 = _slicedToArray(_useValidationFields, 1),
|
|
84
84
|
validationFields = _useValidationFields2[0];
|
|
85
|
-
|
|
85
|
+
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
86
|
+
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
87
|
+
orderingTheme = _useOrderingTheme2[0];
|
|
86
88
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
87
89
|
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
88
90
|
_useOrder2$ = _useOrder2[0],
|
|
@@ -103,9 +105,6 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
103
105
|
var _useCustomer = (0, _orderingComponentsExternal.useCustomer)(),
|
|
104
106
|
_useCustomer2 = _slicedToArray(_useCustomer, 1),
|
|
105
107
|
customerState = _useCustomer2[0];
|
|
106
|
-
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
107
|
-
_useEvent2 = _slicedToArray(_useEvent, 1),
|
|
108
|
-
events = _useEvent2[0];
|
|
109
108
|
var history = (0, _reactRouterDom.useHistory)();
|
|
110
109
|
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
111
110
|
var _useState = (0, _react.useState)(false),
|
|
@@ -151,6 +150,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
151
150
|
return config.key === 'wallet_credit_point_enabled';
|
|
152
151
|
})) === null || _businessConfigs$find2 === void 0 ? void 0 : _businessConfigs$find2.value) === '1';
|
|
153
152
|
var isWalletEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$cash_wallet = configs.cash_wallet) === null || _configs$cash_wallet === void 0 ? void 0 : _configs$cash_wallet.value) && (configs === null || configs === void 0 ? void 0 : (_configs$wallet_enabl = configs.wallet_enabled) === null || _configs$wallet_enabl === void 0 ? void 0 : _configs$wallet_enabl.value) === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled) && !useKioskApp;
|
|
153
|
+
var isMultiDriverTips = (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
154
|
var placeSpotTypes = [3, 4, 5];
|
|
155
155
|
var placeSpotsEnabled = placeSpotTypes.includes(options === null || options === void 0 ? void 0 : options.type) && !useKioskApp;
|
|
156
156
|
// const [hasBusinessPlaces, setHasBusinessPlaces] = useState(null)
|
|
@@ -397,6 +397,14 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
397
397
|
})), isWalletEnabled && !(businessDetails !== null && businessDetails !== void 0 && businessDetails.loading) && /*#__PURE__*/_react.default.createElement(_styles.WalletPaymentOptionContainer, null, /*#__PURE__*/_react.default.createElement(_PaymentOptionWallet.PaymentOptionWallet, {
|
|
398
398
|
cart: cart,
|
|
399
399
|
businessConfigs: businessDetails === null || businessDetails === void 0 ? void 0 : (_businessDetails$busi11 = businessDetails.business) === null || _businessDetails$busi11 === void 0 ? void 0 : _businessDetails$busi11.configs
|
|
400
|
+
})), isMultiDriverTips && !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && options.type === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie15 = validationFields.fields) === null || _validationFields$fie15 === void 0 ? void 0 : (_validationFields$fie16 = _validationFields$fie15.checkout) === null || _validationFields$fie16 === void 0 ? void 0 : (_validationFields$fie17 = _validationFields$fie16.driver_tip) === null || _validationFields$fie17 === void 0 ? void 0 : _validationFields$fie17.enabled) && driverTipsOptions.length > 0 && !useKioskApp && /*#__PURE__*/_react.default.createElement(_styles.DriverTipContainer, null, /*#__PURE__*/_react.default.createElement("h1", null, t('DRIVER_TIPS', 'Driver Tips')), /*#__PURE__*/_react.default.createElement("p", null, t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')), /*#__PURE__*/_react.default.createElement(_DriverTips.DriverTips, {
|
|
401
|
+
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
402
|
+
driverTipsOptions: driverTipsOptions,
|
|
403
|
+
isFixedPrice: parseInt(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_t = configs.driver_tip_type) === null || _configs$driver_tip_t === void 0 ? void 0 : _configs$driver_tip_t.value, 10) === 1,
|
|
404
|
+
isDriverTipUseCustom: !!parseInt(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_u = configs.driver_tip_use_custom) === null || _configs$driver_tip_u === void 0 ? void 0 : _configs$driver_tip_u.value, 10),
|
|
405
|
+
driverTip: parseInt(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_t2 = configs.driver_tip_type) === null || _configs$driver_tip_t2 === void 0 ? void 0 : _configs$driver_tip_t2.value, 10) === 1 ? cart === null || cart === void 0 ? void 0 : cart.driver_tip : cart === null || cart === void 0 ? void 0 : cart.driver_tip_rate,
|
|
406
|
+
cart: cart,
|
|
407
|
+
useOrderContext: true
|
|
400
408
|
})))), /*#__PURE__*/_react.default.createElement(_styles.WrapperRightContainer, null, !cartState.loading && placeSpotsEnabled && /*#__PURE__*/_react.default.createElement(_styles.SelectSpotContainer, null, /*#__PURE__*/_react.default.createElement(_PlaceSpot.PlaceSpot, {
|
|
401
409
|
isCheckout: true,
|
|
402
410
|
isInputMode: true,
|
|
@@ -404,12 +412,12 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
404
412
|
cart: cart,
|
|
405
413
|
spotNumberDefault: (_cartState$cart$spot_ = cartState === null || cartState === void 0 ? void 0 : (_cartState$cart2 = cartState.cart) === null || _cartState$cart2 === void 0 ? void 0 : _cartState$cart2.spot_number) !== null && _cartState$cart$spot_ !== void 0 ? _cartState$cart$spot_ : cart === null || cart === void 0 ? void 0 : cart.spot_number,
|
|
406
414
|
vehicleDefault: cart === null || cart === void 0 ? void 0 : cart.vehicle
|
|
407
|
-
})), !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && options.type === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
415
|
+
})), !isMultiDriverTips && !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && options.type === 1 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie18 = validationFields.fields) === null || _validationFields$fie18 === void 0 ? void 0 : (_validationFields$fie19 = _validationFields$fie18.checkout) === null || _validationFields$fie19 === void 0 ? void 0 : (_validationFields$fie20 = _validationFields$fie19.driver_tip) === null || _validationFields$fie20 === void 0 ? void 0 : _validationFields$fie20.enabled) && driverTipsOptions.length > 0 && !useKioskApp && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.DriverTipContainer, null, /*#__PURE__*/_react.default.createElement("h1", null, t('DRIVER_TIPS', 'Driver Tips')), /*#__PURE__*/_react.default.createElement("p", null, t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')), /*#__PURE__*/_react.default.createElement(_DriverTips.DriverTips, {
|
|
408
416
|
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
409
417
|
driverTipsOptions: driverTipsOptions,
|
|
410
|
-
isFixedPrice: parseInt(configs === null || configs === void 0 ? void 0 : (_configs$
|
|
411
|
-
isDriverTipUseCustom: !!parseInt(configs === null || configs === void 0 ? void 0 : (_configs$
|
|
412
|
-
driverTip: parseInt(configs === null || configs === void 0 ? void 0 : (_configs$
|
|
418
|
+
isFixedPrice: parseInt(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_t3 = configs.driver_tip_type) === null || _configs$driver_tip_t3 === void 0 ? void 0 : _configs$driver_tip_t3.value, 10) === 1,
|
|
419
|
+
isDriverTipUseCustom: !!parseInt(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_u2 = configs.driver_tip_use_custom) === null || _configs$driver_tip_u2 === void 0 ? void 0 : _configs$driver_tip_u2.value, 10),
|
|
420
|
+
driverTip: parseInt(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_t4 = configs.driver_tip_type) === null || _configs$driver_tip_t4 === void 0 ? void 0 : _configs$driver_tip_t4.value, 10) === 1 ? cart === null || cart === void 0 ? void 0 : cart.driver_tip : cart === null || cart === void 0 ? void 0 : cart.driver_tip_rate,
|
|
413
421
|
cart: cart,
|
|
414
422
|
useOrderContext: true
|
|
415
423
|
})), /*#__PURE__*/_react.default.createElement(_styles.DriverTipDivider, null)), !cartState.loading && cart && /*#__PURE__*/_react.default.createElement(_styles.CartContainer, null, /*#__PURE__*/_react.default.createElement(_styles.CartHeader, null, /*#__PURE__*/_react.default.createElement("h1", null, t('MOBILE_FRONT_YOUR_ORDER', 'Your order')), /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -429,7 +437,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
429
437
|
onClick: function onClick() {
|
|
430
438
|
return handlePlaceOrder();
|
|
431
439
|
}
|
|
432
|
-
}, !(cart !== null && cart !== void 0 && cart.valid_maximum) ? "".concat(t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order'), ": ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.maximum)) : !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ? "".concat(t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:'), " ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.minimum)) : placing ? t('PLACING', 'Placing') : t('PLACE_ORDER', 'Place Order'))), !(cart !== null && cart !== void 0 && cart.valid_address) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('INVALID_CART_ADDRESS', 'Selected address is invalid, please select a closer address.')), !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_NOT_PAYMENT_SELECTED', 'Please, select a payment method to place order.')), !(cart !== null && cart !== void 0 && cart.valid_products) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_PRODUCTS', 'Some products are invalid, please check them.')), (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cart !== null && cart !== void 0 && cart.spot_number) && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_PLACE_SPOT', 'Please, select your spot to place order.')), options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
440
|
+
}, !(cart !== null && cart !== void 0 && cart.valid_maximum) ? "".concat(t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order'), ": ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.maximum)) : !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ? "".concat(t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:'), " ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.minimum)) : placing ? t('PLACING', 'Placing') : t('PLACE_ORDER', 'Place Order'))), !(cart !== null && cart !== void 0 && cart.valid_address) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('INVALID_CART_ADDRESS', 'Selected address is invalid, please select a closer address.')), !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_NOT_PAYMENT_SELECTED', 'Please, select a payment method to place order.')), !(cart !== null && cart !== void 0 && cart.valid_products) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_PRODUCTS', 'Some products are invalid, please check them.')), (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cart !== null && cart !== void 0 && cart.spot_number) && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_PLACE_SPOT', 'Please, select your spot to place order.')), options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie21 = validationFields.fields) === null || _validationFields$fie21 === void 0 ? void 0 : (_validationFields$fie22 = _validationFields$fie21.checkout) === null || _validationFields$fie22 === void 0 ? void 0 : (_validationFields$fie23 = _validationFields$fie22.driver_tip) === null || _validationFields$fie23 === void 0 ? void 0 : _validationFields$fie23.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie24 = validationFields.fields) === null || _validationFields$fie24 === void 0 ? void 0 : (_validationFields$fie25 = _validationFields$fie24.checkout) === null || _validationFields$fie25 === void 0 ? void 0 : (_validationFields$fie26 = _validationFields$fie25.driver_tip) === null || _validationFields$fie26 === void 0 ? void 0 : _validationFields$fie26.required) && Number(cart === null || cart === void 0 ? void 0 : cart.driver_tip) <= 0 && /*#__PURE__*/_react.default.createElement(_styles.WarningText, null, t('WARNING_INVALID_DRIVER_TIP', 'Driver Tip is required.'))), windowSize.width < 576 && !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.MobileWrapperPlaceOrderButton, null, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.total)), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
433
441
|
color: !(cart !== null && cart !== void 0 && cart.valid_maximum) || !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ? 'secundary' : 'primary'
|
|
434
442
|
// disabled={isDisablePlaceOrderButton}
|
|
435
443
|
,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CitiesControl = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
10
|
+
var _orderingComponentsExternal = require("ordering-components-external");
|
|
11
|
+
var _IosRadioButtonOff = _interopRequireDefault(require("@meronex/icons/ios/IosRadioButtonOff"));
|
|
12
|
+
var _RiRadioButtonFill = _interopRequireDefault(require("@meronex/icons/ri/RiRadioButtonFill"));
|
|
13
|
+
var _BsArrowRight = _interopRequireDefault(require("@meronex/icons/bs/BsArrowRight"));
|
|
14
|
+
var _styles = require("./styles");
|
|
15
|
+
var _Buttons = require("../../styles/Buttons");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
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."); }
|
|
21
|
+
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); }
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
var CitiesControl = function CitiesControl(props) {
|
|
26
|
+
var _orderState$options;
|
|
27
|
+
var cities = props.cities,
|
|
28
|
+
onClose = props.onClose,
|
|
29
|
+
handleChangeCity = props.handleChangeCity;
|
|
30
|
+
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
31
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
32
|
+
t = _useLanguage2[1];
|
|
33
|
+
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
34
|
+
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
35
|
+
orderState = _useOrder2[0];
|
|
36
|
+
var _useState = (0, _react.useState)(orderState === null || orderState === void 0 ? void 0 : (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.city_id),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
cityState = _useState2[0],
|
|
39
|
+
setCityState = _useState2[1];
|
|
40
|
+
var handleClick = function handleClick() {
|
|
41
|
+
var _orderState$options2;
|
|
42
|
+
cityState !== (orderState === null || orderState === void 0 ? void 0 : (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.city_id) && handleChangeCity(cityState);
|
|
43
|
+
onClose && onClose();
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, orderState !== null && orderState !== void 0 && orderState.loading ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
46
|
+
height: 40,
|
|
47
|
+
count: 3,
|
|
48
|
+
style: {
|
|
49
|
+
marginBottom: '10px'
|
|
50
|
+
}
|
|
51
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, cities === null || cities === void 0 ? void 0 : cities.map(function (city) {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_styles.CityItem, {
|
|
53
|
+
key: city === null || city === void 0 ? void 0 : city.id,
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
return setCityState((city === null || city === void 0 ? void 0 : city.id) === cityState ? null : city === null || city === void 0 ? void 0 : city.id);
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
58
|
+
className: "radio"
|
|
59
|
+
}, (city === null || city === void 0 ? void 0 : city.id) === cityState ? /*#__PURE__*/_react.default.createElement(_RiRadioButtonFill.default, {
|
|
60
|
+
className: "city-checked"
|
|
61
|
+
}) : /*#__PURE__*/_react.default.createElement(_IosRadioButtonOff.default, null)), city === null || city === void 0 ? void 0 : city.name);
|
|
62
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
63
|
+
color: "primary",
|
|
64
|
+
onClick: function onClick() {
|
|
65
|
+
return handleClick();
|
|
66
|
+
}
|
|
67
|
+
}, t('CONTINUE', 'Continue')), /*#__PURE__*/_react.default.createElement(_BsArrowRight.default, null))));
|
|
68
|
+
};
|
|
69
|
+
exports.CitiesControl = CitiesControl;
|