ordering-ui-external 4.0.7 → 5.0.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 (85) hide show
  1. package/_bundles/{0.ordering-ui.b594c1b9cf54956bec90.js → 0.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  2. package/_bundles/{1.ordering-ui.b594c1b9cf54956bec90.js → 1.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  3. package/_bundles/{2.ordering-ui.b594c1b9cf54956bec90.js → 2.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  4. package/_bundles/{4.ordering-ui.b594c1b9cf54956bec90.js → 4.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  5. package/_bundles/{5.ordering-ui.b594c1b9cf54956bec90.js → 5.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  6. package/_bundles/{6.ordering-ui.b594c1b9cf54956bec90.js → 6.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  7. package/_bundles/{7.ordering-ui.b594c1b9cf54956bec90.js → 7.ordering-ui.dc2501dcf51ed5b7b821.js} +2 -2
  8. package/_bundles/{8.ordering-ui.b594c1b9cf54956bec90.js → 8.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  9. package/_bundles/{9.ordering-ui.b594c1b9cf54956bec90.js → 9.ordering-ui.dc2501dcf51ed5b7b821.js} +1 -1
  10. package/_bundles/{ordering-ui.b594c1b9cf54956bec90.js → ordering-ui.dc2501dcf51ed5b7b821.js} +2 -2
  11. package/_modules/components/BusinessBasicInformation/index.js +4 -4
  12. package/_modules/components/BusinessBasicInformation/styles.js +4 -1
  13. package/_modules/components/UserProfileForm/styles.js +1 -1
  14. package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +4 -5
  15. package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +2 -6
  16. package/_modules/themes/callcenterOriginal/src/components/Checkout/index.js +1 -1
  17. package/_modules/themes/callcenterOriginal/src/components/Header/index.js +23 -43
  18. package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +14 -12
  19. package/_modules/themes/callcenterOriginal/src/components/SidebarMenu/index.js +16 -1
  20. package/_modules/themes/callcenterOriginal/src/components/SidebarMenu/styles.js +11 -3
  21. package/_modules/themes/callcenterOriginal/src/components/UserDetails/index.js +1 -1
  22. package/_modules/themes/callcenterOriginal/src/components/UserDetails/styles.js +2 -2
  23. package/_modules/themes/five/src/components/BusinessInformation/index.js +1 -1
  24. package/_modules/themes/five/src/components/BusinessInformation/styles.js +9 -5
  25. package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +1 -1
  26. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
  27. package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/index.js +8 -4
  28. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +18 -14
  29. package/_modules/themes/five/src/components/Checkout/index.js +6 -6
  30. package/_modules/themes/five/src/components/HorizontalOrdersLayout/index.js +5 -2
  31. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +44 -39
  32. package/_modules/themes/five/src/components/OrderContextUI/index.js +61 -7
  33. package/_modules/themes/five/src/components/OrderContextUI/styles.js +1 -1
  34. package/_modules/themes/five/src/components/PageBanner/index.js +3 -3
  35. package/_modules/themes/five/src/components/PhoneAutocomplete/styles.js +1 -1
  36. package/_modules/themes/five/src/components/ProductForm/index.js +20 -18
  37. package/_modules/themes/five/src/components/ProductShare/index.js +1 -1
  38. package/_modules/themes/five/src/components/ProductShare/styles.js +2 -2
  39. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +5 -3
  40. package/_modules/themes/five/src/components/ResetPassword/index.js +6 -7
  41. package/_modules/themes/five/src/components/ScheduleAccordion/styles.js +1 -1
  42. package/_modules/themes/five/src/components/SingleOrderCard/index.js +4 -2
  43. package/_modules/themes/five/src/components/SingleOrderCard/styles.js +18 -15
  44. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +3 -2
  45. package/_modules/themes/five/src/components/TaxInformation/styles.js +1 -1
  46. package/package.json +2 -2
  47. package/src/components/BusinessBasicInformation/index.js +7 -10
  48. package/src/components/BusinessBasicInformation/styles.js +13 -0
  49. package/src/components/UserProfileForm/styles.js +0 -1
  50. package/src/themes/callcenterOriginal/src/components/AddressList/index.js +2 -2
  51. package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +6 -5
  52. package/src/themes/callcenterOriginal/src/components/Checkout/index.js +1 -1
  53. package/src/themes/callcenterOriginal/src/components/Header/index.js +2 -40
  54. package/src/themes/callcenterOriginal/src/components/Header/styles.js +6 -3
  55. package/src/themes/callcenterOriginal/src/components/SidebarMenu/index.js +19 -1
  56. package/src/themes/callcenterOriginal/src/components/SidebarMenu/styles.js +27 -0
  57. package/src/themes/callcenterOriginal/src/components/UserDetails/index.js +1 -1
  58. package/src/themes/callcenterOriginal/src/components/UserDetails/styles.js +5 -1
  59. package/src/themes/five/src/components/BusinessInformation/index.js +2 -0
  60. package/src/themes/five/src/components/BusinessInformation/styles.js +10 -1
  61. package/src/themes/five/src/components/BusinessItemAccordion/styles.js +3 -0
  62. package/src/themes/five/src/components/BusinessProductsCategories/index.js +1 -2
  63. package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/index.js +5 -1
  64. package/src/themes/five/src/components/BusinessProductsListing/index.js +5 -1
  65. package/src/themes/five/src/components/Checkout/index.js +2 -1
  66. package/src/themes/five/src/components/HorizontalOrdersLayout/index.js +16 -10
  67. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +16 -1
  68. package/src/themes/five/src/components/OrderContextUI/index.js +47 -3
  69. package/src/themes/five/src/components/OrderContextUI/styles.js +3 -0
  70. package/src/themes/five/src/components/PageBanner/index.js +3 -3
  71. package/src/themes/five/src/components/PhoneAutocomplete/styles.js +4 -0
  72. package/src/themes/five/src/components/ProductForm/index.js +28 -24
  73. package/src/themes/five/src/components/ProductShare/index.js +1 -1
  74. package/src/themes/five/src/components/ProductShare/styles.js +1 -3
  75. package/src/themes/five/src/components/RenderProductsLayout/index.js +8 -4
  76. package/src/themes/five/src/components/ResetPassword/index.js +1 -1
  77. package/src/themes/five/src/components/ScheduleAccordion/styles.js +4 -0
  78. package/src/themes/five/src/components/SidebarMenu/index.js +3 -2
  79. package/src/themes/five/src/components/SingleOrderCard/index.js +4 -4
  80. package/src/themes/five/src/components/SingleOrderCard/styles.js +1 -1
  81. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +3 -2
  82. package/src/themes/five/src/components/TaxInformation/styles.js +3 -0
  83. package/template/pages/BusinessProductsList/index.js +1 -0
  84. /package/_bundles/{7.ordering-ui.b594c1b9cf54956bec90.js.LICENSE.txt → 7.ordering-ui.dc2501dcf51ed5b7b821.js.LICENSE.txt} +0 -0
  85. /package/_bundles/{ordering-ui.b594c1b9cf54956bec90.js.LICENSE.txt → ordering-ui.dc2501dcf51ed5b7b821.js.LICENSE.txt} +0 -0
@@ -55,7 +55,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
55
55
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
56
56
  _swiper.default.use([_swiper.Navigation, _swiper.Thumbs]);
57
57
  var ProductOptionsUI = function ProductOptionsUI(props) {
58
- var _configs$unaddressed_, _configs$guest_checko, _orderState$options, _configs$allowed_orde, _configs$allowed_orde2, _orderState$options2, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view$5, _theme$business_view$6, _theme$defaultLanguag, _product$ingredients2, _product$extras, _product$ingredients3, _product$ingredients4, _product$ingredients5, _product$extras2, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$options3, _orderState$options4, _orderState$options5, _orderState$options6, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _orderState$options7, _orderState$options8, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _theme$defaultLanguag11, _theme$defaultLanguag12, _theme$defaultLanguag13, _error$;
58
+ var _configs$unaddressed_, _configs$guest_checko, _orderState$options, _configs$allowed_orde, _configs$allowed_orde2, _orderState$options2, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view$5, _theme$business_view$6, _theme$defaultLanguag, _product$tags, _product$ingredients2, _product$extras, _product$ingredients3, _product$ingredients4, _product$ingredients5, _product$extras2, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$options3, _orderState$options4, _orderState$options5, _orderState$options6, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _orderState$options7, _orderState$options8, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _theme$defaultLanguag11, _theme$defaultLanguag12, _theme$defaultLanguag13, _error$;
59
59
  var businessSlug = props.businessSlug,
60
60
  editMode = props.editMode,
61
61
  isSoldOut = props.isSoldOut,
@@ -319,22 +319,24 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
319
319
  });
320
320
  menuList.length && menuList.forEach(function (menu) {
321
321
  var elementTop = scrollElement.scrollTop;
322
- var topPos = document.getElementById(menu).offsetTop;
323
- if (Math.abs(elementTop - topPos) < extraHeight) {
324
- setTabValue(menu);
325
- var elementLeft = document.getElementById("menu_".concat(menu)).offsetLeft;
326
- var scrollLeft = document.getElementById('all').scrollLeft;
327
- if (elementLeft < scrollLeft) {
328
- document.getElementById('all').scrollTo({
329
- left: elementLeft,
330
- behavior: 'smooth'
331
- });
332
- }
333
- if (elementLeft < scrollLeft + scrollElement.clientWidth) {
334
- document.getElementById('all').scrollTo({
335
- left: elementLeft - scrollElement.clientWidth / 2,
336
- behavior: 'smooth'
337
- });
322
+ if (document.getElementById(menu)) {
323
+ var topPos = document.getElementById(menu).offsetTop;
324
+ if (Math.abs(elementTop - topPos) < extraHeight) {
325
+ setTabValue(menu);
326
+ var elementLeft = document.getElementById("menu_".concat(menu)).offsetLeft;
327
+ var scrollLeft = document.getElementById('all').scrollLeft;
328
+ if (elementLeft < scrollLeft) {
329
+ document.getElementById('all').scrollTo({
330
+ left: elementLeft,
331
+ behavior: 'smooth'
332
+ });
333
+ }
334
+ if (elementLeft < scrollLeft + scrollElement.clientWidth) {
335
+ document.getElementById('all').scrollTo({
336
+ left: elementLeft - scrollElement.clientWidth / 2,
337
+ behavior: 'smooth'
338
+ });
339
+ }
338
340
  }
339
341
  }
340
342
  });
@@ -532,7 +534,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
532
534
  className: "calories"
533
535
  }, product === null || product === void 0 ? void 0 : product.calories, ' ', "cal"), /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0")), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && /*#__PURE__*/_react.default.createElement(_styles.SkuContent, null, /*#__PURE__*/_react.default.createElement("span", null, t('SKU', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SKU) || 'Sku'), "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.sku)), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0"), (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement(_styles.EstimatedPersons, null, /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.estimated_person, "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, t('ESTIMATED_PERSONS', 'persons'))))), (product === null || product === void 0 ? void 0 : product.description) && !hideProductDescription && /*#__PURE__*/_react.default.createElement(_styles.ProductDescription, null, /*#__PURE__*/_react.default.createElement(_LinkableText.LinkableText, {
534
536
  text: product === null || product === void 0 ? void 0 : product.description
535
- }))), /*#__PURE__*/_react.default.createElement(_styles.ProductTagsListContainer, null, product.tags.map(function (tag) {
537
+ }))), (product === null || product === void 0 ? void 0 : (_product$tags = product.tags) === null || _product$tags === void 0 ? void 0 : _product$tags.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductTagsListContainer, null, product.tags.map(function (tag) {
536
538
  var _theme$images2, _theme$images2$dummie;
537
539
  return /*#__PURE__*/_react.default.createElement(_styles.ProductTagWrapper, {
538
540
  key: tag.id
@@ -68,7 +68,7 @@ var ProductShareUI = function ProductShareUI(props) {
68
68
  onClick: handleClickShare
69
69
  }), /*#__PURE__*/_react.default.createElement(_styles.ShareButtons, {
70
70
  ref: contentElement,
71
- className: "a2a_kit a2a_kit_size_32 a2a_floating_style a2a_vertical_style",
71
+ className: "a2a_kit a2a_kit_size_32 a2a_vertical_style",
72
72
  "data-a2a-url": urlToShare,
73
73
  showShareButton: showShareButton
74
74
  }, /*#__PURE__*/_react.default.createElement(_styles.CopyButton, {
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
- var IconShare = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n margin: 0px;\n top: 10px;\n font-size: 22px;\n right: 16px;\n left: 10px;\n z-index: 9999999;\n background: rgba(255,255,255,0.5);\n height: 30px;\n border-radius: 50%;\n width: 30px;\n svg {\n position: relative;\n cursor: pointer;\n color: #333;\n left: 3px;\n ", "\n }\n ", "\n\n\n @media(min-width: 769px){\n position: relative;\n left: 5px;\n top: 0;\n\n svg{\n position: static;\n }\n\n ", "\n }\n\n @media (min-width: 1201px) {\n position: sticky;\n width: 0;\n\n &:nth-child(1) > svg {\n background-color: white;\n padding: 5px;\n border-radius: 9px;\n margin: 5px 0px;\n }\n\n ", "\n }\n"])), function (props) {
13
+ var IconShare = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n margin: 0px;\n top: 10px;\n font-size: 22px;\n right: 16px;\n left: 10px;\n z-index: 9999999;\n background: rgba(255,255,255,0.5);\n height: 30px;\n border-radius: 50%;\n width: 30px;\n svg {\n position: relative;\n cursor: pointer;\n color: #333;\n left: 3px;\n ", "\n }\n ", "\n\n\n @media(min-width: 769px){\n position: relative;\n left: 5px;\n top: 0;\n\n svg{\n position: static;\n }\n\n ", "\n }\n\n @media (min-width: 1201px) {\n position: sticky;\n width: 0;\n\n &:nth-child(1) > svg {\n background-color: white;\n border-radius: 9px;\n margin: 5px 0px;\n }\n\n ", "\n }\n"])), function (props) {
14
14
  var _props$theme;
15
15
  return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n left: 0;\n right: 5px;\n "])));
16
16
  }, function (props) {
@@ -24,7 +24,7 @@ var IconShare = _styledComponents.default.div(_templateObject || (_templateObjec
24
24
  return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n right: 0;\n left: initial;\n "])));
25
25
  });
26
26
  exports.IconShare = IconShare;
27
- var ShareButtons = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n visibility: ", ";\n top: 28px;\n width: 40px;\n position: absolute !important;\n\n ", "\n\n @media (min-width: 1201px) {\n top: 35px;\n left: 0px;\n right: 0px;\n }\n"])), function (_ref) {
27
+ var ShareButtons = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n visibility: ", ";\n top: 28px;\n width: 40px;\n position: absolute !important;\n\n ", "\n\n @media (min-width: 1201px) {\n top: 35px;\n left: -8px;\n }\n"])), function (_ref) {
28
28
  var showShareButton = _ref.showShareButton;
29
29
  return showShareButton ? 'visible' : 'hidden';
30
30
  }, function (props) {
@@ -86,7 +86,8 @@ var RenderProductsLayout = function RenderProductsLayout(props) {
86
86
  onBusinessClick = props.onBusinessClick,
87
87
  handleChangePriceFilterValues = props.handleChangePriceFilterValues,
88
88
  priceFilterValues = props.priceFilterValues,
89
- handleUpdateProfessionals = props.handleUpdateProfessionals;
89
+ handleUpdateProfessionals = props.handleUpdateProfessionals,
90
+ isCustomerMode = props.isCustomerMode;
90
91
  var theme = (0, _styledComponents.useTheme)();
91
92
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
92
93
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
@@ -171,7 +172,7 @@ var RenderProductsLayout = function RenderProductsLayout(props) {
171
172
  categoryClicked: categoryClicked,
172
173
  categorySelected: categorySelected,
173
174
  setCategoryClicked: setCategoryClicked
174
- })), /*#__PURE__*/_react.default.createElement(_styles.PageBannerWrapper, null, /*#__PURE__*/_react.default.createElement(_PageBanner.PageBanner, {
175
+ })), !isCustomerMode && /*#__PURE__*/_react.default.createElement(_styles.PageBannerWrapper, null, /*#__PURE__*/_react.default.createElement(_PageBanner.PageBanner, {
175
176
  position: "web_business_page"
176
177
  })), !errorQuantityProducts && SearchProductsComponent && !useKioskApp && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperSearch, null, /*#__PURE__*/_react.default.createElement(SearchProductsComponent, {
177
178
  handleChangeSearch: handleChangeSearch,
@@ -397,7 +398,8 @@ var RenderProductsLayout = function RenderProductsLayout(props) {
397
398
  }, /*#__PURE__*/_react.default.createElement(_BusinessProductsCategories.BusinessProductsCategories, {
398
399
  isSkeleton: true,
399
400
  categories: [],
400
- openBusinessInformation: openBusinessInformation
401
+ openBusinessInformation: openBusinessInformation,
402
+ isCustomerMode: isCustomerMode
401
403
  })))), (categoryClicked || windowSize.width >= 993) && /*#__PURE__*/_react.default.createElement(_styles.WrapContent, null, /*#__PURE__*/_react.default.createElement(_BusinessProductsList.BusinessProductsList, {
402
404
  categories: [],
403
405
  useKioskApp: useKioskApp,
@@ -30,7 +30,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
30
30
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
31
31
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
32
  var ResetPasswordUI = function ResetPasswordUI(props) {
33
- var _props$beforeElements, _props$beforeComponen, _props$beforeMidEleme, _props$beforeMidCompo, _theme$images, _theme$images$logos, _formState$result7, _formState$result7$re, _formState$result8, _formState$result8$re, _theme$images2, _theme$images2$logos, _props$afterMidElemen, _props$afterMidCompon, _props$afterComponent, _props$afterElements;
33
+ var _props$beforeElements, _props$beforeComponen, _props$beforeMidEleme, _props$beforeMidCompo, _theme$images, _theme$images$logos, _formState$result5, _formState$result5$re, _formState$result6, _formState$result6$re, _theme$images2, _theme$images2$logos, _props$afterMidElemen, _props$afterMidCompon, _props$afterComponent, _props$afterElements;
34
34
  var code = props.code,
35
35
  random = props.random,
36
36
  formState = props.formState,
@@ -79,7 +79,7 @@ var ResetPasswordUI = function ResetPasswordUI(props) {
79
79
  }
80
80
  };
81
81
  (0, _react.useEffect)(function () {
82
- var _formState$result, _formState$result3, _formState$result3$re, _formState$result6, _formState$result6$re;
82
+ var _formState$result, _formState$result3, _formState$result3$re, _formState$result4, _formState$result4$re;
83
83
  if (!formState.loading && (_formState$result = formState.result) !== null && _formState$result !== void 0 && _formState$result.error) {
84
84
  var _formState$result2;
85
85
  setAlertState({
@@ -87,13 +87,12 @@ var ResetPasswordUI = function ResetPasswordUI(props) {
87
87
  content: ((_formState$result2 = formState.result) === null || _formState$result2 === void 0 ? void 0 : _formState$result2.result) || [t('ERROR', 'Error')]
88
88
  });
89
89
  } else if (!formState.loading && (_formState$result3 = formState.result) !== null && _formState$result3 !== void 0 && (_formState$result3$re = _formState$result3.result) !== null && _formState$result3$re !== void 0 && _formState$result3$re.length) {
90
- var _formState$result4, _formState$result5;
91
90
  setAlertState({
92
91
  open: true,
93
- content: ((_formState$result4 = formState.result) === null || _formState$result4 === void 0 ? void 0 : _formState$result4.result) === 'OK' ? t('PASSWORD_RESET_SUCCESS', 'Password changed successfully') : t((_formState$result5 = formState.result) === null || _formState$result5 === void 0 ? void 0 : _formState$result5.result, 'Password changed successfully')
92
+ content: t('PASSWORD_RESET_SUCCESS', 'Password changed successfully')
94
93
  });
95
94
  }
96
- if (!formState.loading && ((_formState$result6 = formState.result) === null || _formState$result6 === void 0 ? void 0 : (_formState$result6$re = _formState$result6.result) === null || _formState$result6$re === void 0 ? void 0 : _formState$result6$re.length) > 0 && !formState.result.error) {
95
+ if (!formState.loading && ((_formState$result4 = formState.result) === null || _formState$result4 === void 0 ? void 0 : (_formState$result4$re = _formState$result4.result) === null || _formState$result4$re === void 0 ? void 0 : _formState$result4$re.length) > 0 && !formState.result.error) {
97
96
  setOpenAuthModal(true);
98
97
  }
99
98
  }, [formState]);
@@ -168,8 +167,8 @@ var ResetPasswordUI = function ResetPasswordUI(props) {
168
167
  autoComplete: "off"
169
168
  }), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
170
169
  type: "submit",
171
- color: formState.loading || (_formState$result7 = formState.result) !== null && _formState$result7 !== void 0 && (_formState$result7$re = _formState$result7.result) !== null && _formState$result7$re !== void 0 && _formState$result7$re.length ? 'secondary' : 'primary',
172
- disabled: formState.loading || ((_formState$result8 = formState.result) === null || _formState$result8 === void 0 ? void 0 : (_formState$result8$re = _formState$result8.result) === null || _formState$result8$re === void 0 ? void 0 : _formState$result8$re.length)
170
+ color: formState.loading || (_formState$result5 = formState.result) !== null && _formState$result5 !== void 0 && (_formState$result5$re = _formState$result5.result) !== null && _formState$result5$re !== void 0 && _formState$result5$re.length ? 'secondary' : 'primary',
171
+ disabled: formState.loading || ((_formState$result6 = formState.result) === null || _formState$result6 === void 0 ? void 0 : (_formState$result6$re = _formState$result6.result) === null || _formState$result6$re === void 0 ? void 0 : _formState$result6$re.length)
173
172
  }, !formState.loading ? t('CHANGE_PASSWORD', 'Change password') : t('LOADING', 'Loading')))) : /*#__PURE__*/_react.default.createElement(_styles.FormSide, null, /*#__PURE__*/_react.default.createElement("img", {
174
173
  src: theme === null || theme === void 0 ? void 0 : (_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$logos = _theme$images2.logos) === null || _theme$images2$logos === void 0 ? void 0 : _theme$images2$logos.logotype,
175
174
  alt: "Logo",
@@ -12,7 +12,7 @@ var AccordionSection = _styledComponents.default.div(_templateObject || (_templa
12
12
  exports.AccordionSection = AccordionSection;
13
13
  var Accordion = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"])));
14
14
  exports.Accordion = Accordion;
15
- var DropdownWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 10px;\n"])));
15
+ var DropdownWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 10px;\n\n > h4 {\n font-size: 16px;\n }\n"])));
16
16
  exports.DropdownWrapper = DropdownWrapper;
17
17
  var HoursWrappers = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-direction: column;\n\n p {\n margin: 0px 0px 10px 0px;\n }\n"])));
18
18
  exports.HoursWrappers = HoursWrappers;
@@ -292,7 +292,9 @@ var SingleOrderCardUI = function SingleOrderCardUI(props) {
292
292
  isBusinessesPage: isBusinessesPage
293
293
  }, !pastOrders && /*#__PURE__*/_react.default.createElement("h2", null, isSkeleton ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
294
294
  width: 50
295
- }) : parsePrice((order === null || order === void 0 ? void 0 : (_order$business15 = order.business) === null || _order$business15 === void 0 ? void 0 : _order$business15.length) > 1 ? order === null || order === void 0 ? void 0 : order.total : (order === null || order === void 0 ? void 0 : (_order$summary2 = order.summary) === null || _order$summary2 === void 0 ? void 0 : _order$summary2.total) || (order === null || order === void 0 ? void 0 : order.total)))), pastOrders && !isCustomerMode && /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, !isOrderReviewed && !isFavorite && (!(order !== null && order !== void 0 && order.review) || order.driver && !(order !== null && order !== void 0 && order.user_review)) && !hideReviewOrderButton && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
295
+ }) : parsePrice((order === null || order === void 0 ? void 0 : (_order$business15 = order.business) === null || _order$business15 === void 0 ? void 0 : _order$business15.length) > 1 ? order === null || order === void 0 ? void 0 : order.total : (order === null || order === void 0 ? void 0 : (_order$summary2 = order.summary) === null || _order$summary2 === void 0 ? void 0 : _order$summary2.total) || (order === null || order === void 0 ? void 0 : order.total)))), pastOrders && /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, {
296
+ isCustomerMode: isCustomerMode
297
+ }, !isOrderReviewed && !isFavorite && (!(order !== null && order !== void 0 && order.review) || order.driver && !(order !== null && order !== void 0 && order.user_review)) && !hideReviewOrderButton && !isCustomerMode && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
296
298
  outline: true,
297
299
  color: "primary",
298
300
  className: "review",
@@ -306,7 +308,7 @@ var SingleOrderCardUI = function SingleOrderCardUI(props) {
306
308
  onClick: function onClick() {
307
309
  return handleClickReorder(order);
308
310
  }
309
- }, cartState !== null && cartState !== void 0 && cartState.loading ? t('LOADING', 'Loading...') : t('REORDER', 'Reorder'))), !(order !== null && order !== void 0 && (_order$business16 = order.business) !== null && _order$business16 !== void 0 && _order$business16.length) && !hideFavorite && /*#__PURE__*/_react.default.createElement(_styles.FavoriteWrapper, {
311
+ }, cartState !== null && cartState !== void 0 && cartState.loading ? t('LOADING', 'Loading...') : t('REORDER', 'Reorder'))), !(order !== null && order !== void 0 && (_order$business16 = order.business) !== null && _order$business16 !== void 0 && _order$business16.length) && !hideFavorite && !isCustomerMode && /*#__PURE__*/_react.default.createElement(_styles.FavoriteWrapper, {
310
312
  onClick: function onClick() {
311
313
  return handleChangeFavorite(order);
312
314
  },
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.TitleContainer = exports.ReviewWrapper = exports.Price = exports.MultiLogosContainer = exports.Map = exports.Logo = exports.FavoriteWrapper = exports.Content = exports.Container = exports.ButtonWrapper = exports.BusinessLogoWrapper = void 0;
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _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; }
@@ -86,7 +86,10 @@ var BusinessLogoWrapper = function BusinessLogoWrapper(props) {
86
86
  }), props.children);
87
87
  };
