ordering-ui-external 1.8.9 → 1.9.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.
Files changed (51) hide show
  1. package/_bundles/{0.ordering-ui.b6cdd549ac5beb984576.js → 0.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  2. package/_bundles/{1.ordering-ui.b6cdd549ac5beb984576.js → 1.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  3. package/_bundles/{2.ordering-ui.b6cdd549ac5beb984576.js → 2.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  4. package/_bundles/{4.ordering-ui.b6cdd549ac5beb984576.js → 4.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  5. package/_bundles/{5.ordering-ui.b6cdd549ac5beb984576.js → 5.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  6. package/_bundles/{6.ordering-ui.b6cdd549ac5beb984576.js → 6.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  7. package/_bundles/{7.ordering-ui.b6cdd549ac5beb984576.js → 7.ordering-ui.557d300459c7f7dc486b.js} +1 -1
  8. package/_bundles/{7.ordering-ui.b6cdd549ac5beb984576.js.LICENSE.txt → 7.ordering-ui.557d300459c7f7dc486b.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.b6cdd549ac5beb984576.js → 8.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  10. package/_bundles/{9.ordering-ui.b6cdd549ac5beb984576.js → 9.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  11. package/_bundles/{ordering-ui.b6cdd549ac5beb984576.js → ordering-ui.557d300459c7f7dc486b.js} +2 -2
  12. package/_bundles/{ordering-ui.b6cdd549ac5beb984576.js.LICENSE.txt → ordering-ui.557d300459c7f7dc486b.js.LICENSE.txt} +0 -0
  13. package/_modules/components/PaymentOptions/index.js +2 -2
  14. package/_modules/themes/five/index.js +7 -0
  15. package/_modules/themes/five/src/components/BusinessInformation/index.js +7 -6
  16. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +3 -1
  17. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -2
  18. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +5 -3
  19. package/_modules/themes/five/src/components/Header/index.js +17 -1
  20. package/_modules/themes/five/src/components/Header/styles.js +7 -5
  21. package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +12 -12
  22. package/_modules/themes/five/src/components/OrderDetails/index.js +4 -2
  23. package/_modules/themes/five/src/components/OrdersOption/index.js +4 -2
  24. package/_modules/themes/five/src/components/ProductOption/index.js +1 -1
  25. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +1 -1
  26. package/_modules/themes/five/src/components/ReviewProduct/index.js +2 -0
  27. package/_modules/themes/five/src/components/ScheduleAccordion/index.js +49 -0
  28. package/_modules/themes/five/src/components/ScheduleAccordion/styles.js +23 -0
  29. package/_modules/themes/five/src/components/SearchBar/index.js +4 -2
  30. package/_modules/themes/five/src/components/SearchBar/styles.js +12 -8
  31. package/_modules/themes/five/src/components/ServiceForm/index.js +17 -8
  32. package/package.json +2 -2
  33. package/src/components/PaymentOptions/index.js +22 -22
  34. package/src/themes/five/index.js +2 -0
  35. package/src/themes/five/src/components/BusinessInformation/index.js +7 -23
  36. package/src/themes/five/src/components/BusinessProductsListing/index.js +3 -1
  37. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -2
  38. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +5 -1
  39. package/src/themes/five/src/components/Header/index.js +18 -3
  40. package/src/themes/five/src/components/Header/styles.js +20 -4
  41. package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +6 -6
  42. package/src/themes/five/src/components/OrderDetails/index.js +5 -2
  43. package/src/themes/five/src/components/OrdersOption/index.js +10 -9
  44. package/src/themes/five/src/components/ProductOption/index.js +1 -1
  45. package/src/themes/five/src/components/ProductOptionSubOption/index.js +1 -1
  46. package/src/themes/five/src/components/ReviewProduct/index.js +2 -0
  47. package/src/themes/five/src/components/ScheduleAccordion/index.js +60 -0
  48. package/src/themes/five/src/components/ScheduleAccordion/styles.js +28 -0
  49. package/src/themes/five/src/components/SearchBar/index.js +3 -1
  50. package/src/themes/five/src/components/SearchBar/styles.js +9 -1
  51. package/src/themes/five/src/components/ServiceForm/index.js +10 -4
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.SearchIcon = exports.DeleteContent = exports.BusinessSearch = void 0;
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
9
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
- var BusinessSearch = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n justify-content: flex-end;\n position: relative;\n\n input {\n border: none;\n border-bottom: 1px solid #E9ECEF;\n border-radius: 0px;\n width: 100%;\n background-repeat: no-repeat;\n background-size: 30px 18px;\n box-sizing: border-box;\n padding-left: 30px;\n padding-right: 50px;\n background-color: ", ";\n\n ", "\n\n ", "\n\n @media (min-width: 681px) {\n width: 100%;\n ", "\n }\n\n }\n"])), function (props) {
13
+ var BusinessSearch = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n justify-content: flex-end;\n position: relative;\n\n input {\n border: none;\n border-bottom: 1px solid #E9ECEF;\n border-radius: 0px;\n width: 100%;\n background-repeat: no-repeat;\n background-size: 30px 18px;\n box-sizing: border-box;\n padding-left: 30px;\n padding-right: 50px;\n background-color: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n @media (min-width: 681px) {\n width: 100%;\n ", "\n }\n\n }\n"])), function (props) {
14
14
  var _props$theme, _props$theme$colors;
15
15
  return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : (_props$theme$colors = _props$theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.backgroundPage;
16
16
  }, function (props) {
@@ -20,19 +20,23 @@ var BusinessSearch = _styledComponents.default.div(_templateObject || (_template
20
20
  var isCustomLayout = _ref.isCustomLayout;
21
21
  return !isCustomLayout && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n justify-content: center;\n -webkit-transition: width 0.4s ease-in-out;\n transition: width 0.4s ease-in-out; \n "])));
22
22
  }, function (_ref2) {
23
- var isCustomLayout = _ref2.isCustomLayout;
24
- return !isCustomLayout && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 50%;\n "])));
23
+ var starbucksStyle = _ref2.starbucksStyle;
24
+ return starbucksStyle && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: #F8F9FA;\n border: 1px solid #DEE2E6;\n font-size: 14px;\n color: #000;\n border-radius: 7.6px;\n "])));
25
+ }, function (_ref3) {
26
+ var isCustomLayout = _ref3.isCustomLayout,
27
+ starbucksStyle = _ref3.starbucksStyle;
28
+ return !isCustomLayout && !starbucksStyle && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n "])));
25
29
  });
26
30
  exports.BusinessSearch = BusinessSearch;
27
- var DeleteContent = _styledComponents.default.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n font-weight: 300;\n padding: 10px 0;\n color: #333;\n font-size: 14px;\n transform: translate(-30%, 0%);\n border-radius: 25%;\n max-height: 100%;\n ", "\n span{\n cursor: pointer;\n }\n img{\n width: 20px;\n transform: translate(-25%, 0%);\n ", "\n }\n"])), function (props) {
31
+ var DeleteContent = _styledComponents.default.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n font-weight: 300;\n padding: 10px 0;\n color: #333;\n font-size: 14px;\n transform: translate(-30%, 0%);\n border-radius: 25%;\n max-height: 100%;\n ", "\n span{\n cursor: pointer;\n }\n img{\n width: 20px;\n transform: translate(-25%, 0%);\n ", "\n }\n"])), function (props) {
28
32
  var _props$theme3;
29
- return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.rtl) && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n transform: translate(30%, 0%);\n "])));
33
+ return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n transform: translate(30%, 0%);\n "])));
30
34
  }, function (props) {
31
35
  var _props$theme4;
32
- return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n transform: translate(25%, 0%);\n "])));
36
+ return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n transform: translate(25%, 0%);\n "])));
33
37
  });
34
38
  exports.DeleteContent = DeleteContent;
35
- var SearchIcon = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-image: url(", ");\n background-position: right 10px center;\n background-repeat: no-repeat;\n background-size: 15px;\n background-color: ", ";\n\n"])), function (props) {
39
+ var SearchIcon = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-image: url(", ");\n background-position: right 10px center;\n background-repeat: no-repeat;\n background-size: 15px;\n background-color: ", ";\n\n"])), function (props) {
36
40
  var _props$theme5, _props$theme5$images, _props$theme5$images$;
37
41
  return (_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : (_props$theme5$images = _props$theme5.images) === null || _props$theme5$images === void 0 ? void 0 : (_props$theme5$images$ = _props$theme5$images.general) === null || _props$theme5$images$ === void 0 ? void 0 : _props$theme5$images$.searchIcon;
38
42
  }, function (props) {
@@ -34,6 +34,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
34
34
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
35
35
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
36
36
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
37
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
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."); }
39
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
40
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
37
41
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
38
42
  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."); }
39
43
  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); }
@@ -174,10 +178,15 @@ var ServiceFormUI = function ServiceFormUI(props) {
174
178
  setDateSelected(_moment);
175
179
  };
176
180
  var isBusyTime = function isBusyTime(professional) {
177
- var _professional$busy_ti;
181
+ var _professional$busy_ti, _product$duration;
178
182
  if ((professional === null || professional === void 0 ? void 0 : (_professional$busy_ti = professional.busy_times) === null || _professional$busy_ti === void 0 ? void 0 : _professional$busy_ti.length) === 0 || !dateSelected) return false;
179
- var valid = professional === null || professional === void 0 ? void 0 : professional.busy_times.some(function (item) {
180
- return (0, _moment2.default)(item === null || item === void 0 ? void 0 : item.start).valueOf() <= (0, _moment2.default)(dateSelected).valueOf() && (0, _moment2.default)(dateSelected).valueOf() <= (0, _moment2.default)(item === null || item === void 0 ? void 0 : item.end).valueOf();
183
+ var duration = (_product$duration = product === null || product === void 0 ? void 0 : product.duration) !== null && _product$duration !== void 0 ? _product$duration : 0;
184
+ var busyTimes = isCartProduct ? professional === null || professional === void 0 ? void 0 : professional.busy_times.filter(function (item) {
185
+ var _productCart$calendar, _productCart$calendar2;
186
+ return !(item.start === (productCart === null || productCart === void 0 ? void 0 : (_productCart$calendar = productCart.calendar_event) === null || _productCart$calendar === void 0 ? void 0 : _productCart$calendar.start) && item.end === (productCart === null || productCart === void 0 ? void 0 : (_productCart$calendar2 = productCart.calendar_event) === null || _productCart$calendar2 === void 0 ? void 0 : _productCart$calendar2.end));
187
+ }) : _toConsumableArray(professional === null || professional === void 0 ? void 0 : professional.busy_times);
188
+ var valid = busyTimes.some(function (item) {
189
+ return _moment2.default.utc(item === null || item === void 0 ? void 0 : item.start).local().valueOf() <= (0, _moment2.default)(dateSelected).valueOf() && (0, _moment2.default)(dateSelected).valueOf() <= _moment2.default.utc(item === null || item === void 0 ? void 0 : item.end).local().valueOf() || _moment2.default.utc(item === null || item === void 0 ? void 0 : item.start).local().valueOf() <= (0, _moment2.default)(dateSelected).add(duration, 'minutes').valueOf() && (0, _moment2.default)(dateSelected).add(duration, 'minutes').valueOf() <= _moment2.default.utc(item === null || item === void 0 ? void 0 : item.end).local().valueOf();
181
190
  });
182
191
  return valid;
183
192
  };
@@ -264,10 +273,10 @@ var ServiceFormUI = function ServiceFormUI(props) {
264
273
  setDatesList(_datesList);
265
274
  }, []);
266
275
  (0, _react.useEffect)(function () {
267
- var _productCart$calendar, _productCart$calendar2, _productCart$calendar3;
268
- if (!(productCart !== null && productCart !== void 0 && (_productCart$calendar = productCart.calendar_event) !== null && _productCart$calendar !== void 0 && _productCart$calendar.start)) return;
269
- setSelectedDate(_moment2.default.utc(productCart === null || productCart === void 0 ? void 0 : (_productCart$calendar2 = productCart.calendar_event) === null || _productCart$calendar2 === void 0 ? void 0 : _productCart$calendar2.start).local());
270
- setTimeSelected(_moment2.default.utc(productCart === null || productCart === void 0 ? void 0 : (_productCart$calendar3 = productCart.calendar_event) === null || _productCart$calendar3 === void 0 ? void 0 : _productCart$calendar3.start).local().format('HH:mm'));
276
+ var _productCart$calendar3, _productCart$calendar4, _productCart$calendar5;
277
+ if (!(productCart !== null && productCart !== void 0 && (_productCart$calendar3 = productCart.calendar_event) !== null && _productCart$calendar3 !== void 0 && _productCart$calendar3.start)) return;
278
+ setSelectedDate(_moment2.default.utc(productCart === null || productCart === void 0 ? void 0 : (_productCart$calendar4 = productCart.calendar_event) === null || _productCart$calendar4 === void 0 ? void 0 : _productCart$calendar4.start).local());
279
+ setTimeSelected(_moment2.default.utc(productCart === null || productCart === void 0 ? void 0 : (_productCart$calendar5 = productCart.calendar_event) === null || _productCart$calendar5 === void 0 ? void 0 : _productCart$calendar5.start).local().format('HH:mm'));
271
280
  }, [productCart]);
272
281
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, null, loading && !error && /*#__PURE__*/_react.default.createElement(_styles.SkeletonBlock, {
273
282
  width: 90
@@ -314,7 +323,7 @@ var ServiceFormUI = function ServiceFormUI(props) {
314
323
  }, currentProfessional ? /*#__PURE__*/_react.default.createElement(_styles.InfoWrapper, null, currentProfessional !== null && currentProfessional !== void 0 && currentProfessional.photo ? /*#__PURE__*/_react.default.createElement(_styles.ProfessionalPhoto, {
315
324
  bgimage: currentProfessional === null || currentProfessional === void 0 ? void 0 : currentProfessional.photo
316
325
  }) : /*#__PURE__*/_react.default.createElement(_FaUserAlt.default, null), /*#__PURE__*/_react.default.createElement(_styles.NameWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, currentProfessional === null || currentProfessional === void 0 ? void 0 : currentProfessional.name, " ", currentProfessional === null || currentProfessional === void 0 ? void 0 : currentProfessional.lastname), /*#__PURE__*/_react.default.createElement(_styles.StatusInfo, {
317
- available: !isBusyTime()
326
+ available: !isBusyTime(currentProfessional)
318
327
  }, isBusyTime(currentProfessional) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
319
328
  className: "status"
320
329
  }, t('BUSY_ON_SELECTED_TIME', 'Busy on selected time'))) : /*#__PURE__*/_react.default.createElement("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "1.8.9",
3
+ "version": "1.9.0",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -85,7 +85,7 @@
85
85
  "libphonenumber-js": "^1.9.4",
86
86
  "lodash": "^4.17.19",
87
87
  "moment": "^2.29.4",
88
- "ordering-components-external": "1.7.4",
88
+ "ordering-components-external": "1.9.0",
89
89
  "polished": "^3.6.6",
90
90
  "react-bootstrap-icons": "^1.7.2",
91
91
  "react-calendar": "^3.3.1",
@@ -8,7 +8,7 @@ import FaCcStripe from '@meronex/icons/fa/FaCcStripe'
8
8
  import FaStripeS from '@meronex/icons/fa/FaStripeS'
9
9
  import GrStripe from '@meronex/icons/gr/GrStripe'
10
10
  import EnPaypal from '@meronex/icons/en/EnPaypal'
11
- import {
11
+ import {
12
12
  PaymentOptions as PaymentOptionsController,
13
13
  useLanguage,
14
14
  useOrder,
@@ -91,7 +91,7 @@ const PaymentOptionsUI = (props) => {
91
91
  const [{ token }] = useSession()
92
92
  const [{ loading: loadingOptions }] = useOrder()
93
93
 
94
- const list = paymethods ? paymethods?.map(pay => pay.paymethod) : paymethodsList?.paymethods
94
+ const list = paymethodsList ? paymethodsList?.paymethods : paymethods?.map(pay => pay.paymethod)
95
95
 
96
96
  const paymethodSelected = props.paySelected || props.paymethodSelected
97
97
 
@@ -140,26 +140,26 @@ const PaymentOptionsUI = (props) => {
140
140
  <PaymentMethodsContainer>
141
141
  <PaymentMethodsList className='payments-list'>
142
142
  {!(paymethodsList.loading || isLoading || loadingOptions) &&
143
- list?.length > 0 && (
144
- list?.sort((a, b) => a.id - b.id).map(paymethod => (
145
- <React.Fragment key={paymethod.id}>
146
- {
147
- (!isCustomerMode || (isCustomerMode && (paymethod.gateway === 'card_delivery' || paymethod.gateway === 'cash'))) && (
148
- <PayCard
149
- isDisabled={isDisabled}
150
- className={`card ${paymethodSelected?.id === paymethod.id ? 'active' : ''}`}
151
- onClick={() => handlePaymentMethodClick(paymethod)}
152
- >
153
- {getPayIcon(paymethod.id)}
154
- <p>
155
- {t(paymethod.gateway.toUpperCase(), paymethod.name)}
156
- </p>
157
- </PayCard>
158
- )
159
- }
160
- </React.Fragment>
161
- ))
162
- )}
143
+ list?.length > 0 && (
144
+ list?.sort((a, b) => a.id - b.id).map(paymethod => (
145
+ <React.Fragment key={paymethod.id}>
146
+ {
147
+ (!isCustomerMode || (isCustomerMode && (paymethod.gateway === 'card_delivery' || paymethod.gateway === 'cash'))) && (
148
+ <PayCard
149
+ isDisabled={isDisabled}
150
+ className={`card ${paymethodSelected?.id === paymethod.id ? 'active' : ''}`}
151
+ onClick={() => handlePaymentMethodClick(paymethod)}
152
+ >
153
+ {getPayIcon(paymethod.id)}
154
+ <p>
155
+ {t(paymethod.gateway.toUpperCase(), paymethod.name)}
156
+ </p>
157
+ </PayCard>
158
+ )
159
+ }
160
+ </React.Fragment>
161
+ ))
162
+ )}
163
163
  {(paymethodsList.loading || isLoading || loadingOptions) && (
164
164
  [...Array(5).keys()].map(i => (
165
165
  <PayCard key={i} isSkeleton>
@@ -12,6 +12,7 @@ import { BusinessItemAccordion } from './src/components/BusinessItemAccordion'
12
12
  import { BusinessPreorder } from './src/components/BusinessPreorder'
13
13
  import { BusinessMenuList } from './src/components/BusinessMenuList'
14
14
  import { BusinessProductsCategories } from './src/components/BusinessProductsCategories'
15
+ import { ScheduleAccordion } from './src/components/ScheduleAccordion'
15
16
  import { BusinessProductsCategories as CategoriesLayoutGroceries } from './src/components/BusinessProductsCategories/layouts/groceries'
16
17
  import { BusinessProductsList } from './src/components/BusinessProductsList'
17
18
  import { BusinessProductsList as ProductListLayoutGroceries } from './src/components/BusinessProductsList/layouts/groceries'
@@ -201,6 +202,7 @@ export {
201
202
  ReviewProfessional,
202
203
  RenderProductsLayout,
203
204
  ResetPassword,
205
+ ScheduleAccordion,
204
206
  SearchBar,
205
207
  SessionsList,
206
208
  SidebarMenu,
@@ -13,7 +13,6 @@ import {
13
13
  BusinessContent,
14
14
  SectionTitle,
15
15
  Map,
16
- ScheduleBlock,
17
16
  ScheduleSection,
18
17
  ScheduleContainer,
19
18
  DeliveryInfo,
@@ -26,6 +25,7 @@ import {
26
25
  Divider
27
26
  } from './styles'
28
27
  import MdClose from '@meronex/icons/md/MdClose'
28
+ import { ScheduleAccordion } from '../ScheduleAccordion'
29
29
 
30
30
  export const BusinessInformationUI = (props) => {
31
31
  const {
@@ -39,16 +39,6 @@ export const BusinessInformationUI = (props) => {
39
39
 
40
40
  const [, t] = useLanguage()
41
41
  const [{ configs }] = useConfig()
42
-
43
- const daysOfWeek = [
44
- t('SUNDAY_ABBREVIATION', 'Sun'),
45
- t('MONDAY_ABBREVIATION', 'Mon'),
46
- t('TUESDAY_ABBREVIATION', 'Tues'),
47
- t('WEDNESDAY_ABBREVIATION', 'Wed'),
48
- t('THURSDAY_ABBREVIATION', 'Thur'),
49
- t('FRIDAY_ABBREVIATION', 'Fri'),
50
- t('SATURDAY_ABBREVIATION', 'Sat')
51
- ]
52
42
  const [modalImage, setModalImage] = useState(false)
53
43
  const [image, setImage] = useState('')
54
44
  const [orderingTheme] = useOrderingTheme()
@@ -124,18 +114,12 @@ export const BusinessInformationUI = (props) => {
124
114
  <ScheduleSection>
125
115
  <ScheduleContainer>
126
116
  {businessSchedule.map((schedule, i) => (
127
- <ScheduleBlock key={i}>
128
- <h4>{daysOfWeek[i]}</h4>
129
- {schedule.enabled ? (
130
- <div>
131
- <p>{scheduleFormatted(schedule.lapses[0].open)}</p>
132
- <div>-</div>
133
- <p>{scheduleFormatted(schedule.lapses[0].close)}</p>
134
- </div>
135
- ) : (
136
- <p className='close'>{t('CLOSED', 'Closed')}</p>
137
- )}
138
- </ScheduleBlock>
117
+ <ScheduleAccordion
118
+ key={i}
119
+ weekIndex={i}
120
+ scheduleFormatted={scheduleFormatted}
121
+ schedule={schedule}
122
+ />
139
123
  ))}
140
124
  </ScheduleContainer>
141
125
  </ScheduleSection>
@@ -78,7 +78,8 @@ const BusinessProductsListingUI = (props) => {
78
78
  onChangeMetaTag,
79
79
  onBusinessClick,
80
80
  handleChangePriceFilterValues,
81
- priceFilterValues
81
+ priceFilterValues,
82
+ handleUpdateProfessionals
82
83
  } = props
83
84
 
84
85
  const { business, loading, error } = businessState
@@ -458,6 +459,7 @@ const BusinessProductsListingUI = (props) => {
458
459
  professionalList={business?.professionals}
459
460
  professionalSelected={professionalSelected}
460
461
  handleChangeProfessional={handleChangeProfessionalSelected}
462
+ handleUpdateProfessionals={handleUpdateProfessionals}
461
463
  productAddedToCartLength={currentCart?.products?.reduce((productsLength, Cproduct) => { return productsLength + (Cproduct?.id === (productModal.product || curProduct)?.id ? Cproduct?.quantity : 0) }, 0) || 0}
462
464
  />
463
465
  ) : (
@@ -98,7 +98,7 @@ const BusinessesListingUI = (props) => {
98
98
  const [favoriteIds, setFavoriteIds] = useState([])
99
99
  const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2) ?? true
100
100
  const hideSearch = theme?.business_listing_view?.components?.search?.hidden
101
- const hideFilter = theme?.business_listing_view?.components?.filter?.hidden
101
+ const hideFilter = theme?.business_listing_view?.components?.filter?.hidden || hideSearch
102
102
  const hideSearchSection = hideCities && hideSearch && hideFilter
103
103
  const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
104
104
  const businessesIds = isCustomLayout &&
@@ -337,7 +337,7 @@ const BusinessesListingUI = (props) => {
337
337
  {!isCustomerMode && !hideSearchSection && (
338
338
  <>
339
339
  <WrapperSearch isCustomLayout={isCustomLayout} isCustomerMode={isCustomerMode}>
340
- {!hideSearch && (
340
+ {!hideSearch && windowSize.width <= 1200 && (
341
341
  <SearchBar
342
342
  lazyLoad
343
343
  search={searchValue}
@@ -232,7 +232,6 @@ export const BusinessLogosWrapper = styled.div`
232
232
  width: 100%;
233
233
  `
234
234
 
235
-
236
235
  const BusinessLogoStyled = styled.div`
237
236
  min-width: 100px;
238
237
  min-height: 100px;
@@ -267,3 +266,8 @@ export const BusinessLogosContainer = styled.div`
267
266
  display: flex;
268
267
  padding-bottom: 10px;
269
268
  `
269
+
270
+ export const HeaderSearchMode = styled.div`
271
+ position: absolute;
272
+ width: 200px;
273
+ `
@@ -26,7 +26,8 @@ import {
26
26
  FarAwayMessage,
27
27
  Divider,
28
28
  AddressFormWrapper,
29
- LanguageSelectorWrapper
29
+ LanguageSelectorWrapper,
30
+ HeaderSearchMode
30
31
  } from './styles'
31
32
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
32
33
  import { useOnlineStatus } from '../../../../../hooks/useOnlineStatus'
@@ -48,6 +49,7 @@ import { SignUpForm } from '../SignUpForm'
48
49
  import { ForgotPasswordForm } from '../ForgotPasswordForm'
49
50
  import { getDistance } from '../../../../../utils'
50
51
  import { BusinessPreorder } from '../BusinessPreorder'
52
+ import { SearchBar } from '../SearchBar'
51
53
 
52
54
  export const Header = (props) => {
53
55
  const {
@@ -55,7 +57,9 @@ export const Header = (props) => {
55
57
  location,
56
58
  isShowOrderOptions,
57
59
  isHideSignup,
58
- isCustomerMode
60
+ isCustomerMode,
61
+ searchValue,
62
+ setSearchValue
59
63
  } = props
60
64
 
61
65
  const { pathname } = useLocation()
@@ -79,7 +83,6 @@ export const Header = (props) => {
79
83
  const [preorderBusiness, setPreorderBusiness] = useState(null)
80
84
  const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
81
85
  const [isOpenUserData, setIsOpenUserData] = useState(false)
82
-
83
86
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
84
87
  const [isFarAway, setIsFarAway] = useState(false)
85
88
 
@@ -310,6 +313,18 @@ export const Header = (props) => {
310
313
  )}
311
314
  </Menu>
312
315
  )}
316
+ {windowSize.width > 1200 && window.location.pathname === '/search' && (
317
+ <HeaderSearchMode>
318
+ <SearchBar
319
+ lazyLoad
320
+ search={searchValue}
321
+ placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
322
+ starbucksStyle
323
+ onSearch={(value) => setSearchValue(value)}
324
+ handleCustomEnter={() => events.emit('go_to_page', { page: 'business_search' })}
325
+ />
326
+ </HeaderSearchMode>
327
+ )}
313
328
  {onlineStatus && (
314
329
  <RightHeader id='right-side'>
315
330
  <Menu isCustomerMode={isCustomerMode}>
@@ -22,7 +22,7 @@ export const InnerHeader = styled.div`
22
22
  justify-content: flex-start;
23
23
  }
24
24
  #right-side {
25
- width: ${({ theme }) => theme?.header?.components?.layout?.type === 'starbucks' ? '30%' : '20%'};
25
+ width: ${({ theme }) => theme?.header?.components?.layout?.type === 'starbucks' ? '30%' : '25%'};
26
26
  justify-content: flex-end;
27
27
  }
28
28
  #center-side {
@@ -155,17 +155,17 @@ export const Menu = styled.div`
155
155
 
156
156
  @media (min-width: 1024px) {
157
157
  padding: 0 20px;
158
- margin: 0 70px;
158
+ margin-left: 45px;
159
159
  }
160
160
 
161
161
  @media (min-width: 1200px) {
162
162
  padding: 0 30px;
163
- margin: 0 100px;
163
+ margin-left: 50px;
164
164
  }
165
165
 
166
166
  @media (min-width: 1500px) {
167
167
  padding: 0 30px;
168
- margin: 0 130px;
168
+ margin: 0 75px;
169
169
  }
170
170
  }
171
171
 
@@ -472,3 +472,19 @@ export const LanguageSelectorWrapper = styled(InputGroup)`
472
472
  margin: 0px 10px 0 5px;
473
473
  }
474
474
  `
475
+
476
+ export const HeaderSearchMode = styled.div`
477
+ display: flex;
478
+ justify-content: center;
479
+ width: 300px;
480
+ input {
481
+ overflow: hidden;
482
+ text-overflow: ellipsis;
483
+ }
484
+ @media (min-width: 1400px){
485
+ width: 300px;
486
+ }
487
+ @media (min-width: 1200px){
488
+ width: 250px;
489
+ }
490
+ `
@@ -75,7 +75,7 @@ export const OrderBillSection = (props) => {
75
75
  order?.offers?.length > 0 && order?.offers?.filter(offer => offer?.target === 1)?.map(offer => (
76
76
  <tr key={offer.id}>
77
77
  <td>
78
- {offer.name}
78
+ {t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
79
79
  {offer.rate_type === 1 && (
80
80
  <span>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</span>
81
81
  )}
@@ -127,7 +127,7 @@ export const OrderBillSection = (props) => {
127
127
  order?.taxes?.length > 0 && order?.taxes?.filter(tax => tax?.type === 2 && tax?.rate !== 0).map(tax => (
128
128
  <tr key={tax?.id}>
129
129
  <td>
130
- {tax?.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
130
+ {t(tax?.name?.toUpperCase()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
131
131
  <span>{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}</span>
132
132
  {setOpenTaxModal && (
133
133
  <Exclamation onClick={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })}>
@@ -143,7 +143,7 @@ export const OrderBillSection = (props) => {
143
143
  order?.fees?.length > 0 && order?.fees?.filter(fee => !(fee?.fixed === 0 && fee?.percentage === 0))?.map(fee => (
144
144
  <tr key={fee.id}>
145
145
  <td>
146
- {fee?.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
146
+ {t(fee?.name?.toUpperCase()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
147
147
  ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`})
148
148
  {setOpenTaxModal && (
149
149
  <Exclamation onClick={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
@@ -159,7 +159,7 @@ export const OrderBillSection = (props) => {
159
159
  order?.offers?.length > 0 && order?.offers?.filter(offer => offer?.target === 3)?.map(offer => (
160
160
  <tr key={offer.id}>
161
161
  <td>
162
- {offer.name}
162
+ {t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
163
163
  {offer.rate_type === 1 && (
164
164
  <span>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</span>
165
165
  )}
@@ -185,7 +185,7 @@ export const OrderBillSection = (props) => {
185
185
  order?.offers?.length > 0 && order?.offers?.filter(offer => offer?.target === 2)?.map(offer => (
186
186
  <tr key={offer.id}>
187
187
  <td>
188
- {offer.name}
188
+ {t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
189
189
  {offer.rate_type === 1 && (
190
190
  <span>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</span>
191
191
  )}
@@ -254,7 +254,7 @@ export const OrderBillSection = (props) => {
254
254
  <span>
255
255
  {event?.wallet_event
256
256
  ? walletName[event?.wallet_event?.wallet?.type]?.name
257
- : t(event?.paymethod?.name.toUpperCase(), event?.paymethod?.name)}
257
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
258
258
  </span>
259
259
  {event?.data?.charge_id && (
260
260
  <span>
@@ -400,6 +400,9 @@ const OrderDetailsUI = (props) => {
400
400
  businessLogoUrlValidation()
401
401
  }, [order])
402
402
 
403
+ const disableLeftButton = [1, 15, 20, 21]
404
+ const disableRightButton = [1, 15, 21]
405
+
403
406
  return (
404
407
  <Container>
405
408
  {!loading && order && Object.keys(order).length > 0 && !(openMessages.driver || openMessages.business) && (
@@ -571,7 +574,7 @@ const OrderDetailsUI = (props) => {
571
574
  style={{ fontSize: 14 }}
572
575
  color={order?.status === 20 ? 'secundary' : 'primary'}
573
576
  onClick={() => handleChangeOrderStatus(20)}
574
- disabled={order?.status === 20 || order?.status === 21}
577
+ disabled={disableLeftButton.includes(order?.status)}
575
578
  >
576
579
  {getOrderStatus(20)?.value}
577
580
  </Button>
@@ -580,7 +583,7 @@ const OrderDetailsUI = (props) => {
580
583
  <Button
581
584
  style={{ fontSize: 14 }}
582
585
  color={order?.status === 20 ? 'primary' : 'secundary'}
583
- disabled={order?.status === 21}
586
+ disabled={disableRightButton.includes(order?.status)}
584
587
  onClick={() => handleChangeOrderStatus(21)}
585
588
  >
586
589
  {getOrderStatus(21)?.value}
@@ -78,7 +78,7 @@ const OrdersOptionUI = (props) => {
78
78
 
79
79
  const _orders = customArray || values || []
80
80
  const uniqueOrders = []
81
- const orders = _orders.map(order => order?.cart_group_id
81
+ const ordersReduced = _orders.map(order => order?.cart_group_id
82
82
  ? _orders
83
83
  .filter(_order => _order?.cart_group_id === order?.cart_group_id)
84
84
  ?.reduce((orderCompleted, currentOrder) => ({
@@ -92,14 +92,15 @@ const OrdersOptionUI = (props) => {
92
92
  products: [orderCompleted.products, currentOrder.products].flat()
93
93
  }))
94
94
  : order)
95
- .filter(order => {
96
- const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
97
- if (!isDuplicate) {
98
- uniqueOrders.push(order?.cart_group_id)
99
- return true
100
- }
101
- return false
102
- })
95
+ const orders = ordersReduced?.filter(order => {
96
+ if (!order?.cart_group_id) return true
97
+ const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
98
+ if (!isDuplicate) {
99
+ uniqueOrders.push(order?.cart_group_id)
100
+ return true
101
+ }
102
+ return false
103
+ })
103
104
 
104
105
  const isShowTitles = businessesIds
105
106
  ? orders && orders.length > 0 && !orders.map(order => businessesIds && businessesIds.includes(order.business_id)).every(i => !i)
@@ -22,7 +22,7 @@ const ProductOptionUI = (props) => {
22
22
  if (option.min === 1 && option.max === 1) {
23
23
  maxMin = t('REQUIRED', 'Required')
24
24
  } else if (option.min === 0 && option.max > 0) {
25
- maxMin = `${!option?.limit_suboptions_by_max ? t('MAX_PER_SUBOPTION', 'MAX PER SUBOPTION') : t('MAX', 'Max')}. ${option.max}`
25
+ maxMin = `${t('MAX', 'Max')}. ${option.max}`
26
26
  } else if (option.min > 0 && option.max === 0) {
27
27
  maxMin = `${t('MIN', 'Min')}. ${option.min})`
28
28
  }
@@ -39,7 +39,7 @@ const ProductOptionSubOptionUI = (props) => {
39
39
  setIsScrollAvailable
40
40
  } = props
41
41
 
42
- const disableIncrement = option?.limit_suboptions_by_max ? (balance === option?.max || state.quantity === suboption.max) : state.quantity === option?.max
42
+ const disableIncrement = option?.limit_suboptions_by_max ? (balance === option?.max || state.quantity === suboption.max) : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
43
43
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
44
44
  const [, t] = useLanguage()
45
45
  const [{ parsePrice }] = useUtils()
@@ -24,6 +24,7 @@ import { TextArea } from '../../styles/Inputs'
24
24
  import { Button } from '../../styles/Buttons'
25
25
  import { Alert } from '../Confirm'
26
26
  import { reviewCommentList } from '../../../../../utils'
27
+ import { useTheme } from 'styled-components'
27
28
 
28
29
  const SingleProductReview = (props) => {
29
30
  const {
@@ -33,6 +34,7 @@ const SingleProductReview = (props) => {
33
34
  } = props
34
35
 
35
36
  const [, t] = useLanguage()
37
+ const theme = useTheme()
36
38
  const [isLike, setIsLike] = useState(true)
37
39
  const [isExtraComment, setIsExtraComment] = useState(false)
38
40
  const [comments, setComments] = useState([])