ordering-ui-external 10.1.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/_bundles/{0.ordering-ui.e9827c5566d8cce0eaa4.js → 0.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  2. package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  3. package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  4. package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  5. package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  6. package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  7. package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.8384f3801abcc340af2a.js} +2 -2
  8. package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  9. package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  10. package/_bundles/ordering-ui.8384f3801abcc340af2a.js +2 -0
  11. package/_modules/components/BusinessBasicInformation/index.js +7 -10
  12. package/_modules/components/OrderDetails/index.js +14 -17
  13. package/_modules/components/ProductItemAccordion/index.js +4 -5
  14. package/_modules/components/RenderProductsLayout/SearchProducts/index.js +2 -5
  15. package/_modules/components/UserFormDetails/index.js +7 -8
  16. package/_modules/components/UserProfileForm/ProfileOptions/index.js +4 -5
  17. package/_modules/components/UserProfileForm/index.js +10 -11
  18. package/_modules/contexts/ThemeContext/index.js +1 -1
  19. package/_modules/themes/five/src/components/AddressList/index.js +0 -3
  20. package/_modules/themes/five/src/components/BusinessController/index.js +11 -14
  21. package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
  22. package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
  23. package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
  25. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
  26. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
  27. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
  28. package/_modules/themes/five/src/components/Cart/index.js +17 -9
  29. package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
  30. package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
  31. package/_modules/themes/five/src/components/Checkout/index.js +3 -6
  32. package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
  33. package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
  34. package/_modules/themes/five/src/components/Favorite/index.js +4 -5
  35. package/_modules/themes/five/src/components/Footer/index.js +2 -3
  36. package/_modules/themes/five/src/components/Header/index.js +5 -8
  37. package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
  38. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
  39. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
  40. package/_modules/themes/five/src/components/Modal/styles.js +4 -2
  41. package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
  42. package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
  43. package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
  44. package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
  45. package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
  46. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
  47. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
  48. package/_modules/themes/five/src/components/PageBanner/index.js +75 -54
  49. package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
  50. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
  51. package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
  52. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
  53. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
  54. package/_modules/themes/five/src/components/UserFormDetails/index.js +3 -6
  55. package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
  56. package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
  57. package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
  58. package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
  59. package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
  60. package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
  61. package/package.json +2 -2
  62. package/src/components/BusinessBasicInformation/index.js +7 -8
  63. package/src/components/OrderDetails/index.js +14 -16
  64. package/src/components/ProductItemAccordion/index.js +4 -3
  65. package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
  66. package/src/components/UserFormDetails/index.js +6 -5
  67. package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
  68. package/src/components/UserProfileForm/index.js +10 -10
  69. package/src/contexts/ThemeContext/index.js +1 -1
  70. package/src/themes/five/src/components/AddressForm/index.js +1 -2
  71. package/src/themes/five/src/components/AddressList/index.js +1 -3
  72. package/src/themes/five/src/components/BusinessController/index.js +2 -4
  73. package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
  74. package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
  75. package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
  76. package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
  77. package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
  78. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
  79. package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
  80. package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
  81. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
  82. package/src/themes/five/src/components/Cart/index.js +11 -4
  83. package/src/themes/five/src/components/CartPopover/index.js +2 -3
  84. package/src/themes/five/src/components/CartPopover/styles.js +1 -1
  85. package/src/themes/five/src/components/Checkout/index.js +2 -4
  86. package/src/themes/five/src/components/Confirm/styles.js +1 -1
  87. package/src/themes/five/src/components/DatePicker/index.js +1 -0
  88. package/src/themes/five/src/components/Favorite/index.js +4 -3
  89. package/src/themes/five/src/components/Footer/index.js +3 -2
  90. package/src/themes/five/src/components/Header/index.js +4 -5
  91. package/src/themes/five/src/components/HeaderOption/index.js +4 -3
  92. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
  93. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
  94. package/src/themes/five/src/components/Modal/styles.js +1 -1
  95. package/src/themes/five/src/components/MomentContent/index.js +17 -8
  96. package/src/themes/five/src/components/MomentControl/index.js +83 -45
  97. package/src/themes/five/src/components/MomentControl/styles.js +137 -34
  98. package/src/themes/five/src/components/MyOrders/index.js +1 -1
  99. package/src/themes/five/src/components/OrderDetails/index.js +50 -21
  100. package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
  101. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
  102. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
  103. package/src/themes/five/src/components/PageBanner/index.js +64 -50
  104. package/src/themes/five/src/components/ProductForm/styles.js +1 -1
  105. package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
  106. package/src/themes/five/src/components/ProductOption/styles.js +1 -1
  107. package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
  108. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
  109. package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
  110. package/src/themes/five/src/components/UserPopover/index.js +3 -4
  111. package/src/themes/five/src/components/UserPopover/styles.js +1 -1
  112. package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
  113. package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
  114. package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
  115. package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
  116. package/template/app.js +15 -10
  117. package/template/components/HelmetTags/index.js +3 -2
  118. package/template/pages/AddressList/index.js +4 -3
  119. package/template/pages/BusinessProductsList/index.js +5 -4
  120. package/template/pages/BusinessesList/index.js +6 -6
  121. package/template/pages/Checkout/index.js +6 -4
  122. package/template/pages/Home/index.js +4 -2
  123. package/template/pages/MessagesList/index.js +5 -4
  124. package/template/pages/MyOrders/index.js +6 -5
  125. package/template/pages/OrderDetails/index.js +4 -3
  126. package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
  127. package/template/components/OrderingThemeUpdated/index.js +0 -41
  128. /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
  129. /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
@@ -13,6 +13,7 @@ var _FaStar = _interopRequireDefault(require("@meronex/icons/fa/FaStar"));
13
13
  var _orderingComponentsExternal = require("ordering-components-external");