88
88
  exports.BusinessLogoWrapper = BusinessLogoWrapper;
89
- var ButtonWrapper = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0px;\n top: 4px;\n display: flex;\n align-items: center;\n\n button {\n border-radius: 50px;\n font-size: 10px;\n line-height: 15px;\n padding: 4px 8px;\n border: 1px solid ", ";\n margin: 5px;\n\n &.reorder {\n background: ", ";\n &:hover {\n background: ", ";\n }\n }\n }\n"])), function (props) {
89
+ var ButtonWrapper = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0px;\n ", "\n display: flex;\n align-items: center;\n\n button {\n border-radius: 50px;\n font-size: 10px;\n line-height: 15px;\n padding: 4px 8px;\n border: 1px solid ", ";\n margin: 5px;\n\n &.reorder {\n background: ", ";\n &:hover {\n background: ", ";\n }\n }\n }\n"])), function (_ref14) {
90
+ var isCustomerMode = _ref14.isCustomerMode;
91
+ return isCustomerMode ? (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["bottom: 4px;"]))) : (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["top: 4px;"])));
92
+ }, function (props) {
90
93
  return props.theme.colors.primaryContrast;
91
94
  }, function (props) {
92
95
  return props.theme.colors.primaryContrast;
@@ -94,34 +97,34 @@ var ButtonWrapper = _styledComponents.default.div(_templateObject21 || (_templat
94
97
  return props.theme.colors.primary;
95
98
  });
96
99
  exports.ButtonWrapper = ButtonWrapper;
97
- var Logo = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n width: 55px;\n height: 55px;\n filter: drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.1));\n border-radius: 7.6px;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 7.6px;\n }\n\n @media (min-width: 480px){\n width: 86px;\n height: 86px;\n }\n"])));
100
+ var Logo = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n width: 55px;\n height: 55px;\n filter: drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.1));\n border-radius: 7.6px;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 7.6px;\n }\n\n @media (min-width: 480px){\n width: 86px;\n height: 86px;\n }\n"])));
98
101
  exports.Logo = Logo;
