ordering-ui-external 2.1.3 → 2.2.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.7ab84608232e3f5c3b4b.js → 0.ordering-ui.bdd6b221a4d558a752fc.js} +1 -1
- package/_bundles/{1.ordering-ui.7ab84608232e3f5c3b4b.js → 1.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{2.ordering-ui.7ab84608232e3f5c3b4b.js → 2.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{4.ordering-ui.7ab84608232e3f5c3b4b.js → 4.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{5.ordering-ui.7ab84608232e3f5c3b4b.js → 5.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{6.ordering-ui.7ab84608232e3f5c3b4b.js → 6.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{7.ordering-ui.7ab84608232e3f5c3b4b.js → 7.ordering-ui.bdd6b221a4d558a752fc.js} +1 -1
- package/_bundles/{7.ordering-ui.7ab84608232e3f5c3b4b.js.LICENSE.txt → 7.ordering-ui.bdd6b221a4d558a752fc.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.7ab84608232e3f5c3b4b.js → 8.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{9.ordering-ui.7ab84608232e3f5c3b4b.js → 9.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{ordering-ui.7ab84608232e3f5c3b4b.js → ordering-ui.bdd6b221a4d558a752fc.js} +2 -2
- package/_bundles/{ordering-ui.7ab84608232e3f5c3b4b.js.LICENSE.txt → ordering-ui.bdd6b221a4d558a752fc.js.LICENSE.txt} +0 -0
- package/_modules/hooks/useIntersectionObserver.js +6 -5
- package/_modules/styles/Toast/index.js +4 -3
- package/_modules/themes/five/src/components/AddressDetails/index.js +1 -1
- package/_modules/themes/five/src/components/AddressDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessListingSearch/Accordion/index.js +43 -0
- package/_modules/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +16 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +26 -13
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +43 -41
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +23 -4
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +38 -22
- package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +23 -17
- package/_modules/themes/five/src/components/Cart/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +24 -19
- package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
- package/_modules/themes/five/src/components/DriverTips/index.js +6 -2
- package/_modules/themes/five/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/Help/index.js +1 -1
- package/_modules/themes/five/src/components/LastOrders/index.js +3 -8
- package/_modules/themes/five/src/components/MessagesListing/index.js +2 -2
- package/_modules/themes/five/src/components/MessagesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/index.js +1 -1
- package/_modules/themes/five/src/components/MyOrders/index.js +1 -3
- package/_modules/themes/five/src/components/NotFoundSource/index.js +3 -11
- package/_modules/themes/five/src/components/NotFoundSource/styles.js +2 -2
- package/_modules/themes/five/src/components/OrderContextUI/index.js +2 -1
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +14 -11
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +1 -1
- package/_modules/themes/five/src/components/ServiceForm/index.js +16 -11
- package/_modules/themes/five/src/components/ServiceForm/styles.js +16 -5
- package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserPopover/index.js +6 -0
- package/_modules/themes/five/src/components/UserProfileForm/index.js +0 -2
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +1 -1
- package/_modules/themes/five/src/components/WalletTransactionItem/index.js +4 -2
- package/_modules/themes/five/src/components/Wallets/index.js +4 -4
- package/_modules/themes/five/src/components/Wallets/styles.js +33 -12
- package/_modules/themes/five/src/styles/Buttons/index.js +3 -1
- package/_modules/themes/pwa/src/components/MomentControl/index.js +7 -9
- package/_modules/utils/index.js +28 -2
- package/package.json +2 -2
- package/src/hooks/useIntersectionObserver.js +7 -6
- package/src/styles/Toast/index.js +4 -2
- package/src/themes/five/src/components/AddressDetails/index.js +1 -1
- package/src/themes/five/src/components/AddressDetails/styles.js +4 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +3 -1
- package/src/themes/five/src/components/BusinessItemAccordion/styles.js +9 -3
- package/src/themes/five/src/components/BusinessListingSearch/Accordion/index.js +23 -0
- package/src/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +28 -17
- package/src/themes/five/src/components/BusinessListingSearch/index.js +65 -66
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +21 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +24 -0
- package/src/themes/five/src/components/BusinessPreorder/styles.js +11 -1
- package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +7 -3
- package/src/themes/five/src/components/BusinessProductsList/styles.js +3 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +11 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +11 -1
- package/src/themes/five/src/components/Cart/styles.js +3 -1
- package/src/themes/five/src/components/Checkout/index.js +49 -62
- package/src/themes/five/src/components/Checkout/styles.js +3 -1
- package/src/themes/five/src/components/DriverTips/index.js +7 -2
- package/src/themes/five/src/components/Header/styles.js +4 -2
- package/src/themes/five/src/components/Help/index.js +0 -1
- package/src/themes/five/src/components/LastOrders/index.js +25 -28
- package/src/themes/five/src/components/MessagesListing/index.js +2 -2
- package/src/themes/five/src/components/MessagesListing/styles.js +3 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +13 -13
- package/src/themes/five/src/components/MyOrders/index.js +0 -3
- package/src/themes/five/src/components/NotFoundSource/index.js +5 -10
- package/src/themes/five/src/components/NotFoundSource/styles.js +7 -2
- package/src/themes/five/src/components/OrderContextUI/index.js +1 -1
- package/src/themes/five/src/components/OrderContextUI/styles.js +4 -2
- package/src/themes/five/src/components/PageBanner/styles.js +1 -0
- package/src/themes/five/src/components/ReviewProduct/styles.js +3 -3
- package/src/themes/five/src/components/ServiceForm/index.js +20 -14
- package/src/themes/five/src/components/ServiceForm/styles.js +11 -3
- package/src/themes/five/src/components/UserDetails/index.js +2 -2
- package/src/themes/five/src/components/UserDetails/styles.js +3 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +0 -1
- package/src/themes/five/src/components/UserPopover/index.js +2 -0
- package/src/themes/five/src/components/UserProfileForm/index.js +0 -3
- package/src/themes/five/src/components/UserProfileForm/styles.js +0 -5
- package/src/themes/five/src/components/WalletTransactionItem/index.js +4 -1
- package/src/themes/five/src/components/Wallets/index.js +101 -95
- package/src/themes/five/src/components/Wallets/styles.js +37 -17
- package/src/themes/five/src/styles/Buttons/index.js +4 -0
- package/src/themes/pwa/src/components/MomentControl/index.js +6 -11
- package/src/utils/index.js +38 -12
- package/template/pages/Home/index.js +3 -0
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TypeContent = exports.Title = exports.TimeListWrapper = exports.TimeItem = exports.SelectWrapper = exports.PreorderTypeWrapper = exports.OrderTimeWrapper = exports.MonthYearLayer = exports.LogoWrapper = exports.Layer = exports.DaysSwiper = exports.DayNumber = exports.DayName = exports.Day = exports.DateWrapper = exports.ClosedBusinessMsg = exports.ButtonWrapper = exports.BusinessPreorderContainer = exports.BusinessLogo = 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;
|
|
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, _templateObject29, _templateObject30;
|
|
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; }
|
|
@@ -52,43 +52,59 @@ var ButtonWrapper = _styledComponents.default.div(_templateObject9 || (_template
|
|
|
52
52
|
exports.ButtonWrapper = ButtonWrapper;
|
|
53
53
|
var TimeListWrapper = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n margin-left: -12px;\n width: calc(100% + 24px);\n margin-top: 30px;\n max-height: 250px;\n overflow: auto;\n"])));
|
|
54
54
|
exports.TimeListWrapper = TimeListWrapper;
|
|
55
|
-
var TimeItem = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n
|
|
56
|
-
var
|
|
57
|
-
return
|
|
55
|
+
var TimeItem = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n ", "\n border-radius: 7.6px;\n padding: 5px 15px;\n margin: 12px;\n width: calc(50% - 24px);\n min-width: calc(50% - 24px);\n box-sizing: border-box;\n user-select: none;\n\n ", "\n\n ", "\n \n ", "\n\n span {\n font-size: 14px;\n }\n\n @media (min-width: 400px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n }\n\n @media (min-width: 576px) {\n width: calc(25% - 24px);\n min-width: calc(25% - 24px);\n }\n\n @media (min-width: 769px) {\n width: calc(16.66% - 24px);\n min-width: calc(16.66% - 24px);\n }\n"])), function (_ref) {
|
|
56
|
+
var isProfessional = _ref.isProfessional;
|
|
57
|
+
return isProfessional ? (0, _styledComponents.css)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n "])), function (props) {
|
|
58
|
+
return props.theme.colors.primaryContrast;
|
|
59
|
+
}, function (props) {
|
|
58
60
|
return props.theme.colors.primary;
|
|
61
|
+
}) : (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n background: ", ";\n "])), function (props) {
|
|
62
|
+
return props.theme.colors.gray200;
|
|
59
63
|
});
|
|
60
64
|
}, function (_ref2) {
|
|
61
|
-
var
|
|
62
|
-
return
|
|
65
|
+
var active = _ref2.active;
|
|
66
|
+
return active && (0, _styledComponents.css)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n background: #F5F9FF;\n color: ", ";\n "])), function (props) {
|
|
67
|
+
return props.theme.colors.primary;
|
|
68
|
+
});
|
|
69
|
+
}, function (_ref3) {
|
|
70
|
+
var isDisabled = _ref3.isDisabled;
|
|
71
|
+
return isDisabled && (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n pointer-events: none;\n "])));
|
|
72
|
+
}, function (_ref4) {
|
|
73
|
+
var busyTime = _ref4.busyTime;
|
|
74
|
+
return busyTime && (0, _styledComponents.css)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n "])), function (props) {
|
|
75
|
+
return props.theme.colors.gray200;
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.theme.colors.lightGray;
|
|
78
|
+
});
|
|
63
79
|
});
|
|
64
80
|
exports.TimeItem = TimeItem;
|
|
65
|
-
var DateWrapper = _styledComponents.default.div(
|
|
81
|
+
var DateWrapper = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral([""])));
|
|
66
82
|
exports.DateWrapper = DateWrapper;
|
|
67
|
-
var DaysSwiper = _styledComponents.default.div(
|
|
83
|
+
var DaysSwiper = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n width: 100%;\n position: relative;\n border-top: 1px solid #E9ECEF;\n border-bottom: 1px solid #E9ECEF;\n\n .swiper-datelist {\n padding: 0 20px;\n .swiper-button-prev {\n background-image: url(\"data:image/svg+xml,%3Csvg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 16 16' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.86 8.753l5.482 4.796c.646.566 1.658.106 1.658-.753V3.204a1 1 0 00-1.659-.753l-5.48 4.796a1 1 0 000 1.506z'%3E%3C/path%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-size: 100% auto;\n background-position: center;\n width: 20px;\n }\n\n .swiper-button-prev::after {\n display: none;\n }\n .swiper-button-next {\n background-image: url(\"data:image/svg+xml,%3Csvg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 16 16' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.14 8.753l-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 011.659-.753l5.48 4.796a1 1 0 010 1.506z'%3E%3C/path%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-size: 100% auto;\n background-position: center;\n width: 18px;\n }\n\n .swiper-button-next::after {\n display: none;\n }\n\n .swiper-button-next, .swiper-container-rtl .swiper-button-prev {\n right: 0px;\n left: auto;\n }\n .swiper-button-prev, .swiper-container-rtl .swiper-button-next {\n left: 0px;\n right: auto;\n }\n }\n"])));
|
|
68
84
|
exports.DaysSwiper = DaysSwiper;
|
|
69
|
-
var MonthYearLayer = _styledComponents.default.div(
|
|
85
|
+
var MonthYearLayer = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n margin-top: 0px;\n margin-bottom: 13px;\n\n span {\n font-size: 16px;\n line-height: 24px;\n }\n"])));
|
|
70
86
|
exports.MonthYearLayer = MonthYearLayer;
|
|
71
|
-
var TypeContent = _styledComponents.default.div(
|
|
87
|
+
var TypeContent = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n white-space: nowrap;\n color: #909BA9;\n font-size: 13px;\n"])));
|
|
72
88
|
exports.TypeContent = TypeContent;
|
|
73
|
-
var Layer = _styledComponents.default.div(
|
|
74
|
-
var nobg =
|
|
75
|
-
return !nobg && (0, _styledComponents.css)(
|
|
76
|
-
}, function (
|
|
77
|
-
var height =
|
|
89
|
+
var Layer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n ", "\n position: absolute;\n top: 0;\n width: 100%;\n height: ", ";\n ", "\n"])), function (_ref5) {
|
|
90
|
+
var nobg = _ref5.nobg;
|
|
91
|
+
return !nobg && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n background-color: rgba(255, 255, 255, 0.7);\n z-index: 1;\n "])));
|
|
92
|
+
}, function (_ref6) {
|
|
93
|
+
var height = _ref6.height;
|
|
78
94
|
return height || '100vh';
|
|
79
95
|
}, function (props) {
|
|
80
96
|
var _props$theme;
|
|
81
|
-
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(
|
|
97
|
+
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n right: 0;\n "]))) : (0, _styledComponents.css)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n left: 0;\n "])));
|
|
82
98
|
});
|
|
83
99
|
exports.Layer = Layer;
|
|
84
|
-
var Day = _styledComponents.default.div(
|
|
85
|
-
var selected =
|
|
86
|
-
return selected && (0, _styledComponents.css)(
|
|
100
|
+
var Day = _styledComponents.default.div(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n display: flex;\n flex-grow: 1;\n color: #B1BCCC;\n cursor: pointer;\n padding: 14px 0 13px 0;\n flex-direction: column;\n align-items: center;\n transition: background-color .16s ease -0.01s;\n\n ", "\n\n :hover {\n background-color: #e9ecef;\n }\n"])), function (_ref7) {
|
|
101
|
+
var selected = _ref7.selected;
|
|
102
|
+
return selected && (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n color: #344050;\n "])));
|
|
87
103
|
});
|
|
88
104
|
exports.Day = Day;
|
|
89
|
-
var DayName = _styledComponents.default.div(
|
|
105
|
+
var DayName = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n font-size: 14px;\n line-height: 24px;\n margin-bottom: 10px;\n &:first-letter {\n text-transform: uppercase;\n }\n"])));
|
|
90
106
|
exports.DayName = DayName;
|
|
91
|
-
var DayNumber = _styledComponents.default.div(
|
|
107
|
+
var DayNumber = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n display: flex;\n font-weight: 500;\n font-size: 20px;\n line-height: 30px;\n"])));
|
|
92
108
|
exports.DayNumber = DayNumber;
|
|
93
|
-
var ClosedBusinessMsg = _styledComponents.default.div(
|
|
109
|
+
var ClosedBusinessMsg = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n text-align: center;\n font-size: 16px;\n width: 100%;\n"])));
|
|
94
110
|
exports.ClosedBusinessMsg = ClosedBusinessMsg;
|
package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js
CHANGED
|
@@ -18,7 +18,7 @@ var ErrorMessage = _styledComponents.default.div(_templateObject2 || (_templateO
|
|
|
18
18
|
exports.ErrorMessage = ErrorMessage;
|
|
19
19
|
var ProductsListing = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
20
20
|
exports.ProductsListing = ProductsListing;
|
|
21
|
-
var WrapAllCategories = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .category-title {\n display: flex;\n align-items: center;\n justify-content: ", ";\n margin-left: 10px;\n ", "\n\n img {\n border-radius: 7.6px;\n min-width: 41px;\n min-height: 41px;\n height: 41px;\n width: 41px;\n }\n }\n .category-description {\n margin-left: 15px;\n margin-bottom: 10px;\n display: flex;\n p {\n margin: 0;\n color: #909BA9;\n white-space: pre;\n }\n span {\n color: ", "
|
|
21
|
+
var WrapAllCategories = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .category-title {\n display: flex;\n align-items: center;\n justify-content: ", ";\n margin-left: 10px;\n ", "\n\n img {\n border-radius: 7.6px;\n min-width: 41px;\n min-height: 41px;\n height: 41px;\n width: 41px;\n }\n }\n .category-description {\n margin-left: 15px;\n margin-bottom: 10px;\n display: flex;\n p {\n margin: 0;\n color: #909BA9;\n white-space: pre;\n }\n span {\n color: ", ";=\n margin-left: 10px;\n cursor: pointer;\n &:hover {\n text-decoration: underline;\n }\n }\n }\n\n .wrap-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n button {\n min-width: max-content;\n }\n }\n h3 {\n font-weight: 600;\n font-size: 24px;\n color: ", ";\n margin-left: 10px;\n ", "\n }\n"])), function (_ref) {
|
|
22
22
|
var isCategorySelected = _ref.isCategorySelected;
|
|
23
23
|
return isCategorySelected ? 'flex-start' : 'space-between';
|
|
24
24
|
}, function (props) {
|
|
@@ -57,7 +57,7 @@ var RibbonBox = _styledComponents.default.div(_templateObject10 || (_templateObj
|
|
|
57
57
|
return isCapsule && (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n border-radius: 50px;\n "])));
|
|
58
58
|
});
|
|
59
59
|
exports.RibbonBox = RibbonBox;
|
|
60
|
-
var CategoryDescripion = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin-left: 15px;\n margin-bottom: 10px;\n display: flex;\n align-items: flex-end;\n p {\n margin: 0;\n color: #909BA9;\n max-width: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n overflow-wrap: anywhere;\n }\n span {\n color: ", ";\n
|
|
60
|
+
var CategoryDescripion = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin-left: 15px;\n margin-bottom: 10px;\n display: flex;\n align-items: flex-end;\n p {\n margin: 0;\n color: #909BA9;\n max-width: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n overflow-wrap: anywhere;\n }\n span {\n color: ", ";\n margin-left: 10px;\n cursor: pointer;\n white-space: nowrap;\n overflow: visible;\n &:hover {\n text-decoration: underline;\n }\n }\n"])), function (_ref5) {
|
|
61
61
|
var maxWidth = _ref5.maxWidth;
|
|
62
62
|
return maxWidth ? "".concat(maxWidth - 200, "px") : 'initial';
|
|
63
63
|
}, function (props) {
|
|
@@ -35,7 +35,7 @@ var WrapAllCategories = _styledComponents.default.div(_templateObject4 || (_temp
|
|
|
35
35
|
return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px 10px 0px 0px;\n "])));
|
|
36
36
|
});
|
|
37
37
|
exports.WrapAllCategories = WrapAllCategories;
|
|
38
|
-
var CategoryDescription = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-left: 15px;\n margin-bottom: 10px;\n display: flex;\n align-items: flex-end;\n p {\n margin: 0;\n color: #909BA9;\n white-space: pre;\n max-width: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n }\n span {\n color: ", ";\n
|
|
38
|
+
var CategoryDescription = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-left: 15px;\n margin-bottom: 10px;\n display: flex;\n align-items: flex-end;\n p {\n margin: 0;\n color: #909BA9;\n white-space: pre;\n max-width: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n }\n span {\n color: ", ";\n margin-left: 10px;\n cursor: pointer;\n white-space: nowrap;\n &:hover {\n text-decoration: underline;\n }\n }\n"])), function (_ref2) {
|
|
39
39
|
var maxWidth = _ref2.maxWidth;
|
|
40
40
|
return maxWidth ? "".concat(maxWidth - 200, "px") : 'initial';
|
|
41
41
|
}, function (props) {
|
|
@@ -347,6 +347,15 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
347
347
|
}
|
|
348
348
|
events.emit('get_current_view');
|
|
349
349
|
}, []);
|
|
350
|
+
(0, _react.useEffect)(function () {
|
|
351
|
+
var handleClickedBannerProduct = function handleClickedBannerProduct() {
|
|
352
|
+
handleUpdateInitialRender(true);
|
|
353
|
+
};
|
|
354
|
+
events.on('product_banner_clicked', handleClickedBannerProduct);
|
|
355
|
+
return function () {
|
|
356
|
+
events.off('product_banner_clicked', handleClickedBannerProduct);
|
|
357
|
+
};
|
|
358
|
+
}, []);
|
|
350
359
|
(0, _react.useEffect)(function () {
|
|
351
360
|
if (loading) return;
|
|
352
361
|
if (openProduct) {
|
|
@@ -503,7 +512,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
503
512
|
padding: "0",
|
|
504
513
|
isProductForm: true,
|
|
505
514
|
disableOverflowX: true
|
|
506
|
-
}, productModal.loading && !productModal.error && /*#__PURE__*/_react.default.createElement(_styles.ProductLoading, null, /*#__PURE__*/_react.default.createElement(_styles.SkeletonItem, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
515
|
+
}, productModal.loading && !productModal.error && !productModal.product && /*#__PURE__*/_react.default.createElement(_styles.ProductLoading, null, /*#__PURE__*/_react.default.createElement(_styles.SkeletonItem, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
507
516
|
height: 45,
|
|
508
517
|
count: props.useKioskApp ? 12 : 8
|
|
509
518
|
}))), productModal.error && productModal.error.length > 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
@@ -29,9 +29,11 @@ var _AutoScroll = require("../../../AutoScroll");
|
|
|
29
29
|
var _CitiesControl = require("../../../CitiesControl");
|
|
30
30
|
var _OrderContextUI = require("../../../OrderContextUI");
|
|
31
31
|
var _OrdersSection = require("./OrdersSection");
|
|
32
|
+
var _utils = require("../../../../../../../utils");
|
|
32
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
34
|
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); }
|
|
34
35
|
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; }
|
|
36
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
35
37
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
36
38
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
39
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -49,7 +51,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
49
51
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
50
52
|
var PIXELS_TO_SCROLL = 300;
|
|
51
53
|
var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
52
|
-
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, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _theme$business_listi21, _businessesList$busin, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _businessesList$busin3, _configs$business_lis, _configs$business_lis2, _theme$images2, _theme$images2$genera, _theme$business_listi22, _theme$business_listi23, _theme$business_listi24, _theme$business_listi25, _Object$values, _configs$business_lis3, _theme$images3, _theme$images3$genera, _theme$business_listi26, _theme$business_listi27, _theme$business_listi28, _theme$business_listi29, _citiesState$cities2, _citiesState$cities3, _citiesState$cities3$, _configs$advanced_bus, _orderState$
|
|
54
|
+
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, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _theme$business_listi21, _businessesList$busin, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderState$options2, _orderState$options3, _businessesList$busin3, _configs$business_lis, _configs$business_lis2, _theme$images2, _theme$images2$genera, _theme$business_listi22, _theme$business_listi23, _theme$business_listi24, _theme$business_listi25, _Object$values, _configs$business_lis3, _theme$images3, _theme$images3$genera, _theme$business_listi26, _theme$business_listi27, _theme$business_listi28, _theme$business_listi29, _citiesState$cities2, _citiesState$cities3, _citiesState$cities3$, _configs$advanced_bus, _orderState$options6, _orderState$options6$, _configs$advanced_bus2, _citiesState$cities4, _citiesState$cities5, _citiesState$cities5$, _orderState$options8, _orderState$options8$, _businessesList$busin6, _businessesList$busin7;
|
|
53
55
|
var businessesList = props.businessesList,
|
|
54
56
|
paginationProps = props.paginationProps,
|
|
55
57
|
searchValue = props.searchValue,
|
|
@@ -136,6 +138,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
136
138
|
return business.id;
|
|
137
139
|
}));
|
|
138
140
|
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';
|
|
141
|
+
var cateringTypeString = (orderState === null || orderState === void 0 ? void 0 : (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 ? void 0 : (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 8 ? 'catering_pickup' : null;
|
|
142
|
+
var cateringValues = (preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs) && (0, _utils.getCateringValues)(cateringTypeString, preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs);
|
|
139
143
|
var handleScroll = (0, _react.useCallback)(function () {
|
|
140
144
|
var _document$documentEle, _document$documentEle2, _businessesList$error;
|
|
141
145
|
var innerHeightScrolltop = window.innerHeight + ((_document$documentEle = document.documentElement) === null || _document$documentEle === void 0 ? void 0 : _document$documentEle.scrollTop) + PIXELS_TO_SCROLL;
|
|
@@ -201,8 +205,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
201
205
|
}));
|
|
202
206
|
};
|
|
203
207
|
var handleChangeCity = function handleChangeCity(cityId) {
|
|
204
|
-
var _orderState$
|
|
205
|
-
changeCityFilter(cityId === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
208
|
+
var _orderState$options4;
|
|
209
|
+
changeCityFilter(cityId === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.city_id) ? null : cityId);
|
|
206
210
|
};
|
|
207
211
|
(0, _react.useEffect)(function () {
|
|
208
212
|
if (preorderBusiness) setIsPreorder(true);
|
|
@@ -241,7 +245,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
241
245
|
})))));
|
|
242
246
|
}
|
|
243
247
|
return /*#__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(_OrderContextUI.OrderContextUI, {
|
|
244
|
-
isBusinessList: true
|
|
248
|
+
isBusinessList: true,
|
|
249
|
+
hideHero: !hideHero
|
|
245
250
|
}), (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 && !hideHero && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
|
|
246
251
|
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,
|
|
247
252
|
height: theme === null || theme === void 0 ? void 0 : (_theme$business_listi22 = theme.business_listing_view) === null || _theme$business_listi22 === void 0 ? void 0 : (_theme$business_listi23 = _theme$business_listi22.components) === null || _theme$business_listi23 === void 0 ? void 0 : (_theme$business_listi24 = _theme$business_listi23.business_hero) === null || _theme$business_listi24 === void 0 ? void 0 : (_theme$business_listi25 = _theme$business_listi24.style) === null || _theme$business_listi25 === void 0 ? void 0 : _theme$business_listi25.height
|
|
@@ -280,8 +285,8 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
280
285
|
color: "primary",
|
|
281
286
|
onClick: handleOpenCities
|
|
282
287
|
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities3 = citiesState.cities) === null || _citiesState$cities3 === void 0 ? void 0 : (_citiesState$cities3$ = _citiesState$cities3.find(function (city) {
|
|
283
|
-
var _orderState$
|
|
284
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
288
|
+
var _orderState$options5;
|
|
289
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.city_id);
|
|
285
290
|
})) === null || _citiesState$cities3$ === void 0 ? void 0 : _citiesState$cities3$.name) || t('SELECT_A_CITY', 'Select a city')), !hideFilter && (configs === null || configs === void 0 ? void 0 : (_configs$advanced_bus = configs.advanced_business_search_enabled) === null || _configs$advanced_bus === void 0 ? void 0 : _configs$advanced_bus.value) === '1' && /*#__PURE__*/_react.default.createElement(_FiFilter.default, {
|
|
286
291
|
onClick: function onClick() {
|
|
287
292
|
return onRedirectPage({
|
|
@@ -292,7 +297,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
292
297
|
onClick: toggleMap
|
|
293
298
|
})), activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
294
299
|
businessList: businessesList.businesses,
|
|
295
|
-
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
300
|
+
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : (_orderState$options6$ = _orderState$options6.address) === null || _orderState$options6$ === void 0 ? void 0 : _orderState$options6$.location,
|
|
296
301
|
setErrors: setMapErrors
|
|
297
302
|
})), !isChew && hasHighRatedBusiness && !props.franchiseId && !hideHighestBusiness && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_HighestRated.HighestRated, {
|
|
298
303
|
handleClickAddress: handleClickAddress,
|
|
@@ -332,11 +337,11 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
332
337
|
color: "primary",
|
|
333
338
|
onClick: handleOpenCities
|
|
334
339
|
}, (citiesState === null || citiesState === void 0 ? void 0 : (_citiesState$cities5 = citiesState.cities) === null || _citiesState$cities5 === void 0 ? void 0 : (_citiesState$cities5$ = _citiesState$cities5.find(function (city) {
|
|
335
|
-
var _orderState$
|
|
336
|
-
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
340
|
+
var _orderState$options7;
|
|
341
|
+
return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 ? void 0 : (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 ? void 0 : _orderState$options7.city_id);
|
|
337
342
|
})) === null || _citiesState$cities5$ === void 0 ? void 0 : _citiesState$cities5$.name) || t('SELECT_A_CITY', 'Select a city')))), isCustomerMode && activeMap && /*#__PURE__*/_react.default.createElement(_BusinessesMap.BusinessesMap, {
|
|
338
343
|
businessList: businessesList.businesses,
|
|
339
|
-
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
344
|
+
userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : (_orderState$options8$ = _orderState$options8.address) === null || _orderState$options8$ === void 0 ? void 0 : _orderState$options8$.location,
|
|
340
345
|
setErrors: setMapErrors
|
|
341
346
|
}), /*#__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 && (businessesList === null || businessesList === void 0 ? void 0 : businessesList.fetched) && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
342
347
|
content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
|
|
@@ -350,14 +355,14 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
350
355
|
height: '44px'
|
|
351
356
|
}
|
|
352
357
|
}, t('CHANGE_ADDRESS', 'Select other Address'))), (_businessesList$busin7 = businessesList.businesses) === null || _businessesList$busin7 === void 0 ? void 0 : _businessesList$busin7.map(function (business) {
|
|
353
|
-
var _orderState$
|
|
358
|
+
var _orderState$options9, _business$reviews;
|
|
354
359
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
355
360
|
key: business.id,
|
|
356
361
|
className: "card",
|
|
357
362
|
business: business,
|
|
358
363
|
isBusinessOpen: business.open,
|
|
359
364
|
handleCustomClick: handleBusinessClick,
|
|
360
|
-
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
365
|
+
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.type,
|
|
361
366
|
isCustomLayout: isCustomLayout,
|
|
362
367
|
isCustomerMode: isCustomerMode,
|
|
363
368
|
onPreorderBusiness: setPreorderBusiness,
|
|
@@ -375,13 +380,13 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
375
380
|
setFavoriteIds: setFavoriteIds
|
|
376
381
|
});
|
|
377
382
|
}), (businessesList.loading || !(businessesList !== null && businessesList !== void 0 && businessesList.fetched)) && _toConsumableArray(Array((paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.nextPageItems) > 4 ? paginationProps.nextPageItems : 8).keys()).map(function (i) {
|
|
378
|
-
var _orderState$
|
|
383
|
+
var _orderState$options10;
|
|
379
384
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
380
385
|
key: i,
|
|
381
386
|
className: "card",
|
|
382
387
|
business: {},
|
|
383
388
|
isSkeleton: true,
|
|
384
|
-
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
389
|
+
orderType: orderState === null || orderState === void 0 ? void 0 : (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.type
|
|
385
390
|
});
|
|
386
391
|
}))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
387
392
|
open: isPreorder,
|
|
@@ -389,11 +394,12 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
389
394
|
onClose: function onClose() {
|
|
390
395
|
return handleClosePreorder();
|
|
391
396
|
}
|
|
392
|
-
}, /*#__PURE__*/_react.default.createElement(_BusinessPreorder.BusinessPreorder, {
|
|
397
|
+
}, /*#__PURE__*/_react.default.createElement(_BusinessPreorder.BusinessPreorder, _extends({
|
|
393
398
|
business: preorderBusiness,
|
|
394
399
|
handleClick: handleBusinessClick,
|
|
395
|
-
showButton: true
|
|
396
|
-
|
|
400
|
+
showButton: true,
|
|
401
|
+
cateringPreorder: !!cateringTypeString
|
|
402
|
+
}, cateringValues))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
397
403
|
title: t('SELECT_A_STORE', 'Select a store'),
|
|
398
404
|
open: modals.citiesOpen,
|
|
399
405
|
width: "70%",
|
|
@@ -18,7 +18,7 @@ var CartSticky = _styledComponents.default.div(_templateObject2 || (_templateObj
|
|
|
18
18
|
return isCartOnProductsList && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow-y: auto;\n max-height: 70vh;\n position: sticky;\n top: 20px;\n "])));
|
|
19
19
|
});
|
|
20
20
|
exports.CartSticky = CartSticky;
|
|
21
|
-
var OrderBill = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-direction: column;\n padding: 10px 0px;\n background-color: ", ";\n table {\n width: 100%;\n font-size: 14px;\n\n td span {\n unicode-bidi: bidi-override;\n }\n\n tr td:nth-child(2) {\n text-align: right;\n ", "\n }\n\n .icon {\n display: flex;\n align-items: center;\n max-height: 25px;\n }\n }\n table.total {\n border-top: 1px solid #EAEAEA;\n padding-top: 10px;\n tr {\n td {\n font-weight: bold;\n color: ", ";\n font-size: 16px;\n }\n }\n }\n table.comments {\n margin-top: 20px;\n tr {\n td:nth-child(1) {\n font-weight: bold;\n }\n }\n textarea {\n width: 100%;\n box-sizing: border-box;\n border-radius: 7.6px;\n height: 77px;\n padding-right: 60px;\n }\n }\n table.spot {\n tr {\n td:nth-child(1) {\n font-weight: bold;\n }\n td:nth-child(2) {\n font-weight: bold;\n color: ", ";\n
|
|
21
|
+
var OrderBill = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-direction: column;\n padding: 10px 0px;\n background-color: ", ";\n table {\n width: 100%;\n font-size: 14px;\n\n td span {\n unicode-bidi: bidi-override;\n }\n\n tr td:nth-child(2) {\n text-align: right;\n ", "\n }\n\n .icon {\n display: flex;\n align-items: center;\n max-height: 25px;\n }\n }\n table.total {\n border-top: 1px solid #EAEAEA;\n padding-top: 10px;\n tr {\n td {\n font-weight: bold;\n color: ", ";\n font-size: 16px;\n }\n }\n }\n table.comments {\n margin-top: 20px;\n tr {\n td:nth-child(1) {\n font-weight: bold;\n }\n }\n textarea {\n width: 100%;\n box-sizing: border-box;\n border-radius: 7.6px;\n height: 77px;\n padding-right: 60px;\n }\n }\n table.spot {\n tr {\n td:nth-child(1) {\n font-weight: bold;\n }\n td:nth-child(2) {\n font-weight: bold;\n color: ", ";\n cursor: pointer;\n &:hover {\n text-decoration: underline;\n }\n }\n }\n }\n"])), function (isCheckout) {
|
|
22
22
|
return isCheckout ? 'transparent' : '#FFF';
|
|
23
23
|
}, function (props) {
|
|
24
24
|
var _props$theme;
|
|
@@ -60,7 +60,7 @@ var mapConfigs = {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
var CheckoutUI = function CheckoutUI(props) {
|
|
63
|
-
var _businessDetails$busi, _businessDetails$busi2, _configs$table_numer_, _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,
|
|
63
|
+
var _businessDetails$busi, _businessDetails$busi2, _configs$table_numer_, _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, _theme$checkout, _theme$checkout$compo, _theme$checkout$compo2, _theme$checkout$compo3, _theme$checkout$compo4, _theme$checkout2, _theme$checkout2$comp, _theme$checkout2$comp2, _theme$checkout3, _theme$checkout3$comp, _theme$checkout3$comp2, _theme$checkout3$comp3, _theme$checkout3$comp4, _theme$checkout4, _theme$checkout4$comp, _theme$checkout4$comp2, _validationFields$fie7, _validationFields$fie8, _validationFields$fie9, _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, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _cartState$cart$spot_, _cartState$cart2, _cart$business3, _cart$products2, _configs$driver_tip_t3, _configs$driver_tip_u2, _configs$driver_tip_t4, _validationFields$fie18, _validationFields$fie19, _validationFields$fie20, _validationFields$fie21, _validationFields$fie22, _validationFields$fie23, _customerState$user3;
|
|
64
64
|
var cart = props.cart,
|
|
65
65
|
errors = props.errors,
|
|
66
66
|
placing = props.placing,
|
|
@@ -176,6 +176,11 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
176
176
|
showOnSelected: t(option === null || option === void 0 ? void 0 : option.name.toUpperCase().replace(/\s/g, '_'), option === null || option === void 0 ? void 0 : option.name)
|
|
177
177
|
};
|
|
178
178
|
}));
|
|
179
|
+
var hideBusinessAddress = theme === null || theme === void 0 ? void 0 : (_theme$checkout = theme.checkout) === null || _theme$checkout === void 0 ? void 0 : (_theme$checkout$compo = _theme$checkout.components) === null || _theme$checkout$compo === void 0 ? void 0 : (_theme$checkout$compo2 = _theme$checkout$compo.business) === null || _theme$checkout$compo2 === void 0 ? void 0 : (_theme$checkout$compo3 = _theme$checkout$compo2.components) === null || _theme$checkout$compo3 === void 0 ? void 0 : (_theme$checkout$compo4 = _theme$checkout$compo3.address) === null || _theme$checkout$compo4 === void 0 ? void 0 : _theme$checkout$compo4.hidden;
|
|
180
|
+
var hideBusinessDetails = theme === null || theme === void 0 ? void 0 : (_theme$checkout2 = theme.checkout) === null || _theme$checkout2 === void 0 ? void 0 : (_theme$checkout2$comp = _theme$checkout2.components) === null || _theme$checkout2$comp === void 0 ? void 0 : (_theme$checkout2$comp2 = _theme$checkout2$comp.business) === null || _theme$checkout2$comp2 === void 0 ? void 0 : _theme$checkout2$comp2.hidden;
|
|
181
|
+
var hideBusinessMap = theme === null || theme === void 0 ? void 0 : (_theme$checkout3 = theme.checkout) === null || _theme$checkout3 === void 0 ? void 0 : (_theme$checkout3$comp = _theme$checkout3.components) === null || _theme$checkout3$comp === void 0 ? void 0 : (_theme$checkout3$comp2 = _theme$checkout3$comp.business) === null || _theme$checkout3$comp2 === void 0 ? void 0 : (_theme$checkout3$comp3 = _theme$checkout3$comp2.components) === null || _theme$checkout3$comp3 === void 0 ? void 0 : (_theme$checkout3$comp4 = _theme$checkout3$comp3.map) === null || _theme$checkout3$comp4 === void 0 ? void 0 : _theme$checkout3$comp4.hidden;
|
|
182
|
+
var hideCustomerDetails = theme === null || theme === void 0 ? void 0 : (_theme$checkout4 = theme.checkout) === null || _theme$checkout4 === void 0 ? void 0 : (_theme$checkout4$comp = _theme$checkout4.components) === null || _theme$checkout4$comp === void 0 ? void 0 : (_theme$checkout4$comp2 = _theme$checkout4$comp.customer) === null || _theme$checkout4$comp2 === void 0 ? void 0 : _theme$checkout4$comp2.hidden;
|
|
183
|
+
var driverTipsField = !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$fie7 = validationFields.fields) === null || _validationFields$fie7 === void 0 ? void 0 : (_validationFields$fie8 = _validationFields$fie7.checkout) === null || _validationFields$fie8 === void 0 ? void 0 : (_validationFields$fie9 = _validationFields$fie8.driver_tip) === null || _validationFields$fie9 === void 0 ? void 0 : _validationFields$fie9.enabled) && driverTipsOptions.length > 0 && !useKioskApp;
|
|
179
184
|
var handlePlaceOrder = function handlePlaceOrder() {
|
|
180
185
|
if (!userErrors.length && !(requiredFields !== null && requiredFields !== void 0 && requiredFields.length)) {
|
|
181
186
|
var body = {};
|
|
@@ -205,20 +210,20 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
205
210
|
setIsUserDetailsEdit(false);
|
|
206
211
|
};
|
|
207
212
|
var checkValidationFields = function checkValidationFields() {
|
|
208
|
-
var _validationFields$
|
|
213
|
+
var _validationFields$fie10, _validationFields$fie11, _validationFields$fie12, _validationFields$fie13, _validationFields$fie14, _validationFields$fie15, _validationFields$fie16, _configs$verification;
|
|
209
214
|
setUserErrors([]);
|
|
210
215
|
var errors = [];
|
|
211
216
|
var notFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'zipcode', 'address_notes'];
|
|
212
217
|
var userSelected = isCustomerMode ? customerState.user : user;
|
|
213
218
|
var _requiredFields = [];
|
|
214
|
-
Object.values(validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$
|
|
219
|
+
Object.values(validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie10 = validationFields.fields) === null || _validationFields$fie10 === void 0 ? void 0 : _validationFields$fie10.checkout).map(function (field) {
|
|
215
220
|
if (field !== null && field !== void 0 && field.enabled && field !== null && field !== void 0 && field.required && !notFields.includes(field.code)) {
|
|
216
221
|
if (userSelected && !userSelected[field === null || field === void 0 ? void 0 : field.code]) {
|
|
217
222
|
_requiredFields.push(field === null || field === void 0 ? void 0 : field.code);
|
|
218
223
|
}
|
|
219
224
|
}
|
|
220
225
|
});
|
|
221
|
-
if (userSelected && !(userSelected !== null && userSelected !== void 0 && userSelected.cellphone) && (validationFields !== null && validationFields !== void 0 && (_validationFields$
|
|
226
|
+
if (userSelected && !(userSelected !== null && userSelected !== void 0 && userSelected.cellphone) && (validationFields !== null && validationFields !== void 0 && (_validationFields$fie11 = validationFields.fields) !== null && _validationFields$fie11 !== void 0 && (_validationFields$fie12 = _validationFields$fie11.checkout) !== null && _validationFields$fie12 !== void 0 && (_validationFields$fie13 = _validationFields$fie12.cellphone) !== null && _validationFields$fie13 !== void 0 && _validationFields$fie13.enabled && validationFields !== null && validationFields !== void 0 && (_validationFields$fie14 = validationFields.fields) !== null && _validationFields$fie14 !== void 0 && (_validationFields$fie15 = _validationFields$fie14.checkout) !== null && _validationFields$fie15 !== void 0 && (_validationFields$fie16 = _validationFields$fie15.cellphone) !== null && _validationFields$fie16 !== void 0 && _validationFields$fie16.required || (configs === null || configs === void 0 ? void 0 : (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1')) {
|
|
222
227
|
_requiredFields.push('cellphone');
|
|
223
228
|
}
|
|
224
229
|
setRequiredFields(_requiredFields);
|
|
@@ -242,8 +247,8 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
242
247
|
window.scrollTo(0, scrollElement.offsetTop - 20);
|
|
243
248
|
};
|
|
244
249
|
(0, _react.useEffect)(function () {
|
|
245
|
-
var _validationFields$
|
|
246
|
-
if (validationFields && validationFields !== null && validationFields !== void 0 && (_validationFields$
|
|
250
|
+
var _validationFields$fie17;
|
|
251
|
+
if (validationFields && validationFields !== null && validationFields !== void 0 && (_validationFields$fie17 = validationFields.fields) !== null && _validationFields$fie17 !== void 0 && _validationFields$fie17.checkout) {
|
|
247
252
|
checkValidationFields();
|
|
248
253
|
}
|
|
249
254
|
}, [validationFields, user, customerState]);
|
|
@@ -286,7 +291,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
286
291
|
isCheckOut: true
|
|
287
292
|
}))), !cartState.loading && (cart === null || cart === void 0 ? void 0 : cart.status) === 2 && /*#__PURE__*/_react.default.createElement(_styles.WarningMessage, null, /*#__PURE__*/_react.default.createElement(_VscWarning.default, null), /*#__PURE__*/_react.default.createElement("h1", null, t('CART_STATUS_PENDING_MESSAGE', 'Your order is being processed, please wait a little more. if you\'ve been waiting too long, please reload the page'))), /*#__PURE__*/_react.default.createElement("h2", {
|
|
288
293
|
className: "checkout-title"
|
|
289
|
-
}, t('
|
|
294
|
+
}, t('CHECKOUT', 'Checkout')), !useKioskApp ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (cart === null || cart === void 0 ? void 0 : cart.business_id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, businessDetails !== null && businessDetails !== void 0 && businessDetails.loading || cartState.loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
290
295
|
style: {
|
|
291
296
|
width: '100%',
|
|
292
297
|
marginBottom: '20px'
|
|
@@ -417,7 +422,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
417
422
|
})), isWalletEnabled && !(businessDetails !== null && businessDetails !== void 0 && businessDetails.loading) && /*#__PURE__*/_react.default.createElement(_styles.WalletPaymentOptionContainer, null, /*#__PURE__*/_react.default.createElement(_PaymentOptionWallet.PaymentOptionWallet, {
|
|
418
423
|
cart: cart,
|
|
419
424
|
businessConfigs: businessDetails === null || businessDetails === void 0 ? void 0 : (_businessDetails$busi11 = businessDetails.business) === null || _businessDetails$busi11 === void 0 ? void 0 : _businessDetails$busi11.configs
|
|
420
|
-
})),
|
|
425
|
+
})))), /*#__PURE__*/_react.default.createElement(_styles.WrapperRightContainer, null, !!(!isMultiDriverTips && driverTipsField) && /*#__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, {
|
|
421
426
|
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
422
427
|
driverTipsOptions: driverTipsOptions,
|
|
423
428
|
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,
|
|
@@ -425,7 +430,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
425
430
|
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,
|
|
426
431
|
cart: cart,
|
|
427
432
|
useOrderContext: true
|
|
428
|
-
}))
|
|
433
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.DriverTipDivider, null)), !cartState.loading && placeSpotsEnabled && (cart === null || cart === void 0 ? void 0 : cart.business_id) && /*#__PURE__*/_react.default.createElement(_styles.SelectSpotContainer, null, /*#__PURE__*/_react.default.createElement(_PlaceSpot.PlaceSpot, {
|
|
429
434
|
isCheckout: true,
|
|
430
435
|
isInputMode: true,
|
|
431
436
|
isHomeStyle: true,
|
|
@@ -433,15 +438,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
433
438
|
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,
|
|
434
439
|
vehicleDefault: cart === null || cart === void 0 ? void 0 : cart.vehicle,
|
|
435
440
|
setPlaceSpotNumber: setPlaceSpotNumber
|
|
436
|
-
})), !
|
|
437
|
-
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
438
|
-
driverTipsOptions: driverTipsOptions,
|
|
439
|
-
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,
|
|
440
|
-
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),
|
|
441
|
-
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,
|
|
442
|
-
cart: cart,
|
|
443
|
-
useOrderContext: true
|
|
444
|
-
})), /*#__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')), (cart === null || cart === void 0 ? void 0 : (_cart$business3 = cart.business) === null || _cart$business3 === void 0 ? void 0 : _cart$business3.slug) && /*#__PURE__*/_react.default.createElement("span", {
|
|
441
|
+
})), !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')), (cart === null || cart === void 0 ? void 0 : (_cart$business3 = cart.business) === null || _cart$business3 === void 0 ? void 0 : _cart$business3.slug) && /*#__PURE__*/_react.default.createElement("span", {
|
|
445
442
|
onClick: function onClick() {
|
|
446
443
|
var _cart$business4, _cart$business5;
|
|
447
444
|
return (cart === null || cart === void 0 ? void 0 : (_cart$business4 = cart.business) === null || _cart$business4 === void 0 ? void 0 : _cart$business4.slug) && handleStoreRedirect && handleStoreRedirect(cart === null || cart === void 0 ? void 0 : (_cart$business5 = cart.business) === null || _cart$business5 === void 0 ? void 0 : _cart$business5.slug);
|
|
@@ -452,13 +449,21 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
452
449
|
useKioskApp: useKioskApp,
|
|
453
450
|
isCheckout: true,
|
|
454
451
|
isProducts: (cart === null || cart === void 0 ? void 0 : (_cart$products2 = cart.products) === null || _cart$products2 === void 0 ? void 0 : _cart$products2.length) || 0
|
|
452
|
+
})), !!(isMultiDriverTips && driverTipsField) && /*#__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, {
|
|
453
|
+
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
454
|
+
driverTipsOptions: driverTipsOptions,
|
|
455
|
+
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,
|
|
456
|
+
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),
|
|
457
|
+
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,
|
|
458
|
+
cart: cart,
|
|
459
|
+
useOrderContext: true
|
|
455
460
|
})), windowSize.width >= 576 && !cartState.loading && cart && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && /*#__PURE__*/_react.default.createElement(_styles.WrapperPlaceOrderButton, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
456
461
|
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',
|
|
457
462
|
disabled: isDisablePlaceOrderButton,
|
|
458
463
|
onClick: function onClick() {
|
|
459
464
|
return handlePlaceOrder();
|
|
460
465
|
}
|
|
461
|
-
}, !(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.')), isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) && /*#__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$
|
|
466
|
+
}, !(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.')), isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) && /*#__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$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) && (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.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, {
|
|
462
467
|
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',
|
|
463
468
|
disabled: isDisablePlaceOrderButton,
|
|
464
469
|
onClick: function onClick() {
|
|
@@ -60,7 +60,7 @@ var DriverTipDivider = _styledComponents.default.div(_templateObject19 || (_temp
|
|
|
60
60
|
exports.DriverTipDivider = DriverTipDivider;
|
|
61
61
|
var DeliveryOptionsContainer = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n #select-input {\n margin-bottom: 10px;\n }\n #list {\n width: 100%;\n }\n\n > div {\n width: 100%;\n background-color: #F8F9FA!important;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n height: 44px;\n border: none;\n border-radius: 7.6px;\n color: #909BA9 !important;\n\n > div:first-child {\n padding-top: 5px;\n padding-bottom: 5px;\n justify-content: space-between;\n }\n > div#list {\n width: 100%;\n background-color: #F8F9FA!important;\n border: 1px solid #F8F9FA;\n border-radius: 7.6px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n }\n }\n"])));
|
|
62
62
|
exports.DeliveryOptionsContainer = DeliveryOptionsContainer;
|
|
63
|
-
var CartHeader = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n flex-direction: column;\n\n h1 {\n font-weight: 600;\n font-size: 20px;\n line-height: 30px;\n }\n\n span {\n font-size: 13px;\n color: ", ";\n
|
|
63
|
+
var CartHeader = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n flex-direction: column;\n\n h1 {\n font-weight: 600;\n font-size: 20px;\n line-height: 30px;\n }\n\n span {\n font-size: 13px;\n color: ", ";\n cursor: pointer;\n user-select: none;\n &:hover {\n text-decoration: underline;\n }\n }\n\n h1, span {\n margin: 5px 0px;\n }\n\n @media (min-width: 300px) {\n flex-direction: row;\n align-items: center;\n }\n"])), function (props) {
|
|
64
64
|
return props.theme.colors.primary;
|
|
65
65
|
});
|
|
66
66
|
exports.CartHeader = CartHeader;
|
|
@@ -29,6 +29,7 @@ var DriverTipsUI = function DriverTipsUI(props) {
|
|
|
29
29
|
driverTip = props.driverTip,
|
|
30
30
|
driverTipsOptions = props.driverTipsOptions,
|
|
31
31
|
cart = props.cart,
|
|
32
|
+
carts = props.carts,
|
|
32
33
|
isDriverTipUseCustom = props.isDriverTipUseCustom,
|
|
33
34
|
handlerChangeOption = props.handlerChangeOption;
|
|
34
35
|
var _useUtils = (0, _orderingComponentsExternal.useUtils)(),
|
|
@@ -57,6 +58,9 @@ var DriverTipsUI = function DriverTipsUI(props) {
|
|
|
57
58
|
setvalue(e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value);
|
|
58
59
|
};
|
|
59
60
|
var placeholderCurrency = !isFixedPriceType ? "0%" : ((configs === null || configs === void 0 ? void 0 : (_configs$currency_pos = configs.currency_position) === null || _configs$currency_pos === void 0 ? void 0 : _configs$currency_pos.value) || 'left') === 'left' ? "".concat(configs === null || configs === void 0 ? void 0 : (_configs$format_numbe = configs.format_number_currency) === null || _configs$format_numbe === void 0 ? void 0 : _configs$format_numbe.value, "0") : "0".concat(configs === null || configs === void 0 ? void 0 : (_configs$format_numbe2 = configs.format_number_currency) === null || _configs$format_numbe2 === void 0 ? void 0 : _configs$format_numbe2.value);
|
|
61
|
+
var multiCartTipsAmmout = carts === null || carts === void 0 ? void 0 : carts.reduce(function (total, cart) {
|
|
62
|
+
return total + parseFloat((cart === null || cart === void 0 ? void 0 : cart.driver_tip) || 0);
|
|
63
|
+
}, 0);
|
|
60
64
|
return /*#__PURE__*/_react.default.createElement(_styles.DriverTipContainer, {
|
|
61
65
|
id: "driver-tip-container"
|
|
62
66
|
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperTips, null, driverTipsOptions.map(function (option, i) {
|
|
@@ -68,7 +72,7 @@ var DriverTipsUI = function DriverTipsUI(props) {
|
|
|
68
72
|
setCustomTip(false);
|
|
69
73
|
}
|
|
70
74
|
}, "".concat(isFixedPriceType ? parsePrice(option) : "".concat(option, "%")));
|
|
71
|
-
}), isDriverTipUseCustom &&
|
|
75
|
+
}), isDriverTipUseCustom && /*#__PURE__*/_react.default.createElement(_styles.TipCard, {
|
|
72
76
|
className: "".concat(customTip ? 'active' : ''),
|
|
73
77
|
onClick: function onClick() {
|
|
74
78
|
return setCustomTip(true);
|
|
@@ -86,7 +90,7 @@ var DriverTipsUI = function DriverTipsUI(props) {
|
|
|
86
90
|
handlerChangeOption(value);
|
|
87
91
|
setvalue('');
|
|
88
92
|
}
|
|
89
|
-
}, t('APPLY_TIP', 'Apply Tip')))), currentTip && /*#__PURE__*/_react.default.createElement(_styles.DriverTipMessage, null, t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount'), !isFixedPriceType && " (".concat(driverTip, "%)"), ": ", isFixedPriceType ?
|
|
93
|
+
}, t('APPLY_TIP', 'Apply Tip')))), currentTip && /*#__PURE__*/_react.default.createElement(_styles.DriverTipMessage, null, t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount'), !isFixedPriceType && " (".concat(driverTip, "%)"), ": ", parsePrice(isMulti ? multiCartTipsAmmout : isFixedPriceType ? driverTip : cart === null || cart === void 0 ? void 0 : cart.driver_tip)))));
|
|
90
94
|
};
|
|
91
95
|
var DriverTips = function DriverTips(props) {
|
|
92
96
|
var driverTipsProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -60,7 +60,7 @@ var RightHeader = _styledComponents.default.div(_templateObject8 || (_templateOb
|
|
|
60
60
|
return props.theme.colors.darkTextColor;
|
|
61
61
|
});
|
|
62
62
|
exports.RightHeader = RightHeader;
|
|
63
|
-
var Menu = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n #select-input {\n border-radius: 7.6px;\n #list {\n border-radius: 7.6px;\n }\n ", "\n }\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: ", ";\n margin: 0 20px;\n flex-grow: 1;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n @media (min-width: 821px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 45px;\n }\n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n }\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin: 0 75px;\n }\n }\n > *:not(:last-child) {\n margin: 0 5px;\n }\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n .order-type {\n padding: 0 10px;\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n @media (min-width: 821px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])), function (_ref5) {
|
|
63
|
+
var Menu = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-right: 10px;\n\n #select-input {\n border-radius: 7.6px;\n #list {\n border-radius: 7.6px;\n }\n ", "\n }\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: ", ";\n margin: 0 20px;\n flex-grow: 1;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n @media (min-width: 821px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 45px;\n }\n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n }\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin: 0 75px;\n }\n }\n > *:not(:last-child) {\n margin: 0 5px;\n }\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n .order-type {\n padding: 0 10px;\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n @media (min-width: 821px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])), function (_ref5) {
|
|
64
64
|
var isCustomerMode = _ref5.isCustomerMode;
|
|
65
65
|
return !isCustomerMode && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin: 0px 5px;\n height: 40px;\n svg {\n font-size: 16px;\n }\n > div:first-child {\n height: 100%;\n padding-left: 10px;\n padding-right: 10px;\n @media (min-width: 993px) {\n padding-left: 13px;\n padding-right: 13px;\n }\n }\n "])));
|
|
66
66
|
}, function (props) {
|
|
@@ -135,7 +135,7 @@ var InputGroup = _styledComponents.default.div(_templateObject30 || (_templateOb
|
|
|
135
135
|
return props.theme.colors.darkTextColor;
|
|
136
136
|
});
|
|
137
137
|
exports.InputGroup = InputGroup;
|
|
138
|
-
var LanguageSelectorWrapper = (0, _styledComponents.default)(InputGroup)(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n > div {\n border-radius: 7.6px;\n text-align: left;\n background: #F8F9FA !important;\n border-color: #F8F9FA;\n background-color: #F8F9FA !important;\n height: 44px;\n > div:first-child {\n height: 44px;\n }\n #list {\n border-radius: 7.6px;\n background: #F8F9FA !important;\n border-color: #F8F9FA;\n }\n }\n #select-input {\n margin:
|
|
138
|
+
var LanguageSelectorWrapper = (0, _styledComponents.default)(InputGroup)(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n > div {\n border-radius: 7.6px;\n text-align: left;\n background: #F8F9FA !important;\n border-color: #F8F9FA;\n background-color: #F8F9FA !important;\n height: 44px;\n > div:first-child {\n height: 44px;\n }\n #list {\n border-radius: 7.6px;\n background: #F8F9FA !important;\n border-color: #F8F9FA;\n }\n }\n #select-input {\n margin-left: 5px;\n }\n"])));
|
|
139
139
|
exports.LanguageSelectorWrapper = LanguageSelectorWrapper;
|
|
140
140
|
var HeaderSearchMode = _styledComponents.default.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n width: 300px;\n input {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n @media (min-width: 1400px){\n width: 300px;\n }\n @media (min-width: 1200px){\n width: 250px;\n }\n"])));
|
|
141
141
|
exports.HeaderSearchMode = HeaderSearchMode;
|