14
14
  var _utils = require("../../../../../utils");
15
15
  var _styles = require("./styles");
16
+ var _styledComponents = require("styled-components");
16
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
19
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -23,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
23
24
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
25
  var types = ['food', 'laundry', 'alcohol', 'groceries'];
25
26
  var BusinessBasicInformation = function BusinessBasicInformation(props) {
26
- var _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderingTheme$theme$6, _orderingTheme$theme$7, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _orderingTheme$theme16, _orderingTheme$theme17, _orderingTheme$theme18, _orderingTheme$theme19, _orderingTheme$theme20, _orderingTheme$theme21, _orderingTheme$theme22, _orderingTheme$theme23, _orderingTheme$theme24, _orderingTheme$theme25, _orderingTheme$theme26, _orderingTheme$theme27, _orderingTheme$theme28, _orderingTheme$theme29, _orderingTheme$theme30, _orderingTheme$theme31, _orderingTheme$theme32, _orderingTheme$theme33, _props$beforeElements, _props$beforeComponen, _orderState$options, _business$reviews, _props$afterComponent, _props$afterElements;
27
+ var _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$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view7, _theme$business_view8, _theme$business_view9, _theme$business_view10, _theme$business_view11, _theme$business_view12, _theme$business_view13, _theme$business_view14, _theme$business_view15, _theme$business_view16, _theme$business_view17, _theme$business_view18, _theme$business_view19, _theme$business_view20, _theme$business_view21, _theme$business_view22, _theme$business_view23, _theme$business_view24, _theme$business_view25, _theme$business_view26, _theme$business_view27, _theme$business_view28, _theme$business_view29, _props$beforeElements, _props$beforeComponen, _orderState$options, _business$reviews, _props$afterComponent, _props$afterElements;
27
28
  var isSkeleton = props.isSkeleton,
28
29
  businessState = props.businessState;
29
30
  var business = businessState.business,
@@ -39,9 +40,7 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
39
40
  _useUtils2$ = _useUtils2[0],
40
41
  parsePrice = _useUtils2$.parsePrice,
41
42
  parseDistance = _useUtils2$.parseDistance;
42
- var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
43
- _useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
44
- orderingTheme = _useOrderingTheme2[0];
43
+ var theme = (0, _styledComponents.useTheme)();
45
44
  var getBusinessType = function getBusinessType() {
46
45
  if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
47
46
  var _types = [];
@@ -51,11 +50,11 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
51
50
  });
52
51
  return _types.join(', ');
53
52
  };