99
- var TitleContainer = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n"])));
102
+ var TitleContainer = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n"])));
100
103
  exports.TitleContainer = TitleContainer;
101
- var Map = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n width: 100%;\n height: ", ";\n min-height: ", ";\n img{\n width: 100%;\n height: 100%;\n border-top-left-radius: 16px;\n border-top-right-radius: 16px;\n border-radius: ", ";\n image-rendering: -webkit-optimize-contrast;\n object-fit: cover;\n }\n @media(min-width: 480px){\n height: ", ";\n min-height: ", "\n }\n"])), function (_ref14) {
102
- var isBusinessesPage = _ref14.isBusinessesPage;
103
- return isBusinessesPage ? '200px' : '88px';
104
- }, function (_ref15) {
104
+ var Map = _styledComponents.default.div(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n width: 100%;\n height: ", ";\n min-height: ", ";\n img{\n width: 100%;\n height: 100%;\n border-top-left-radius: 16px;\n border-top-right-radius: 16px;\n border-radius: ", ";\n image-rendering: -webkit-optimize-contrast;\n object-fit: cover;\n }\n @media(min-width: 480px){\n height: ", ";\n min-height: ", "\n }\n"])), function (_ref15) {
105
105
  var isBusinessesPage = _ref15.isBusinessesPage;
106
- return isBusinessesPage && '175px';
106
+ return isBusinessesPage ? '200px' : '88px';
107
107
  }, function (_ref16) {
108
108
  var isBusinessesPage = _ref16.isBusinessesPage;
109
- return isBusinessesPage && '16px';
109
+ return isBusinessesPage && '175px';
110
110
  }, function (_ref17) {
111
111
  var isBusinessesPage = _ref17.isBusinessesPage;
112
- return isBusinessesPage ? '200px' : '100px';
112
+ return isBusinessesPage && '16px';
113
113
  }, function (_ref18) {
114
114
  var isBusinessesPage = _ref18.isBusinessesPage;
115
+ return isBusinessesPage ? '200px' : '100px';
116
+ }, function (_ref19) {
117
+ var isBusinessesPage = _ref19.isBusinessesPage;
115
118
  return isBusinessesPage && '200px';
116
119
  });