54
- var showDeliveryFee = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme = orderingTheme.theme) !== null && _orderingTheme$theme !== void 0 && (_orderingTheme$theme$ = _orderingTheme$theme.business_view) !== null && _orderingTheme$theme$ !== void 0 && (_orderingTheme$theme$2 = _orderingTheme$theme$.components) !== null && _orderingTheme$theme$2 !== void 0 && (_orderingTheme$theme$3 = _orderingTheme$theme$2.header) !== null && _orderingTheme$theme$3 !== void 0 && (_orderingTheme$theme$4 = _orderingTheme$theme$3.components) !== null && _orderingTheme$theme$4 !== void 0 && (_orderingTheme$theme$5 = _orderingTheme$theme$4.business) !== null && _orderingTheme$theme$5 !== void 0 && (_orderingTheme$theme$6 = _orderingTheme$theme$5.components) !== null && _orderingTheme$theme$6 !== void 0 && (_orderingTheme$theme$7 = _orderingTheme$theme$6.fee) !== null && _orderingTheme$theme$7 !== void 0 && _orderingTheme$theme$7.hidden);
55
- var showTime = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme2 = orderingTheme.theme) !== null && _orderingTheme$theme2 !== void 0 && (_orderingTheme$theme3 = _orderingTheme$theme2.business_view) !== null && _orderingTheme$theme3 !== void 0 && (_orderingTheme$theme4 = _orderingTheme$theme3.components) !== null && _orderingTheme$theme4 !== void 0 && (_orderingTheme$theme5 = _orderingTheme$theme4.header) !== null && _orderingTheme$theme5 !== void 0 && (_orderingTheme$theme6 = _orderingTheme$theme5.components) !== null && _orderingTheme$theme6 !== void 0 && (_orderingTheme$theme7 = _orderingTheme$theme6.business) !== null && _orderingTheme$theme7 !== void 0 && (_orderingTheme$theme8 = _orderingTheme$theme7.components) !== null && _orderingTheme$theme8 !== void 0 && (_orderingTheme$theme9 = _orderingTheme$theme8.time) !== null && _orderingTheme$theme9 !== void 0 && _orderingTheme$theme9.hidden);
56
- var showBusinessInfo = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme10 = orderingTheme.theme) !== null && _orderingTheme$theme10 !== void 0 && (_orderingTheme$theme11 = _orderingTheme$theme10.business_view) !== null && _orderingTheme$theme11 !== void 0 && (_orderingTheme$theme12 = _orderingTheme$theme11.components) !== null && _orderingTheme$theme12 !== void 0 && (_orderingTheme$theme13 = _orderingTheme$theme12.header) !== null && _orderingTheme$theme13 !== void 0 && (_orderingTheme$theme14 = _orderingTheme$theme13.components) !== null && _orderingTheme$theme14 !== void 0 && (_orderingTheme$theme15 = _orderingTheme$theme14.business) !== null && _orderingTheme$theme15 !== void 0 && (_orderingTheme$theme16 = _orderingTheme$theme15.components) !== null && _orderingTheme$theme16 !== void 0 && (_orderingTheme$theme17 = _orderingTheme$theme16.business_info) !== null && _orderingTheme$theme17 !== void 0 && _orderingTheme$theme17.hidden);
57
- var showReviews = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme18 = orderingTheme.theme) !== null && _orderingTheme$theme18 !== void 0 && (_orderingTheme$theme19 = _orderingTheme$theme18.business_view) !== null && _orderingTheme$theme19 !== void 0 && (_orderingTheme$theme20 = _orderingTheme$theme19.components) !== null && _orderingTheme$theme20 !== void 0 && (_orderingTheme$theme21 = _orderingTheme$theme20.header) !== null && _orderingTheme$theme21 !== void 0 && (_orderingTheme$theme22 = _orderingTheme$theme21.components) !== null && _orderingTheme$theme22 !== void 0 && (_orderingTheme$theme23 = _orderingTheme$theme22.business) !== null && _orderingTheme$theme23 !== void 0 && (_orderingTheme$theme24 = _orderingTheme$theme23.components) !== null && _orderingTheme$theme24 !== void 0 && (_orderingTheme$theme25 = _orderingTheme$theme24.reviews) !== null && _orderingTheme$theme25 !== void 0 && _orderingTheme$theme25.hidden);
58
- var showDistance = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme26 = orderingTheme.theme) !== null && _orderingTheme$theme26 !== void 0 && (_orderingTheme$theme27 = _orderingTheme$theme26.business_view) !== null && _orderingTheme$theme27 !== void 0 && (_orderingTheme$theme28 = _orderingTheme$theme27.components) !== null && _orderingTheme$theme28 !== void 0 && (_orderingTheme$theme29 = _orderingTheme$theme28.header) !== null && _orderingTheme$theme29 !== void 0 && (_orderingTheme$theme30 = _orderingTheme$theme29.components) !== null && _orderingTheme$theme30 !== void 0 && (_orderingTheme$theme31 = _orderingTheme$theme30.business) !== null && _orderingTheme$theme31 !== void 0 && (_orderingTheme$theme32 = _orderingTheme$theme31.components) !== null && _orderingTheme$theme32 !== void 0 && (_orderingTheme$theme33 = _orderingTheme$theme32.distance) !== null && _orderingTheme$theme33 !== void 0 && _orderingTheme$theme33.hidden);
53
+ var showDeliveryFee = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view$ = _theme$business_view.components) !== null && _theme$business_view$ !== void 0 && (_theme$business_view$2 = _theme$business_view$.header) !== null && _theme$business_view$2 !== void 0 && (_theme$business_view$3 = _theme$business_view$2.components) !== null && _theme$business_view$3 !== void 0 && (_theme$business_view$4 = _theme$business_view$3.business) !== null && _theme$business_view$4 !== void 0 && (_theme$business_view$5 = _theme$business_view$4.components) !== null && _theme$business_view$5 !== void 0 && (_theme$business_view$6 = _theme$business_view$5.fee) !== null && _theme$business_view$6 !== void 0 && _theme$business_view$6.hidden);
54
+ var showTime = !(theme !== null && theme !== void 0 && (_theme$business_view2 = theme.business_view) !== null && _theme$business_view2 !== void 0 && (_theme$business_view3 = _theme$business_view2.components) !== null && _theme$business_view3 !== void 0 && (_theme$business_view4 = _theme$business_view3.header) !== null && _theme$business_view4 !== void 0 && (_theme$business_view5 = _theme$business_view4.components) !== null && _theme$business_view5 !== void 0 && (_theme$business_view6 = _theme$business_view5.business) !== null && _theme$business_view6 !== void 0 && (_theme$business_view7 = _theme$business_view6.components) !== null && _theme$business_view7 !== void 0 && (_theme$business_view8 = _theme$business_view7.time) !== null && _theme$business_view8 !== void 0 && _theme$business_view8.hidden);
55
+ var showBusinessInfo = !(theme !== null && theme !== void 0 && (_theme$business_view9 = theme.business_view) !== null && _theme$business_view9 !== void 0 && (_theme$business_view10 = _theme$business_view9.components) !== null && _theme$business_view10 !== void 0 && (_theme$business_view11 = _theme$business_view10.header) !== null && _theme$business_view11 !== void 0 && (_theme$business_view12 = _theme$business_view11.components) !== null && _theme$business_view12 !== void 0 && (_theme$business_view13 = _theme$business_view12.business) !== null && _theme$business_view13 !== void 0 && (_theme$business_view14 = _theme$business_view13.components) !== null && _theme$business_view14 !== void 0 && (_theme$business_view15 = _theme$business_view14.business_info) !== null && _theme$business_view15 !== void 0 && _theme$business_view15.hidden);
56
+ var showReviews = !(theme !== null && theme !== void 0 && (_theme$business_view16 = theme.business_view) !== null && _theme$business_view16 !== void 0 && (_theme$business_view17 = _theme$business_view16.components) !== null && _theme$business_view17 !== void 0 && (_theme$business_view18 = _theme$business_view17.header) !== null && _theme$business_view18 !== void 0 && (_theme$business_view19 = _theme$business_view18.components) !== null && _theme$business_view19 !== void 0 && (_theme$business_view20 = _theme$business_view19.business) !== null && _theme$business_view20 !== void 0 && (_theme$business_view21 = _theme$business_view20.components) !== null && _theme$business_view21 !== void 0 && (_theme$business_view22 = _theme$business_view21.reviews) !== null && _theme$business_view22 !== void 0 && _theme$business_view22.hidden);
57
+ var showDistance = !(theme !== null && theme !== void 0 && (_theme$business_view23 = theme.business_view) !== null && _theme$business_view23 !== void 0 && (_theme$business_view24 = _theme$business_view23.components) !== null && _theme$business_view24 !== void 0 && (_theme$business_view25 = _theme$business_view24.header) !== null && _theme$business_view25 !== void 0 && (_theme$business_view26 = _theme$business_view25.components) !== null && _theme$business_view26 !== void 0 && (_theme$business_view27 = _theme$business_view26.business) !== null && _theme$business_view27 !== void 0 && (_theme$business_view28 = _theme$business_view27.components) !== null && _theme$business_view28 !== void 0 && (_theme$business_view29 = _theme$business_view28.distance) !== null && _theme$business_view29 !== void 0 && _theme$business_view29.hidden);
59
58
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
60
59
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
61
60
  key: i
@@ -17,7 +17,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
17
17
  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; } }
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
19
  var SearchProducts = function SearchProducts(props) {
20
- var _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderingTheme$theme$6, _orderingTheme$theme$7, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$defaultLanguag, _businessState$busine;
20
+ var _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$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$defaultLanguag, _businessState$busine;
21
21
  var handleChangeSearch = props.handleChangeSearch,
22
22
  searchValue = props.searchValue,
23
23
  businessState = props.businessState,
@@ -28,11 +28,8 @@ var SearchProducts = function SearchProducts(props) {
28
28
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
29
29
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
30
30
  t = _useLanguage2[1];
31
- var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
32
- _useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
33
- orderingTheme = _useOrderingTheme2[0];
34
- var showSort = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme = orderingTheme.theme) !== null && _orderingTheme$theme !== void 0 && (_orderingTheme$theme$ = _orderingTheme$theme.business_view) !== null && _orderingTheme$theme$ !== void 0 && (_orderingTheme$theme$2 = _orderingTheme$theme$.components) !== null && _orderingTheme$theme$2 !== void 0 && (_orderingTheme$theme$3 = _orderingTheme$theme$2.header) !== null && _orderingTheme$theme$3 !== void 0 && (_orderingTheme$theme$4 = _orderingTheme$theme$3.components) !== null && _orderingTheme$theme$4 !== void 0 && (_orderingTheme$theme$5 = _orderingTheme$theme$4.business) !== null && _orderingTheme$theme$5 !== void 0 && (_orderingTheme$theme$6 = _orderingTheme$theme$5.components) !== null && _orderingTheme$theme$6 !== void 0 && (_orderingTheme$theme$7 = _orderingTheme$theme$6.sort) !== null && _orderingTheme$theme$7 !== void 0 && _orderingTheme$theme$7.hidden);
35
- var searchLayout = theme === null || theme === void 0 ? void 0 : (_theme$business_view = theme.business_view) === null || _theme$business_view === void 0 ? void 0 : (_theme$business_view$ = _theme$business_view.components) === null || _theme$business_view$ === void 0 ? void 0 : (_theme$business_view$2 = _theme$business_view$.product_search) === null || _theme$business_view$2 === void 0 ? void 0 : (_theme$business_view$3 = _theme$business_view$2.components) === null || _theme$business_view$3 === void 0 ? void 0 : (_theme$business_view$4 = _theme$business_view$3.layout) === null || _theme$business_view$4 === void 0 ? void 0 : _theme$business_view$4.type;
31
+ var showSort = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view$ = _theme$business_view.components) !== null && _theme$business_view$ !== void 0 && (_theme$business_view$2 = _theme$business_view$.header) !== null && _theme$business_view$2 !== void 0 && (_theme$business_view$3 = _theme$business_view$2.components) !== null && _theme$business_view$3 !== void 0 && (_theme$business_view$4 = _theme$business_view$3.business) !== null && _theme$business_view$4 !== void 0 && (_theme$business_view$5 = _theme$business_view$4.components) !== null && _theme$business_view$5 !== void 0 && (_theme$business_view$6 = _theme$business_view$5.sort) !== null && _theme$business_view$6 !== void 0 && _theme$business_view$6.hidden);
32
+ var searchLayout = theme === null || theme === void 0 ? void 0 : (_theme$business_view2 = theme.business_view) === null || _theme$business_view2 === void 0 ? void 0 : (_theme$business_view3 = _theme$business_view2.components) === null || _theme$business_view3 === void 0 ? void 0 : (_theme$business_view4 = _theme$business_view3.product_search) === null || _theme$business_view4 === void 0 ? void 0 : (_theme$business_view5 = _theme$business_view4.components) === null || _theme$business_view5 === void 0 ? void 0 : (_theme$business_view6 = _theme$business_view5.layout) === null || _theme$business_view6 === void 0 ? void 0 : _theme$business_view6.type;
36
33
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_SearchBar.SearchBar, {
37
34
  onSearch: handleChangeSearch,
38
35
  search: searchValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -88,7 +88,7 @@
88
88
  "lodash": "^4.17.19",
89
89
  "moment": "^2.29.4",
90
90
  "nanoid": "^4.0.0",
91
- "ordering-components-external": "9.1.0",
91
+ "ordering-components-external": "9.2.0",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -9,7 +9,7 @@ import { useTheme } from 'styled-components'
9
9
  import { Modal } from '../Modal'
10
10
  import { BusinessInformation } from '../BusinessInformation'
11
11
 
12
- import { useUtils, useOrder, useLanguage, useOrderingTheme } from 'ordering-components-external'
12
+ import { useUtils, useOrder, useLanguage } from 'ordering-components-external'
13
13
 
14
14
  import { convertHoursToMinutes } from '../../utils'
15
15
 
@@ -37,7 +37,6 @@ export const BusinessBasicInformation = (props) => {
37
37
  const [orderState] = useOrder()
38
38
  const [, t] = useLanguage()
39
39
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils()
40
- const [orderingTheme] = useOrderingTheme()
41
40
 
42
41
  const getBusinessType = () => {
43
42
  if (Object.keys(business).length <= 0) return t('GENERAL', 'General')
@@ -48,12 +47,12 @@ export const BusinessBasicInformation = (props) => {
48
47
  return _types.join(', ')
49
48
  }
50
49
 
51
- const showLogo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
52
- const showDeliveryFee = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
53
- const showTime = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
54
- const showBusinessInfo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.business_info?.hidden
55
- const showReviews = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.reviews?.hidden
56
- const showDistance = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.distance?.hidden
50
+ const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
51
+ const showDeliveryFee = !theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
52
+ const showTime = !theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
53
+ const showBusinessInfo = !theme?.business_view?.components?.header?.components?.business?.components?.business_info?.hidden
54
+ const showReviews = !theme?.business_view?.components?.header?.components?.business?.components?.reviews?.hidden
55
+ const showDistance = !theme?.business_view?.components?.header?.components?.business?.components?.distance?.hidden
57
56
 
58
57
  return (
59
58
  <>
@@ -5,8 +5,7 @@ import {
5
5
  useEvent,
6
6
  useUtils,
7
7
  useConfig,
8
- GoogleMapsMap,
9
- useOrderingTheme
8
+ GoogleMapsMap
10
9
  } from 'ordering-components-external'
11
10
  import FiPhone from '@meronex/icons/fi/FiPhone'
12
11
  import FaUserCircle from '@meronex/icons/fa/FaUserCircle'
@@ -90,7 +89,6 @@ const OrderDetailsUI = (props) => {
90
89
  const theme = useTheme()
91
90
  const [events] = useEvent()
92
91
  const [{ parsePrice, parseNumber, parseDate }] = useUtils()
93
- const [orderingTheme] = useOrderingTheme()
94
92
  const [openMessages, setOpenMessages] = useState({ business: false, driver: false })
95
93
  const [isReviewOpen, setIsReviewOpen] = useState(false)
96
94
  const [isOrderReviewed, setIsOrderReviewed] = useState(false)
@@ -106,19 +104,19 @@ const OrderDetailsUI = (props) => {
106
104
 
107
105
  const isFromCheckPage = JSON.parse(window.localStorage.getItem('business-address'))
108
106
 
109
- const showDeliveryDate = !orderingTheme?.theme?.confirmation?.components?.order?.components?.date?.hidden
110
- const showDeliveryProgress = !orderingTheme?.theme?.confirmation?.components?.order?.components?.progress?.hidden
111
- const showBusinessMessages = !orderingTheme?.theme?.confirmation?.components?.business?.components?.messages?.hidden
112
- const showBusinessAddress = !orderingTheme?.theme?.confirmation?.components?.business?.components?.address?.hidden
113
- const showBusinessMap = !orderingTheme?.theme?.confirmation?.components?.business?.components?.map?.hidden
114
- const showBusinessLogo = !orderingTheme?.theme?.confirmation?.components?.business?.components?.logo?.hidden
115
- const showDriverName = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.name?.hidden
116
- const showDriverPhone = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.phone?.hidden
117
- const showDriverMessages = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.messages?.hidden
118
- const showDriverEmail = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.email?.hidden
119
- const showDriverPhoto = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.photo?.hidden
120
- const showCustomerAddress = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.address?.hidden
121
- const showCustomerPhoto = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.photo?.hidden
107
+ const showDeliveryDate = !theme?.confirmation?.components?.order?.components?.date?.hidden
108
+ const showDeliveryProgress = !theme?.confirmation?.components?.order?.components?.progress?.hidden
109
+ const showBusinessMessages = !theme?.confirmation?.components?.business?.components?.messages?.hidden
110
+ const showBusinessAddress = !theme?.confirmation?.components?.business?.components?.address?.hidden
111
+ const showBusinessMap = !theme?.confirmation?.components?.business?.components?.map?.hidden
112
+ const showBusinessLogo = !theme?.confirmation?.components?.business?.components?.logo?.hidden
113
+ const showDriverName = !theme?.confirmation?.components?.driver?.components?.name?.hidden
114
+ const showDriverPhone = !theme?.confirmation?.components?.driver?.components?.phone?.hidden
115
+ const showDriverMessages = !theme?.confirmation?.components?.driver?.components?.messages?.hidden
116
+ const showDriverEmail = !theme?.confirmation?.components?.driver?.components?.email?.hidden
117
+ const showDriverPhoto = !theme?.confirmation?.components?.driver?.components?.photo?.hidden
118
+ const showCustomerAddress = !theme?.confirmation?.components?.customer?.components?.address?.hidden
119
+ const showCustomerPhoto = !theme?.confirmation?.components?.customer?.components?.photo?.hidden
122
120
 
123
121
  const getOrderStatus = (s) => {
124
122
  const status = parseInt(s)
@@ -2,7 +2,7 @@ import React, { useState, useRef } from 'react'
2
2
  import TiPencil from '@meronex/icons/ti/TiPencil'
3
3
  import IosArrowDown from '@meronex/icons/ios/IosArrowDown'
4
4
  import VscTrash from '@meronex/icons/vsc/VscTrash'
5
- import { useUtils, useLanguage, useOrder, useOrderingTheme } from 'ordering-components-external'
5
+ import { useUtils, useLanguage, useOrder } from 'ordering-components-external'
6
6
  import { useWindowSize } from '../../hooks/useWindowSize'
7
7
 
8
8
  import {
@@ -25,6 +25,7 @@ import {
25
25
  ProductOptionsList,
26
26
  ProductQuantity
27
27
  } from './styles'
28
+ import { useTheme } from 'styled-components'
28
29
 
29
30
  export const ProductItemAccordion = (props) => {
30
31
  const {
@@ -40,8 +41,8 @@ export const ProductItemAccordion = (props) => {
40
41
  const [, t] = useLanguage()
41
42
  const [orderState] = useOrder()
42
43
  const [{ parsePrice }] = useUtils()
44
+ const theme = useTheme()
43
45
  const windowSize = useWindowSize()
44
- const [orderingTheme] = useOrderingTheme()
45
46
  const [setActive, setActiveState] = useState('')
46
47
  const [setHeight, setHeightState] = useState('0px')
47
48
  const [setRotate, setRotateState] = useState('accordion__icon')
@@ -51,7 +52,7 @@ export const ProductItemAccordion = (props) => {
51
52
  const productActionsEdit = useRef(null)
52
53
  const productActionsDelete = useRef(null)
53
54
 
54
- const showProductImage = !orderingTheme?.theme?.confirmation?.components?.cart?.components?.products?.components?.image?.hidden
55
+ const showProductImage = !theme?.confirmation?.components?.cart?.components?.products?.components?.image?.hidden
55
56
 
56
57
  const productInfo = () => {
57
58
  if (isCartProduct) {
@@ -3,7 +3,7 @@ import React from 'react'
3
3
  import { Select } from '../../../styles/Select'
4
4
  import { SearchBar } from '../../SearchBar'
5
5
  import { useTheme } from 'styled-components'
6
- import { useLanguage, useOrderingTheme } from 'ordering-components-external'
6
+ import { useLanguage } from 'ordering-components-external'
7
7
 
8
8
  export const SearchProducts = (props) => {
9
9
  const {
@@ -17,8 +17,7 @@ export const SearchProducts = (props) => {
17
17
 
18
18
  const theme = useTheme()
19
19
  const [, t] = useLanguage()
20
- const [orderingTheme] = useOrderingTheme()
21
- const showSort = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
20
+ const showSort = !theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
22
21
 
23
22
  return (
24
23
  <>
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState, useRef } from 'react'
2
2
  import Skeleton from 'react-loading-skeleton'
3
- import { useSession, useLanguage, useCustomer, useOrderingTheme } from 'ordering-components-external'
3
+ import { useSession, useLanguage, useCustomer } from 'ordering-components-external'
4
4
  import { useForm } from 'react-hook-form'
5
5
  import parsePhoneNumber from 'libphonenumber-js'
6
6
 
@@ -11,6 +11,7 @@ import { Button } from '../../styles/Buttons'
11
11
  import { InputPhoneNumber } from '../InputPhoneNumber'
12
12
  import { Alert } from '../Confirm'
13
13
  import { sortInputFields } from '../../utils'
14
+ import { useTheme } from 'styled-components'
14
15
 
15
16
  export const UserFormDetailsUI = (props) => {
16
17
  const {
@@ -33,11 +34,11 @@ export const UserFormDetailsUI = (props) => {
33
34
  const formMethods = useForm()
34
35
  const [, t] = useLanguage()
35
36
  const [{ user: userSession }] = useSession()
37
+ const theme = useTheme()
36
38
  const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
37
39
  const [userPhoneNumber, setUserPhoneNumber] = useState(null)
38
40
  const [alertState, setAlertState] = useState({ open: false, content: [] })
39
41
  const [, { setUserCustomer }] = useCustomer()
40
- const [orderingTheme] = useOrderingTheme()
41
42
  const emailInput = useRef(null)
42
43
 
43
44
  const user = userData || userSession
@@ -51,8 +52,8 @@ export const UserFormDetailsUI = (props) => {
51
52
  }
52
53
 
53
54
  const showInputPhoneNumber = validationFields?.fields?.checkout?.cellphone?.enabled ?? false
54
- const showCustomerCellphone = !orderingTheme?.theme?.profile?.components?.cellphone?.hidden
55
- const showCustomerPassword = !orderingTheme?.theme?.profile?.components?.password?.hidden
55
+ const showCustomerCellphone = !theme?.profile?.components?.cellphone?.hidden
56
+ const showCustomerPassword = !theme?.profile?.components?.password?.hidden
56
57
 
57
58
  const setUserCellPhone = (isEdit = false) => {
58
59
  if (userPhoneNumber && !userPhoneNumber.includes('null') && !isEdit) {
@@ -159,7 +160,7 @@ export const UserFormDetailsUI = (props) => {
159
160
  }
160
161
 
161
162
  const showFieldWithTheme = (name) => {
162
- return !orderingTheme?.theme?.profile?.components?.[name]?.hidden
163
+ return !theme?.profile?.components?.[name]?.hidden
163
164
  }
164
165
 
165
166
  useEffect(() => {
@@ -4,15 +4,15 @@ import { Tabs, Tab } from '../../../styles/Tabs'
4
4
  import BsPerson from '@meronex/icons/bs/BsPerson'
5
5
  import AiOutlineUnorderedList from '@meronex/icons/ai/AiOutlineUnorderedList'
6
6
  import FaAddressBook from '@meronex/icons/fa/FaAddressBook';
7
- import { useEvent, useLanguage, useOrderingTheme } from 'ordering-components-external'
7
+ import { useEvent, useLanguage } from 'ordering-components-external'
8
+ import { useTheme } from 'styled-components'
8
9
 
9
10
  export const ProfileOptions = ({ value }) => {
10
11
  const [tabValue] = useState(value)
11
12
  const [, t] = useLanguage()
12
13
  const [events] = useEvent()
13
- const [orderingTheme] = useOrderingTheme()
14
-
15
- const showAddressListTab = orderingTheme?.theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
14
+ const theme = useTheme()
15
+ const showAddressListTab = theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
16
16
 
17
17
  const handleGoToPage = (data) => {
18
18
  events.emit('go_to_page', data)
@@ -5,8 +5,7 @@ import {
5
5
  useLanguage,
6
6
  useSession,
7
7
  DragAndDrop,
8
- ExamineClick,
9
- useOrderingTheme
8
+ ExamineClick
10
9
  } from 'ordering-components-external'
11
10
 
12
11
  import { useWindowSize } from '../../hooks/useWindowSize'
@@ -37,6 +36,7 @@ import {
37
36
  WrapperForm
38
37
  } from './styles'
39
38
  import { LogoutButton } from '../LogoutButton'
39
+ import { useTheme } from 'styled-components'
40
40
 
41
41
  const UserProfileFormUI = (props) => {
42
42
  const {
@@ -52,18 +52,18 @@ const UserProfileFormUI = (props) => {
52
52
  const [, t] = useLanguage()
53
53
  const [{ user }] = useSession()
54
54
  const [edit, setEdit] = useState(false)
55
+ const theme = useTheme()
55
56
  const [alertState, setAlertState] = useState({ open: false, content: [] })
56
57
  const inputRef = useRef(null)
57
- const [orderingTheme] = useOrderingTheme()
58
58
  const windowSize = useWindowSize()
59
59
 
60
- const showCustomerPicture = !orderingTheme?.theme?.profile?.components?.picture?.hidden
61
- const showCustomerName = !orderingTheme?.theme?.profile?.components?.name?.hidden
62
- const showCustomerLastName = !orderingTheme?.theme?.profile?.components?.last_name?.hidden
63
- const showCustomerEmail = !orderingTheme?.theme?.profile?.components?.email?.hidden
64
- const showCustomerCellphone = !orderingTheme?.theme?.profile?.components?.cellphone?.hidden
65
- const showAddressList = !orderingTheme?.theme?.profile?.components?.address_list?.hidden
66
- const userFormLayoutColumn = orderingTheme?.theme?.profile?.components?.layout?.position === 'column'
60
+ const showCustomerPicture = !theme?.profile?.components?.picture?.hidden
61
+ const showCustomerName = !theme?.profile?.components?.name?.hidden
62
+ const showCustomerLastName = !theme?.profile?.components?.last_name?.hidden
63
+ const showCustomerEmail = !theme?.profile?.components?.email?.hidden
64
+ const showCustomerCellphone = !theme?.profile?.components?.cellphone?.hidden
65
+ const showAddressList = !theme?.profile?.components?.address_list?.hidden
66
+ const userFormLayoutColumn = theme?.profile?.components?.layout?.position === 'column'
67
67
  const showEditButton = showCustomerName || showCustomerLastName || showCustomerEmail || showCustomerCellphone
68
68
 
69
69
  const handleFiles = (files) => {
@@ -70,7 +70,7 @@ export const ThemeProvider = ({ children, ...props }) => {
70
70
  input, textarea, button {
71
71
  font-family: inherit;
72
72
  }
73
- h1,p,span {
73
+ h1,h2,p,span {
74
74
  ${props.isDarkTextColor && css`
75
75
  color: ${theme.colors.darkTextColor}
76
76
  `}
@@ -16,8 +16,7 @@ import {
16
16
  GoogleMapsMap,
17
17
  useSession,
18
18
  useOrder,
19
- useConfig,
20
- useOrderingTheme
19
+ useConfig
21
20
  } from 'ordering-components-external'
22
21
  import { Alert } from '../Confirm'
23
22
  import { GoogleGpsButton } from '../../../../../components/GoogleGpsButton'
@@ -19,8 +19,7 @@ import {
19
19
  useLanguage,
20
20
  useOrder,
21
21
  useCustomer,
22
- useEvent,
23
- useOrderingTheme
22
+ useEvent
24
23
  } from 'ordering-components-external'
25
24
 
26
25
  import {
@@ -76,7 +75,6 @@ const AddressListUI = (props) => {
76
75
  const [addressOpen, setAddressOpen] = useState(false)
77
76
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
78
77
  const theme = useTheme()
79
- const [orderingTheme] = useOrderingTheme()
80
78
  const [{ user }] = useCustomer()
81
79
  const { width } = useWindowSize()
82
80
  const isCompletedLayout = width < 769 || isProfile
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useRef } from 'react'
2
- import { useLanguage, useUtils, useOrder, useConfig, useSession, useOrderingTheme, BusinessController as BusinessSingleCard } from 'ordering-components-external'
2
+ import { useLanguage, useUtils, useOrder, useConfig, useSession, BusinessController as BusinessSingleCard } from 'ordering-components-external'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { Heart as DisLike, HeartFill as Like } from 'react-bootstrap-icons'
5
5
  import { useTheme } from 'styled-components'
@@ -73,14 +73,12 @@ const BusinessControllerUI = (props) => {
73
73
  const [{ auth }, { login }] = useSession()
74
74
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils()
75
75
  const [orderState] = useOrder()
76
- const [orderingTheme] = useOrderingTheme()
77
76
  const [alertState, setAlertState] = useState({ open: false, content: [] })
78
77
  const [isModalOpen, setIsModalOpen] = useState(false)
79
78
  const [modalPageToShow, setModalPageToShow] = useState(null)
80
79
 
81
80
  const favoriteRef = useRef(null)
82
-
83
- const businessRows = orderingTheme?.theme?.business_listing_view?.components?.layout?.rows
81
+ const businessRows = theme?.business_listing_view?.components?.layout?.rows
84
82
  const hideBusinessLogo = theme?.business_listing_view?.components?.business?.components?.logo?.hidden
85
83
  const hideBusinessFee = theme?.business_listing_view?.components?.business?.components?.fee?.hidden
86
84
  const hideBusinessTime = theme?.business_listing_view?.components?.business?.components?.time?.hidden
@@ -4,8 +4,7 @@ import {
4
4
  BusinessInformation as BusinessInformationController,
5
5
  GoogleMapsMap,
6
6
  useLanguage,
7
- useConfig,
8
- useOrderingTheme
7
+ useConfig
9
8
  } from 'ordering-components-external'
10
9
  import { Modal } from '../Modal'
11
10
  import {
@@ -11,7 +11,7 @@ export const BussinessTitle = styled.div`
11
11
  z-index: 1000;
12
12
  display: inline-flex;
13
13
  width: 50%;
14
- background: #ffffff;
14
+ background: ${(props) => props.theme?.colors?.backgroundPage};
15
15
  align-items: center;
16
16
  margin-left: 10px;
17
17
  margin-bottom: 10px;
@@ -76,7 +76,7 @@ export const Information = styled.div`
76
76
 
77
77
  export const BusinessContent = styled.div`
78
78
  padding: 0 10px;
79
- background: #FFF;
79
+ background: ${props => props.theme.colors.backgroundPage};
80
80
  @media(min-width: 768px){
81
81
  padding: 0 20px;
82
82
  padding-top: 30px;
@@ -34,7 +34,9 @@ import {
34
34
  Day,
35
35
  DayName,
36
36
  DayNumber,
37
- ClosedBusinessMsg
37
+ ClosedBusinessMsg,
38
+ CheckIcon,
39
+ CheckedIcon
38
40
  } from './styles'
39
41
  import { BusinessMenuList } from '../BusinessMenuList'
40
42
  import { Swiper, SwiperSlide } from 'swiper/react'
@@ -44,6 +46,7 @@ import SwiperCore, {
44
46
  import 'swiper/swiper-bundle.min.css'
45
47
  import 'swiper/swiper.min.css'
46
48
  import { getTimes } from '../../../../../utils'
49
+ import CgRadioCheck from '@meronex/icons/cg/CgRadioCheck'
47
50
 
48
51
  SwiperCore.use([Navigation])
49
52
 
@@ -61,11 +64,15 @@ const BusinessPreorderUI = (props) => {
61
64
  handleAsap,
62
65
  isProfessional,
63
66
  isDisabled,
64
- maxDays
67
+ maxDays,
68
+ hoursList,
69
+ cateringPreorder,
70
+ preorderLeadTime,
71
+ getActualSchedule
65
72
  } = props
66
73
 
67
74
  const { pathname } = useLocation()
68
- const [{ optimizeImage }] = useUtils()
75
+ const [{ optimizeImage, parseTime }] = useUtils()
69
76
  const theme = useTheme()
70
77
  const [{ configs }] = useConfig()
71
78
  const [orderState] = useOrder()
@@ -124,17 +131,51 @@ const BusinessPreorderUI = (props) => {
124
131
  }
125
132
 
126
133
  useEffect(() => {
127
- const selectedMenu = menu ? (menu?.use_business_schedule ? business : menu) : business
128
- const _times = getTimeList(dateSelected, selectedMenu)
129
- setTimeList(_times)
130
- }, [dateSelected, menu, business])
134
+ if (cateringPreorder) {
135
+ const schedule = business && getActualSchedule()
136
+ if (!schedule && cateringPreorder && Object.keys(business)?.length > 0) {
137
+ setIsEnabled(false)
138
+ return
139
+ }
140
+ const _timeLists = hoursList
141
+ .filter(hour => (Object.keys(business || {})?.length === 0 || schedule?.lapses?.some(lapse =>
142
+ moment(dateSelected + ` ${hour.startTime}`) >= moment(dateSelected + ` ${lapse.open.hour}:${lapse.open.minute}`).add(preorderLeadTime, 'minutes') && moment(dateSelected + ` ${hour.endTime}`) <= moment(dateSelected + ` ${lapse.close.hour}:${lapse.close.minute}`))) &&
143
+ moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`) &&
144
+ (moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder))
145
+ .map(hour => {
146
+ return {
147
+ value: hour.startTime,
148
+ text: is12Hours ? (
149
+ hour.startTime.includes('12')
150
+ ? `${hour.startTime}PM`
151
+ : parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
152
+ ) : (
153
+ parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
154
+ ),
155
+ endText: is12Hours ? (
156
+ hour.endTime.includes('12')
157
+ ? `${hour.endTime}PM`
158
+ : parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'hh:mma' })
159
+ ) : (
160
+ parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'HH:mm' })
161
+ )
162
+ }
163
+ })
164
+ setIsEnabled(true)
165
+ setTimeList(_timeLists)
166
+ } else {
167
+ const selectedMenu = menu ? (menu?.use_business_schedule ? business : menu) : business
168
+ const _times = getTimeList(dateSelected, selectedMenu)
169
+ setTimeList(_times)
170
+ }
171
+ }, [dateSelected, menu, business, cateringPreorder, hoursList])
131
172
 
132
173
  useEffect(() => {
133
174
  if (type === 'business_hours') setMenu(null)
134
175
  }, [type])
135
176
 
136
177
  useEffect(() => {
137
- if (pathname.includes('store') || isProfessional) return
178
+ if (pathname.includes('store') || isProfessional || cateringPreorder) return
138
179
  handleAsap && handleAsap()
139
180
  }, [])
140
181
 
@@ -147,7 +188,7 @@ const BusinessPreorderUI = (props) => {
147
188
  <p>{business.name}</p>
148
189
  </LogoWrapper>
149
190
  )}
150
- {!isProfessional && isPreOrderSetting && (
191
+ {!isProfessional && isPreOrderSetting && !cateringPreorder && (
151
192
  <PreorderTypeWrapper>
152
193
  <p>{t('PREORDER_TYPE', 'Preorder type')}</p>
153
194
  <SelectWrapper>
@@ -232,8 +273,18 @@ const BusinessPreorderUI = (props) => {
232
273
  isDisabled={isDisabled}
233
274
  isProfessional={isProfessional}
234
275
  busyTime={isProfessional && isBusyTime(business, getMomentTime(time.value))}
276
+ cateringPreorder={cateringPreorder}
235
277
  >
236
- <span>{time.text}</span>
278
+ <span>
279
+ {cateringPreorder && (
280
+ <CheckIcon>
281
+ {timeSelected === time.value ? <CheckedIcon cateringPreorder={cateringPreorder} /> : <CgRadioCheck />}
282
+ </CheckIcon>
283
+ )}
284
+ <p>
285
+ {time.text} {cateringPreorder && `- ${time.endText}`}
286
+ </p>
287
+ </span>
237
288
  </TimeItem>
238
289
  ))}
239
290
  </>