117
120
  exports.Map = Map;
118
- var FavoriteWrapper = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n position: absolute;\n cursor: pointer;\n display: flex;\n z-index: 10;\n align-items: center;\n justify-content: center;\n top: 41px;\n right: 10px;\n ", "\n svg {\n color: ", ";\n font-size: 16px;\n }\n"])), function (props) {
119
- return props.theme.rtl && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n left: 10px;\n right: initial;\n "])));
121
+ var FavoriteWrapper = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n position: absolute;\n cursor: pointer;\n display: flex;\n z-index: 10;\n align-items: center;\n justify-content: center;\n top: 41px;\n right: 10px;\n ", "\n svg {\n color: ", ";\n font-size: 16px;\n }\n"])), function (props) {
122
+ return props.theme.rtl && (0, _styledComponents.css)(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n left: 10px;\n right: initial;\n "])));
120
123
  }, function (props) {
121
124
  return props.theme.colors.danger500;
122
125
  });
123
126
  exports.FavoriteWrapper = FavoriteWrapper;
124
- var ReviewWrapper = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n .review-sent {\n border-radius: 7.6px;\n }\n"])));
127
+ var ReviewWrapper = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n .review-sent {\n border-radius: 7.6px;\n }\n"])));
125
128
  exports.ReviewWrapper = ReviewWrapper;
126
- var MultiLogosContainer = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n p {\n white-space: nowrap;\n }\n"])));
129
+ var MultiLogosContainer = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n p {\n white-space: nowrap;\n }\n"])));
127
130
  exports.MultiLogosContainer = MultiLogosContainer;
@@ -53,7 +53,8 @@ var SingleProductCardUI = function SingleProductCardUI(props) {
53
53
  handleFavoriteProduct = props.handleFavoriteProduct,
54
54
  isFavorite = props.isFavorite,
55
55
  isPreviously = props.isPreviously,
56
- viewString = props.viewString;
56
+ viewString = props.viewString,
57
+ isCustomerMode = props.isCustomerMode;
57
58
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
58
59
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
59
60
  t = _useLanguage2[1];
@@ -179,7 +180,7 @@ var SingleProductCardUI = function SingleProductCardUI(props) {
179
180
  oneLine: isPreviously
180
181
  }, /*#__PURE__*/_react.default.createElement(_styles.TitleWrapper, null, !isSkeleton ? /*#__PURE__*/_react.default.createElement("h1", null, product === null || product === void 0 ? void 0 : product.name) : /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
181
182
  width: 100
182
- }), !useKioskApp && !isPreviously && (!isSkeleton ? /*#__PURE__*/_react.default.createElement("span", {
183
+ }), !useKioskApp && !isPreviously && isCustomerMode && (!isSkeleton ? /*#__PURE__*/_react.default.createElement("span", {
183
184
  onClick: function onClick() {
184
185
  return handleChangeFavorite();
185
186
  },
@@ -8,7 +8,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
8
  var _templateObject, _templateObject2;
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
10
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
11
- var TaxInformationContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n h2{\n font-size: 22px;\n margin: 10px;\n text-align: center;\n }\n"])));
11
+ var TaxInformationContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n h2{\n font-size: 22px;\n margin: 10px;\n text-align: center;\n }\n h3{\n font-size: 18px;\n }\n"])));
12
12
  exports.TaxInformationContainer = TaxInformationContainer;
13
13
  var ProductContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n > div{\n border: 1px solid #E9ECEF;\n cursor: initial;\n @media (min-width: 681px){\n width: calc(50% - 45px);\n }\n\n }\n"])));
14
14
  exports.ProductContainer = ProductContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "4.0.7",
3
+ "version": "5.0.0",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -87,7 +87,7 @@
87
87
  "lodash": "^4.17.19",
88
88
  "moment": "^2.29.4",
89
89
  "nanoid": "^4.0.0",
90
- "ordering-components-external": "3.0.2",
90
+ "ordering-components-external": "4.0.0",
91
91
  "payment": "^2.4.6",
92
92
  "polished": "^3.6.6",
93
93
  "react-bootstrap-icons": "^1.7.2",
@@ -4,7 +4,6 @@ import FiClock from '@meronex/icons/fi/FiClock'
4
4
  import GrLocation from '@meronex/icons/gr/GrLocation'
5
5
  import GrDeliver from '@meronex/icons/gr/GrDeliver'
6
6
  import FaStar from '@meronex/icons/fa/FaStar'
7
- import BsExclamationCircle from '@meronex/icons/bs/BsExclamationCircle'
8
7
  import { useTheme } from 'styled-components'
9
8
 
10
9
  import { Modal } from '../Modal'
@@ -152,16 +151,14 @@ export const BusinessBasicInformation = (props) => {
152
151
  )}
153
152
  </>
154
153
  )}
155
-
156
- {!loading && (
157
- <h5>
158
- <BsExclamationCircle
159
- className='popup'
160
- onClick={() => setOpenBusinessInformation(true)}
161
- />
162
- </h5>
163
- )}
164
154
  </div>
155
+ {!loading && (
156
+ <div className='information'>
157
+ <span onClick={() => setOpenBusinessInformation(true)}>
158
+ {t('INFORMATION', 'Information')}
159
+ </span>
160
+ </div>
161
+ )}
165
162
  </BusinessInfoItem>
166
163
  </BusinessInfo>
167
164
  </BusinessContent>
@@ -110,6 +110,7 @@ export const BusinessInfoItem = styled.div`
110
110
  display: flex;
111
111
  justify-content: space-between;
112
112
 
113
+
113
114
  h5 {
114
115
  font-weight: 300;
115
116
  svg{
@@ -156,6 +157,18 @@ export const BusinessInfoItem = styled.div`
156
157
  }
157
158
  }
158
159
 
160
+ &.information {
161
+ span {
162
+ user-select: none;
163
+ cursor: pointer;
164
+ font-size: 14px;
165
+ color: ${props => props.theme?.colors.primary};
166
+ &:hover {
167
+ text-decoration: underline;
168
+ }
169
+ }
170
+ }
171
+
159
172
  @media (min-width: 481px) {
160
173
  font-size: 16px;
161
174
  }
@@ -29,7 +29,6 @@ export const UserImage = styled.div`
29
29
 
30
30
  @media (min-width: 768px){
31
31
  width: auto;
32
- align-items: flex-end;
33
32
  }
34
33
  `
35
34
 
@@ -193,7 +193,7 @@ const AddressListUI = (props) => {
193
193
  <BeforeComponent key={i} {...props} />))}
194
194
  <AddressListContainer id='address_control' isLoading={actionStatus?.loading || orderState?.loading}>
195
195
  <AddressHalfContainer>
196
- <List halfWidth={addressOpen}>
196
+ <List halfWidth={addressOpen} isOpenUserData={isOpenUserData} isHeader={isHeader}>
197
197
  {
198
198
  (!isPopover || !addressOpen) && (
199
199
  <Button
@@ -294,7 +294,7 @@ const AddressListUI = (props) => {
294
294
  )}
295
295
  </List>
296
296
  {!isPopover && addressOpen && (
297
- <AddressFormContainer isOpenUserData={isOpenUserData} isHeader={isHeader}>
297
+ <AddressFormContainer>
298
298
  <TitleFormContainer>
299
299
  <CloseIcon>
300
300
  <MdClose onClick={() => handleCloseAddressForm()} />
@@ -196,17 +196,18 @@ export const AddressHalfContainer = styled.div`
196
196
  export const List = styled.div`
197
197
  width: ${({ halfWidth }) => halfWidth ? '50%' : '100%'};
198
198
  padding-right: 10px;
199
- button {
199
+ position: sticky;
200
+ right: 0;
201
+ top: 0;
202
+ margin-top: 222px;
203
+ button {
200
204
  width: 100%;
201
205
  }
202
206
  `
203
207
 
204
208
  export const AddressFormContainer = styled.div`
205
209
  width: 50%;
206
- position: sticky;
207
- right: 0;
208
- top: 0;
209
- margin-top: ${({ isOpenUserData, isHeader }) => isOpenUserData ? '-30px' : isHeader ? '-222px' : '-190px'};
210
+ z-index: 10;
210
211
  height: 100%;
211
212
  padding-left: 10px;
212
213
  `
@@ -157,7 +157,7 @@ const CheckoutUI = (props) => {
157
157
  if (userSelected && userSelected?.cellphone) {
158
158
  if (userSelected?.country_phone_code) {
159
159
  let phone = null
160
- phone = `+${userSelected?.country_phone_code}${userSelected?.cellphone}`
160
+ phone = `+${userSelected?.country_phone_code}${userSelected?.cellphone.replace(`+${userSelected?.country_phone_code}`, '')}`
161
161
  const phoneNumber = parsePhoneNumber(phone)
162
162
  if (!phoneNumber?.isValid()) {
163
163
  errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_INVALID', 'The field Phone number is invalid.'))
@@ -69,7 +69,6 @@ export const Header = (props) => {
69
69
  const [customerModalOpen, setCustomerModalOpen] = useState(false)
70
70
  const [modalSelected, setModalSelected] = useState(null)
71
71
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
72
- const [isFarAway, setIsFarAway] = useState(false)
73
72
  const [isOpenUserData, setIsOpenUserData] = useState(false)
74
73
  const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
75
74
  const [preorderBusiness, setPreorderBusiness] = useState(null)
@@ -148,25 +147,6 @@ export const Header = (props) => {
148
147
  }
149
148
  }, [JSON.stringify(orderState?.options?.address?.address)])
150
149
 
151
- useEffect(() => {
152
- if (!(pathname.includes('/search') || pathname.includes('/checkout'))) {
153
- setIsFarAway(false)
154
- return
155
- }
156
- navigator.geolocation.getCurrentPosition((pos) => {
157
- const crd = pos.coords
158
- const distance = getDistance(crd.latitude, crd.longitude, orderState?.options?.address?.location?.lat, orderState?.options?.address?.location?.lng)
159
- if (distance > 20) setIsFarAway(true)
160
- else setIsFarAway(false)
161
- }, (err) => {
162
- console.warn(`ERROR(${err.code}): ${err.message}`)
163
- }, {
164
- enableHighAccuracy: true,
165
- timeout: 5000,
166
- maximumAge: 0
167
- })
168
- }, [orderState?.options?.address?.location, pathname])
169
-
170
150
  return (
171
151
  <HeaderContainer>
172
152
  <InnerHeader>
@@ -187,16 +167,10 @@ export const Header = (props) => {
187
167
  {isShowOrderOptions && (
188
168
  <>
189
169
  <Menu className='left-header' id='center-side'>
190
- {windowSize.width > 820 && isFarAway && (
191
- <FarAwayMessage>
192
- <TiWarningOutline />
193
- <span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
194
- </FarAwayMessage>
195
- )}
196
170
  <AddressMenu
197
171
  onClick={(e) => handleClickUserCustomer(e)}
198
172
  >
199
- <GeoAlt /> {orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
173
+ <GeoAlt /> <span><p>{orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}</p></span>
200
174
  </AddressMenu>
201
175
  <Divider />
202
176
  {isCustomerMode && windowSize.width > 450 && (
@@ -317,12 +291,6 @@ export const Header = (props) => {
317
291
  {onlineStatus && isShowOrderOptions && (
318
292
  windowSize.width > 768 && windowSize.width <= 820 ? (
319
293
  <SubMenu>
320
- {isFarAway && (
321
- <FarAwayMessage>
322
- <TiWarningOutline />
323
- <span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
324
- </FarAwayMessage>
325
- )}
326
294
  <AddressMenu
327
295
  onClick={() => openModal('address')}
328
296
  >
@@ -340,12 +308,6 @@ export const Header = (props) => {
340
308
  </SubMenu>
341
309
  ) : (
342
310
  <SubMenu>
343
- {isFarAway && (
344
- <FarAwayMessage>
345
- <TiWarningOutline />
346
- <span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
347
- </FarAwayMessage>
348
- )}
349
311
  <HeaderOption
350
312
  variant='address'
351
313
  addressState={orderState?.options?.address?.address?.split(',')?.[0]}
@@ -417,7 +379,7 @@ export const Header = (props) => {
417
379
  padding='20px'
418
380
  hideCloseDefault
419
381
  >
420
- <UserEdit>
382
+ <UserEdit isOpenUserData={isOpenUserData}>
421
383
  <>
422
384
  <UserDetails
423
385
  isAddressFormOpen={isAddressFormOpen}
@@ -242,6 +242,7 @@ export const CustomerInfo = styled.div`
242
242
  align-items: center;
243
243
  margin: 0;
244
244
  p {
245
+ max-width: 250px;
245
246
  overflow: hidden;
246
247
  text-overflow: ellipsis;
247
248
  white-space: nowrap;
@@ -252,8 +253,6 @@ export const CustomerInfo = styled.div`
252
253
  color: #748194;
253
254
  margin: 0;
254
255
  font-size: 20px;
255
- position: absolute;
256
- right: 0;
257
256
  }
258
257
  }
259
258
  }
@@ -261,7 +260,11 @@ export const CustomerInfo = styled.div`
261
260
 
262
261
  export const UserEdit = styled.div`
263
262
  > :first-child{
264
- margin-bottom: 20px;
263
+ margin-bottom: 20px;
264
+ width: 100%;
265
+ ${props => !props.isOpenUserData && css`
266
+ position: absolute;
267
+ `
265
268
  }
266
269
  `
267
270