ordering-ui-external 1.1.7 → 1.2.1

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 (65) hide show
  1. package/_bundles/{0.ordering-ui.ff2158785c5abf7d9a26.js → 0.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  2. package/_bundles/{1.ordering-ui.ff2158785c5abf7d9a26.js → 1.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  3. package/_bundles/{3.ordering-ui.ff2158785c5abf7d9a26.js → 3.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  4. package/_bundles/{4.ordering-ui.ff2158785c5abf7d9a26.js → 4.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  5. package/_bundles/{5.ordering-ui.ff2158785c5abf7d9a26.js → 5.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  6. package/_bundles/{6.ordering-ui.ff2158785c5abf7d9a26.js → 6.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  7. package/_bundles/{7.ordering-ui.ff2158785c5abf7d9a26.js → 7.ordering-ui.5a3714c3be025beef39b.js} +1 -1
  8. package/_bundles/{7.ordering-ui.ff2158785c5abf7d9a26.js.LICENSE.txt → 7.ordering-ui.5a3714c3be025beef39b.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.ff2158785c5abf7d9a26.js → 8.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  10. package/_bundles/{9.ordering-ui.ff2158785c5abf7d9a26.js → 9.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  11. package/_bundles/ordering-ui.5a3714c3be025beef39b.js +2 -0
  12. package/_bundles/{ordering-ui.ff2158785c5abf7d9a26.js.LICENSE.txt → ordering-ui.5a3714c3be025beef39b.js.LICENSE.txt} +0 -0
  13. package/_modules/themes/five/index.js +8 -0
  14. package/_modules/themes/five/src/components/BusinessInformation/styles.js +2 -2
  15. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +5 -3
  16. package/_modules/themes/five/src/components/Cart/index.js +14 -3
  17. package/_modules/themes/five/src/components/Cart/styles.js +9 -3
  18. package/_modules/themes/five/src/components/Checkout/index.js +1 -10
  19. package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
  20. package/_modules/themes/five/src/components/Modal/styles.js +1 -1
  21. package/_modules/themes/five/src/components/MomentControl/styles.js +1 -1
  22. package/_modules/themes/five/src/components/MultiCheckout/index.js +4 -0
  23. package/_modules/themes/five/src/components/OrderItAgain/index.js +60 -0
  24. package/_modules/themes/five/src/components/OrderItAgain/styles.js +46 -0
  25. package/_modules/themes/five/src/components/ProductForm/index.js +5 -0
  26. package/_modules/themes/five/src/components/ProfessionalFilter/index.js +4 -2
  27. package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +20 -8
  28. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +16 -3
  29. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +27 -24
  30. package/_modules/themes/five/src/components/ReviewProduct/styles.js +6 -6
  31. package/_modules/themes/five/src/components/ServiceForm/index.js +5 -7
  32. package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -5
  33. package/_modules/themes/five/src/components/SidebarMenu/index.js +13 -2
  34. package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -3
  35. package/_modules/themes/five/src/components/SingleProductCard/index.js +15 -7
  36. package/_modules/themes/five/src/components/SingleProductCard/styles.js +60 -48
  37. package/_modules/themes/four/src/components/BusinessBasicInformation/index.js +1 -1
  38. package/package.json +1 -1
  39. package/src/themes/five/index.js +2 -0
  40. package/src/themes/five/src/components/BusinessInformation/styles.js +3 -3
  41. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -2
  42. package/src/themes/five/src/components/Cart/index.js +37 -2
  43. package/src/themes/five/src/components/Cart/styles.js +17 -0
  44. package/src/themes/five/src/components/Checkout/index.js +1 -5
  45. package/src/themes/five/src/components/Checkout/styles.js +5 -1
  46. package/src/themes/five/src/components/Modal/styles.js +5 -0
  47. package/src/themes/five/src/components/MomentControl/index.js +48 -48
  48. package/src/themes/five/src/components/MomentControl/styles.js +0 -1
  49. package/src/themes/five/src/components/MultiCheckout/index.js +2 -0
  50. package/src/themes/five/src/components/OrderItAgain/index.js +46 -0
  51. package/src/themes/five/src/components/OrderItAgain/styles.js +60 -0
  52. package/src/themes/five/src/components/ProductForm/index.js +1 -0
  53. package/src/themes/five/src/components/ProfessionalFilter/index.js +10 -2
  54. package/src/themes/five/src/components/ProfessionalFilter/styles.js +24 -9
  55. package/src/themes/five/src/components/RenderProductsLayout/index.js +17 -1
  56. package/src/themes/five/src/components/RenderProductsLayout/styles.js +5 -2
  57. package/src/themes/five/src/components/ReviewProduct/styles.js +14 -0
  58. package/src/themes/five/src/components/ServiceForm/index.js +31 -22
  59. package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
  60. package/src/themes/five/src/components/SidebarMenu/index.js +32 -1
  61. package/src/themes/five/src/components/SingleOrderCard/index.js +1 -2
  62. package/src/themes/five/src/components/SingleProductCard/index.js +9 -5
  63. package/src/themes/five/src/components/SingleProductCard/styles.js +21 -7
  64. package/src/themes/four/src/components/BusinessBasicInformation/index.js +15 -17
  65. package/_bundles/ordering-ui.ff2158785c5abf7d9a26.js +0 -2
@@ -5,13 +5,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.WrapLogo = exports.TitleWrapper = exports.SoldOut = exports.SkeletonCardLogo = exports.SkeletonCardInfo = exports.RibbonBox = exports.QuantityContainer = exports.PriceWrapper = exports.CardLogo = exports.CardInfo = exports.CardContainer = void 0;
8
+ exports.WrapLogo = exports.TitleWrapper = exports.SoldOut = exports.SkeletonCardLogo = exports.SkeletonCardInfo = exports.RibbonBox = exports.QuantityContainer = exports.PriceWrapper = exports.LastOrder = exports.CardLogo = exports.CardInfo = exports.CardContainer = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
13
 
14
- 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;
14
+ 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, _templateObject31, _templateObject32;
15
15
 
16
16
  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); }
17
17
 
@@ -23,65 +23,71 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
23
23
 
24
24
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
25
25
 
26
- var CardContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-height: 162px;\n max-height: 162px;\n background: ", ";\n border: 1px solid #E9ECEF;\n padding: 10px;\n border-radius: 7.6px;\n box-sizing: border-box;\n cursor: pointer;\n position: relative;\n > div {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n button {\n width: 100%;\n margin-top: 10px;\n }\n ", "\n"])), function (_ref) {
27
- var soldOut = _ref.soldOut;
28
- return soldOut ? '#6c757d33' : '#FFF';
26
+ var CardContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n background: ", ";\n border: 1px solid #E9ECEF;\n padding: 10px;\n border-radius: 7.6px;\n box-sizing: border-box;\n cursor: pointer;\n position: relative;\n > div {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n button {\n width: 100%;\n margin-top: 10px;\n }\n ", "\n"])), function (_ref) {
27
+ var isShowAddButt = _ref.isShowAddButt;
28
+ return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-height: ", ";\n max-height: ", ";\n "])), isShowAddButt ? '162px' : '110px', isShowAddButt ? '162px' : '110px');
29
29
  }, function (_ref2) {
30
- var productsRows = _ref2.productsRows;
31
- return productsRows ? (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", ";\n margin: 10px;\n "])), function () {
32
- return productsRows === 3 ? 'calc(33% - 40px)' : 'calc(50% - 40px)';
33
- }) : (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px 0px;\n @media (min-width: 576px) {\n margin: 10px;\n width: calc(100% - 40px);\n }\n ", "\n \n "])), function (_ref3) {
34
- var isCartOnProductsList = _ref3.isCartOnProductsList;
35
- return isCartOnProductsList ? (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n @media (min-width: 993px) {\n width: calc(50% - 40px);\n margin: 10px 20px 10px 0px;\n ", "\n }\n "])), function (props) {
30
+ var soldOut = _ref2.soldOut;
31
+ return soldOut ? '#6c757d33' : '#FFF';
32
+ }, function (_ref3) {
33
+ var productsRows = _ref3.productsRows;
34
+ return productsRows ? (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n margin: 10px;\n "])), function () {
35
+ return productsRows === 3 ? 'calc(33% - 20px)' : 'calc(50% - 20px)';
36
+ }) : (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px 0px;\n @media (min-width: 576px) {\n margin: 10px;\n width: calc(100% - 20px);\n }\n ", "\n \n "])), function (_ref4) {
37
+ var isCartOnProductsList = _ref4.isCartOnProductsList;
38
+ return isCartOnProductsList ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n @media (min-width: 993px) {\n width: calc(50% - 20px);\n margin: 10px 20px 10px 0px;\n ", "\n }\n "])), function (props) {
36
39
  var _props$theme;
37
40
 
38
- return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 10px 0px 10px 20px;\n "])));
39
- }) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n @media (min-width: 681px) {\n width: calc(49% - 40px);\n }\n @media (min-width: 1440px) {\n width: calc(33% - 40px);\n margin: 10px 20px 10px 0px;\n ", "\n }\n "])), function (props) {
41
+ return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin: 10px 0px 10px 20px;\n "])));
42
+ }) : (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n @media (min-width: 681px) {\n width: calc(49% - 20px);\n }\n @media (min-width: 1440px) {\n width: calc(33% - 20px);\n margin: 10px 20px 10px 0px;\n ", "\n }\n "])), function (props) {
40
43
  var _props$theme2;
41
44
 
42
- return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 10px 0px 10px 20px;\n "])));
45
+ return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin: 10px 0px 10px 20px;\n "])));
43
46
  });
44
47
  });
45
48
  });
46
49
 
47
50
  exports.CardContainer = CardContainer;
48
51
 
49
- var SoldOut = _styledComponents.default.span(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-weight: bold;\n position: absolute;\n background: #495057 0% 0% no-repeat padding-box;\n padding: 5px 10px;\n top: 7px;\n border-radius: 2px 0px 0px 2px;\n right: 0px;\n color: white;\n font-size: 12px;\n ", "\n &:first-letter {\n text-transform: uppercase;\n }\n ", "\n"])), function (props) {
52
+ var SoldOut = _styledComponents.default.span(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-weight: bold;\n position: absolute;\n background: #495057 0% 0% no-repeat padding-box;\n padding: 5px 10px;\n top: 7px;\n border-radius: 2px 0px 0px 2px;\n right: 0px;\n color: white;\n font-size: 12px;\n ", "\n &:first-letter {\n text-transform: uppercase;\n }\n ", "\n"])), function (props) {
50
53
  var _props$theme3;
51
54
 
52
- return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.rtl) && (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n left: 0px;\n right: initial;\n "])));
53
- }, function (_ref4) {
54
- var isBottom = _ref4.isBottom;
55
- return isBottom && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n bottom: 7px;\n top: initial;\n "])));
55
+ return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.rtl) && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: 0px;\n right: initial;\n "])));
56
+ }, function (_ref5) {
57
+ var isBottom = _ref5.isBottom;
58
+ return isBottom && (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n bottom: 7px;\n top: initial;\n "])));
56
59
  });
57
60
 
58
61
  exports.SoldOut = SoldOut;
59
62
 
60
- var CardInfo = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n > * {\n margin: 3px;\n }\n p {\n color: #909BA9;\n text-align: left;\n font-size: 10px;\n ", "\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n white-space: pre-wrap;\n }\n span {\n color: ", ";\n font-size: 14px;\n }\n @media (min-width: 1024px) {\n p {\n font-size: 12px;\n }\n span {\n font-size: 14px;\n }\n }\n"])), function (_ref5) {
61
- var isBgimage = _ref5.isBgimage;
62
- return (0, _styledComponents.css)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n width: ", ";\n "])), isBgimage ? 'calc(100% - 90px)' : '100%');
63
+ var CardInfo = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n > * {\n margin: 3px;\n }\n p {\n color: #909BA9;\n text-align: left;\n font-size: 10px;\n ", "\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n white-space: pre-wrap;\n }\n span {\n color: ", ";\n font-size: 14px;\n }\n ", "\n @media (min-width: 1024px) {\n p {\n font-size: 12px;\n }\n span {\n font-size: 14px;\n }\n }\n"])), function (_ref6) {
64
+ var isBgimage = _ref6.isBgimage;
65
+ return (0, _styledComponents.css)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n width: ", ";\n "])), isBgimage ? 'calc(100% - 90px)' : '100%');
63
66
  }, function (props) {
64
67
  var _props$theme4;
65
68
 
66
- return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
69
+ return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
67
70
  }, function (props) {
68
71
  return props.theme.colors.darkTextColor;
72
+ }, function (_ref7) {
73
+ var oneLine = _ref7.oneLine;
74
+ return oneLine && (0, _styledComponents.css)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n p {\n -webkit-line-clamp: 1;\n }\n "])));
69
75
  });
70
76
 
71
77
  exports.CardInfo = CardInfo;
72
78
 
73
- var WrapLogo = _styledComponents.default.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 86px;\n max-height: 86px;\n height: 86px;\n ", "\n margin-left: 5px;\n ", "\n"])), function (_ref6) {
74
- var isBgimage = _ref6.isBgimage;
75
- return isBgimage && (0, _styledComponents.css)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n width: 86px;\n "])));
79
+ var WrapLogo = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 86px;\n max-height: 86px;\n height: 86px;\n ", "\n margin-left: 5px;\n ", "\n"])), function (_ref8) {
80
+ var isBgimage = _ref8.isBgimage;
81
+ return isBgimage && (0, _styledComponents.css)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n width: 86px;\n "])));
76
82
  }, function (props) {
77
83
  var _props$theme5;
78
84
 
79
- return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0px;\n "])));
85
+ return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0px;\n "])));
80
86
  });
81
87
 
82
88
  exports.WrapLogo = WrapLogo;
83
89
 
84
- var CardLogoStyled = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n position: relative;\n background-repeat: no-repeat, repeat;\n background-size: cover;\n background-position: center;\n object-fit: cover;\n min-height: 86px;\n border-radius: 10px;\n"])));
90
+ var CardLogoStyled = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n position: relative;\n background-repeat: no-repeat, repeat;\n background-size: cover;\n background-position: center;\n object-fit: cover;\n min-height: 86px;\n border-radius: 10px;\n"])));
85
91
 
86
92
  var CardLogo = function CardLogo(props) {
87
93
  var style = {};
@@ -101,42 +107,48 @@ var CardLogo = function CardLogo(props) {
101
107
 
102
108
  exports.CardLogo = CardLogo;
103
109
 
104
- var PriceWrapper = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n .off-price {\n font-size: 10px;\n color: #909BA9;\n margin-left: 5px;\n text-decoration: line-through;\n ", "\n @media (min-width: 1024px) {\n font-size: 13px;\n }\n }\n"])), function (props) {
105
- return props.theme.rtl && (0, _styledComponents.css)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0;\n "])));
110
+ var PriceWrapper = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n .off-price {\n font-size: 10px;\n color: #909BA9;\n margin-left: 5px;\n text-decoration: line-through;\n ", "\n @media (min-width: 1024px) {\n font-size: 13px;\n }\n }\n"])), function (props) {
111
+ return props.theme.rtl && (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0;\n "])));
106
112
  });
107
113
 
108
114
  exports.PriceWrapper = PriceWrapper;
109
115
 
110
- var QuantityContainer = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n position: absolute;\n left: 100%;\n bottom: 100%;\n width: 25px;\n height: 25px;\n text-align: center;\n border-radius: 50%;\n transform: translate(-50%, 50%);\n"])), function (_ref7) {
111
- var theme = _ref7.theme;
116
+ var QuantityContainer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n position: absolute;\n left: 100%;\n bottom: 100%;\n width: 25px;\n height: 25px;\n text-align: center;\n border-radius: 50%;\n transform: translate(-50%, 50%);\n"])), function (_ref9) {
117
+ var theme = _ref9.theme;
112
118
  return theme.colors.primary;
113
- }, function (_ref8) {
114
- var theme = _ref8.theme;
119
+ }, function (_ref10) {
120
+ var theme = _ref10.theme;
115
121
  return theme.colors.primaryContrast;
116
122
  });
117
123
 
118
124
  exports.QuantityContainer = QuantityContainer;
119
125
 
120
- var RibbonBox = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n position: absolute;\n padding: 2px 8px;\n box-sizing: border-box;\n z-index: 10;\n color: ", ";\n font-weight: 400;\n font-size: 10px;\n line-height: 13px;\n top: -4px;\n right: -3px;\n background-color: ", ";\n max-width: 50px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n ", "\n ", "\n ", "\n ", "\n"])), function (props) {
126
+ var RibbonBox = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n position: absolute;\n padding: 2px 8px;\n box-sizing: border-box;\n z-index: 10;\n color: ", ";\n font-weight: 400;\n font-size: 10px;\n line-height: 13px;\n top: -4px;\n right: -3px;\n background-color: ", ";\n max-width: 50px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n ", "\n ", "\n ", "\n ", "\n"])), function (props) {
121
127
  return props.theme.colors.colorTextSignForm;
122
128
  }, function (props) {
123
129
  return props.theme.colors.primary;
124
130
  }, function (props) {
125
- return props.theme.rtl && (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n left: -3px;\n right: initial;\n "])));
126
- }, function (_ref9) {
127
- var bgColor = _ref9.bgColor;
128
- return bgColor && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), bgColor);
129
- }, function (_ref10) {
130
- var isRoundRect = _ref10.isRoundRect;
131
- return isRoundRect && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n border-radius: 7.6px;\n "])));
131
+ return props.theme.rtl && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n left: -3px;\n right: initial;\n "])));
132
132
  }, function (_ref11) {
133
- var isCapsule = _ref11.isCapsule;
134
- return isCapsule && (0, _styledComponents.css)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n border-radius: 50px;\n "])));
133
+ var bgColor = _ref11.bgColor;
134
+ return bgColor && (0, _styledComponents.css)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), bgColor);
135
+ }, function (_ref12) {
136
+ var isRoundRect = _ref12.isRoundRect;
137
+ return isRoundRect && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n border-radius: 7.6px;\n "])));
138
+ }, function (_ref13) {
139
+ var isCapsule = _ref13.isCapsule;
140
+ return isCapsule && (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n border-radius: 50px;\n "])));
135
141
  });
136
142
 
137
143
  exports.RibbonBox = RibbonBox;
138
144
 
139
- var TitleWrapper = _styledComponents.default.div(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n h1 {\n font-size: 14px;\n font-weight: 500;\n text-align: left;\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n margin: 0px;\n }\n > span {\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n svg {\n color: ", ";\n font-size: 16px;\n }\n }\n"])), function (props) {
145
+ var LastOrder = _styledComponents.default.span(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n color: ", ";\n font-weight: 400;\n font-size: 10px !important;\n margin: 0px 3px;\n"])), function (props) {
146
+ return props.theme.colors.primary;
147
+ });
148
+
149
+ exports.LastOrder = LastOrder;
150
+
151
+ var TitleWrapper = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n h1 {\n font-size: 14px;\n font-weight: 500;\n text-align: left;\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n margin: 0px;\n }\n > span {\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n svg {\n color: ", ";\n font-size: 16px;\n }\n }\n"])), function (props) {
140
152
  return props.theme.colors.headingColor;
141
153
  }, function (props) {
142
154
  return props.theme.colors.danger500;
@@ -144,14 +156,14 @@ var TitleWrapper = _styledComponents.default.div(_templateObject26 || (_template
144
156
 
145
157
  exports.TitleWrapper = TitleWrapper;
146
158
 
147
- var SkeletonCardInfo = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: calc(100% - 90px);\n > * {\n margin: 3px;\n }\n"])));
159
+ var SkeletonCardInfo = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: calc(100% - 90px);\n > * {\n margin: 3px;\n }\n"])));
148
160
 
149
161
  exports.SkeletonCardInfo = SkeletonCardInfo;
150
162
 
151
- var SkeletonCardLogo = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n max-width: 86px;\n max-height: 86px;\n width: 86px;\n height: 86px;\n margin-left: 5px;\n ", "\n"])), function (props) {
163
+ var SkeletonCardLogo = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n max-width: 86px;\n max-height: 86px;\n width: 86px;\n height: 86px;\n margin-left: 5px;\n ", "\n"])), function (props) {
152
164
  var _props$theme6;
153
165
 
154
- return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0px;\n "])));
166
+ return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n margin-right: 5px;\n margin-left: 0px;\n "])));
155
167
  });
156
168
 
157
169
  exports.SkeletonCardLogo = SkeletonCardLogo;
@@ -153,7 +153,7 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
153
153
  onClick: function onClick() {
154
154
  return setOpenBusinessInformation(true);
155
155
  }
156
- })))))), !errorQuantityProducts && /*#__PURE__*/_react.default.createElement(_styles.WrapperSearch, null, /*#__PURE__*/_react.default.createElement(_SearchBar.SearchBar, {
156
+ })))))), /*#__PURE__*/_react.default.createElement(_styles.WrapperSearch, null, /*#__PURE__*/_react.default.createElement(_SearchBar.SearchBar, {
157
157
  onSearch: handleChangeSearch,
158
158
  search: searchValue,
159
159
  placeholder: t('SEARCH_PRODUCTS', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag7 = theme.defaultLanguages) === null || _theme$defaultLanguag7 === void 0 ? void 0 : _theme$defaultLanguag7.SEARCH_PRODUCTS) || 'Search Products'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "1.1.7",
3
+ "version": "1.2.1",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -54,6 +54,7 @@ import { NotNetworkConnectivity } from './src/components/NotNetworkConnectivity'
54
54
  import { Modal } from './src/components/Modal'
55
55
  import { OrderDetails } from './src/components/OrderDetails'
56
56
  import { OrderDetails as OrderDetailsKiosk } from './src/components/OrderDetails/layouts/Kiosk'
57
+ import { OrderItAgain } from './src/components/OrderItAgain'
57
58
  import { OrdersOption } from './src/components/OrdersOption'
58
59
  import { OrderProgress } from './src/components/OrderProgress'
59
60
  import { OrderTypeSelectorContent } from './src/components/OrderTypeSelectorContent'
@@ -163,6 +164,7 @@ export {
163
164
  NotFoundSource,
164
165
  NotNetworkConnectivity,
165
166
  OrderDetails,
167
+ OrderItAgain,
166
168
  OrderDetailsKiosk,
167
169
  OrdersOption,
168
170
  OrderTypeSelectorContent,
@@ -87,7 +87,7 @@ export const SectionTitle = styled.h3`
87
87
  font-weight: 500;
88
88
  font-size: 16px;
89
89
  color: ${props => props.theme.colors.darkTextColor};
90
- margin: 25px 0 20px 0;
90
+ margin: 10px 0 10px 0;
91
91
  `
92
92
 
93
93
  export const Map = styled.div`
@@ -264,9 +264,9 @@ export const BusinessTitle = styled.h2`
264
264
  color: ${props => props.theme.colors.darkTextColor};
265
265
  text-align: center;
266
266
  margin-top: 0;
267
- margin-bottom: 36px;
267
+ margin-bottom: 0;
268
268
  padding-left: 30px;
269
-
269
+ padding-top: 25px;
270
270
  ${props => props.theme?.rtl && css`
271
271
  padding-right: 30px;
272
272
  padding-left: 0;
@@ -111,7 +111,7 @@ const BusinessProductsListingUI = (props) => {
111
111
  }
112
112
 
113
113
  const onProductClick = (product) => {
114
- if (!((product?.type === 'service') && professionalSelected)) {
114
+ if (!((product?.type === 'service') && business?.professionals?.length > 0)) {
115
115
  if (site?.product_url_template) {
116
116
  onProductRedirect({
117
117
  slug: business?.slug,
@@ -414,7 +414,7 @@ const BusinessProductsListingUI = (props) => {
414
414
  )}
415
415
  {(productModal.product || curProduct) && (
416
416
  <>
417
- {(((productModal?.product?.type === 'service') || (curProduct?.type === 'service')) && professionalSelected) ? (
417
+ {(((productModal?.product?.type === 'service') || (curProduct?.type === 'service')) && business?.professionals?.length > 0) ? (
418
418
  <ServiceForm
419
419
  businessSlug={business?.slug}
420
420
  useKioskApp={props.useKioskApp}
@@ -14,6 +14,7 @@ import { TaxInformation } from '../TaxInformation'
14
14
  import { TextArea } from '../../styles/Inputs'
15
15
  import { SpinnerLoader } from '../../../../../components/SpinnerLoader'
16
16
  import { CartStoresListing } from '../../../../franchise/src/components/CartStoresListing'
17
+ import { DriverTips } from '../DriverTips'
17
18
  import {
18
19
  CartContainer,
19
20
  OrderBill,
@@ -24,7 +25,8 @@ import {
24
25
  Spinner,
25
26
  CommentContainer,
26
27
  IconContainer,
27
- NoValidProductMessage
28
+ NoValidProductMessage,
29
+ DriverTipContainer
28
30
  } from './styles'
29
31
  import { verifyDecimals } from '../../../../../utils'
30
32
  import BsInfoCircle from '@meronex/icons/bs/BsInfoCircle'
@@ -67,6 +69,10 @@ const CartUI = (props) => {
67
69
  const [{ site }] = useSite()
68
70
  const windowSize = useWindowSize()
69
71
 
72
+ const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
73
+ ? JSON.parse(configs?.driver_tip_options?.value) || []
74
+ : configs?.driver_tip_options?.value || []
75
+
70
76
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
71
77
  const [openProduct, setModalIsOpen] = useState(false)
72
78
  const [curProduct, setCurProduct] = useState({})
@@ -402,7 +408,7 @@ const CartUI = (props) => {
402
408
  )}
403
409
  </tbody>
404
410
  </table>
405
- {isCouponEnabled && !isCartPending && ((isCheckout || isCartPopover) && !(isCheckout && isCartPopover)) && (
411
+ {isCouponEnabled && !isCartPending && ((isCheckout || isCartPopover || isMultiCheckout) && !(isCheckout && isCartPopover)) && (
406
412
  <CouponContainer>
407
413
  <CouponControl
408
414
  businessId={cart.business_id}
@@ -410,6 +416,35 @@ const CartUI = (props) => {
410
416
  />
411
417
  </CouponContainer>
412
418
  )}
419
+ {
420
+ isMultiCheckout &&
421
+ cart &&
422
+ cart?.business_id &&
423
+ orderState?.options?.type === 1 &&
424
+ cart?.status !== 2 &&
425
+ validationFields?.fields?.checkout?.driver_tip?.enabled &&
426
+ driverTipsOptions.length > 0 &&
427
+ !useKioskApp &&
428
+ (
429
+ <>
430
+ <DriverTipContainer>
431
+ <h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
432
+ <p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
433
+ <DriverTips
434
+ businessId={cart?.business_id}
435
+ driverTipsOptions={driverTipsOptions}
436
+ isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
437
+ isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
438
+ driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
439
+ ? cart?.driver_tip
440
+ : cart?.driver_tip_rate}
441
+ cart={cart}
442
+ useOrderContext
443
+ />
444
+ </DriverTipContainer>
445
+ </>
446
+ )
447
+ }
413
448
  <table className='total'>
414
449
  <tbody>
415
450
  <tr>
@@ -207,3 +207,20 @@ export const SpotSelect = styled.select`
207
207
  export const NoValidProductMessage = styled.p`
208
208
  font-size: 14px;
209
209
  `
210
+ export const DriverTipContainer = styled.div`
211
+ width: 100%;
212
+ display: flex;
213
+ flex-direction: column;
214
+ margin: 20px 0px 0px;
215
+ h1 {
216
+ margin: 0px;
217
+ font-weight: 500;
218
+ font-size: 20px;
219
+ color: ${props => props.theme.colors.darkTextColor};
220
+ }
221
+ > p {
222
+ margin: 0;
223
+ font-size: 16px;
224
+ color: #909BA9;
225
+ }
226
+ `
@@ -213,10 +213,6 @@ const CheckoutUI = (props) => {
213
213
  setUserErrors(errors)
214
214
  }
215
215
 
216
- const handleGoToStore = (slug) => {
217
- events.emit('go_to_page', { page: 'business', params: { store: slug } })
218
- }
219
-
220
216
  useEffect(() => {
221
217
  if (validationFields && validationFields?.fields?.checkout) {
222
218
  checkValidationFields()
@@ -465,7 +461,7 @@ const CheckoutUI = (props) => {
465
461
  <CartContainer>
466
462
  <CartHeader>
467
463
  <h1>{t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}</h1>
468
- <span onClick={() => cart?.business?.slug && handleGoToStore(cart?.business?.slug)}>{('ADD_PRODUCTS', 'Add products')}</span>
464
+ <span onClick={() => cart?.business?.slug && handleStoreRedirect && handleStoreRedirect(cart?.business?.slug)}>{('ADD_PRODUCTS', 'Add products')}</span>
469
465
  </CartHeader>
470
466
  <Cart
471
467
  isCartPending={cart?.status === 2}
@@ -19,10 +19,14 @@ export const Container = styled.div`
19
19
  export const WrapperLeftContainer = styled.div`
20
20
  width: 100%;
21
21
  box-sizing: border-box;
22
- padding: 30px 20px;
22
+ padding: 55px 20px 30px;
23
23
 
24
24
  @media (min-width: 769px) {
25
25
  width: 55%;
26
+ padding: 55px 60px 55px 40px;
27
+ }
28
+
29
+ @media (min-width: 820px) {
26
30
  padding: 30px 60px 55px 40px;
27
31
  }
28
32
  `
@@ -86,6 +86,11 @@ export const ModalActions = styled.div`
86
86
  `
87
87
  export const ModalHeader = styled.div`
88
88
  display: flex;
89
+ margin-top: 30px;
90
+
91
+ @media(min-width: 450px){
92
+ margin-top: 0;
93
+ }
89
94
 
90
95
  `
91
96
 
@@ -128,64 +128,64 @@ const MomentControlUI = (props) => {
128
128
  const setLocalMoment = () => {
129
129
  moment.updateLocale('custom', {
130
130
  months: [
131
- t('MONTH1','January'),
132
- t('MONTH2','February'),
133
- t('MONTH3','March'),
134
- t('MONTH4','April'),
135
- t('MONTH5','May'),
136
- t('MONTH6','June'),
137
- t('MONTH7','July'),
138
- t('MONTH8','August'),
139
- t('MONTH9','September'),
140
- t('MONTH10','October'),
141
- t('MONTH11','November'),
142
- t('MONTH12','December')
131
+ t('MONTH1', 'January'),
132
+ t('MONTH2', 'February'),
133
+ t('MONTH3', 'March'),
134
+ t('MONTH4', 'April'),
135
+ t('MONTH5', 'May'),
136
+ t('MONTH6', 'June'),
137
+ t('MONTH7', 'July'),
138
+ t('MONTH8', 'August'),
139
+ t('MONTH9', 'September'),
140
+ t('MONTH10', 'October'),
141
+ t('MONTH11', 'November'),
142
+ t('MONTH12', 'December')
143
143
  ],
144
144
  monthsShort: [
145
- t('MONTHSHORT1','Jan'),
146
- t('MONTHSHORT2','Feb'),
147
- t('MONTHSHORT3','Mar'),
148
- t('MONTHSHORT4','Apr'),
149
- t('MONTHSHORT5','May'),
150
- t('MONTHSHORT6','Jun'),
151
- t('MONTHSHORT7','Jul'),
152
- t('MONTHSHORT8','Aug'),
153
- t('MONTHSHORT9','Sep'),
154
- t('MONTHSHORT10','Oct'),
155
- t('MONTHSHORT11','Nov'),
156
- t('MONTHSHORT12','Dec')
145
+ t('MONTHSHORT1', 'Jan'),
146
+ t('MONTHSHORT2', 'Feb'),
147
+ t('MONTHSHORT3', 'Mar'),
148
+ t('MONTHSHORT4', 'Apr'),
149
+ t('MONTHSHORT5', 'May'),
150
+ t('MONTHSHORT6', 'Jun'),
151
+ t('MONTHSHORT7', 'Jul'),
152
+ t('MONTHSHORT8', 'Aug'),
153
+ t('MONTHSHORT9', 'Sep'),
154
+ t('MONTHSHORT10', 'Oct'),
155
+ t('MONTHSHORT11', 'Nov'),
156
+ t('MONTHSHORT12', 'Dec')
157
157
  ],
158
158
  weekdays: [
159
- t('DAY7','Sunday'),
160
- t('DAY1','Monday'),
161
- t('DAY2','Tuesday'),
162
- t('DAY3','Wednesday'),
163
- t('DAY4','Thursday'),
164
- t('DAY5','Friday'),
165
- t('DAY6','Saturday')
159
+ t('DAY7', 'Sunday'),
160
+ t('DAY1', 'Monday'),
161
+ t('DAY2', 'Tuesday'),
162
+ t('DAY3', 'Wednesday'),
163
+ t('DAY4', 'Thursday'),
164
+ t('DAY5', 'Friday'),
165
+ t('DAY6', 'Saturday')
166
166
  ],
167
167
  weekdaysShort: [
168
- t('DAYSHORT7','Sun'),
169
- t('DAYSHORT1','Mon'),
170
- t('DAYSHORT2','Tue'),
171
- t('DAYSHORT3','Wed'),
172
- t('DAYSHORT4','Thu'),
173
- t('DAYSHORT5','Fri'),
174
- t('DAYSHORT6','Sat')
168
+ t('DAYSHORT7', 'Sun'),
169
+ t('DAYSHORT1', 'Mon'),
170
+ t('DAYSHORT2', 'Tue'),
171
+ t('DAYSHORT3', 'Wed'),
172
+ t('DAYSHORT4', 'Thu'),
173
+ t('DAYSHORT5', 'Fri'),
174
+ t('DAYSHORT6', 'Sat')
175
175
  ],
176
176
  weekdaysMin: [
177
- t('DAYMIN7','Su'),
178
- t('DAYMIN1','Mo'),
179
- t('DAYMIN2','Tu'),
180
- t('DAYMIN3','We'),
181
- t('DAYMIN4','Th'),
182
- t('DAYMIN5','Fr'),
183
- t('DAYMIN6','Sa')
177
+ t('DAYMIN7', 'Su'),
178
+ t('DAYMIN1', 'Mo'),
179
+ t('DAYMIN2', 'Tu'),
180
+ t('DAYMIN3', 'We'),
181
+ t('DAYMIN4', 'Th'),
182
+ t('DAYMIN5', 'Fr'),
183
+ t('DAYMIN6', 'Sa')
184
184
  ],
185
- meridiem : function (hours) {
186
- return hours < 12 ? t('AM', 'AM') : t('PM','PM');
185
+ meridiem: function (hours) {
186
+ return hours < 12 ? t('AM', 'AM') : t('PM', 'PM')
187
187
  }
188
- })
188
+ })
189
189
  }
190
190
 
191
191
  useEffect(() => {
@@ -8,7 +8,6 @@ export const Title = styled.div`
8
8
  color: ${props => props.theme.colors?.darkTextColor};
9
9
 
10
10
  @media (max-width: 450px) {
11
- padding-left: 30px;
12
11
  ${props => props.theme.rtl && css`
13
12
  padding-right: 30px;
14
13
  padding-left: 0;
@@ -1,4 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
+ import { useHistory } from 'react-router-dom'
2
3
  import {
3
4
  useLanguage,
4
5
  useUtils,
@@ -62,6 +63,7 @@ const MultiCheckoutUI = (props) => {
62
63
  const [customerState] = useCustomer()
63
64
  const [validationFields] = useValidationFields()
64
65
  const [{ user }] = useSession()
66
+ const history = useHistory()
65
67
 
66
68
  const [userErrors, setUserErrors] = useState([])
67
69
  const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(null)
@@ -0,0 +1,46 @@
1
+ import React from 'react'
2
+ import { useLanguage } from 'ordering-components-external'
3
+ import { SingleProductCard } from '../SingleProductCard'
4
+ import {
5
+ Container,
6
+ ContentHeader,
7
+ ProductListWrapper,
8
+ ProductList
9
+ } from './styles'
10
+ import { AutoScroll } from '../AutoScroll'
11
+
12
+ export const OrderItAgain = (props) => {
13
+ const {
14
+ onProductClick,
15
+ isGroceries,
16
+ productList,
17
+ businessId
18
+ } = props
19
+
20
+ const [, t] = useLanguage()
21
+
22
+ return (
23
+ <Container isGroceries={isGroceries}>
24
+ <ContentHeader isGroceries={isGroceries}>
25
+ <h2>{t('ORDER_IT_AGAIN', 'Order it again')}</h2>
26
+ <p>{t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.')}</p>
27
+ </ContentHeader>
28
+ <ProductListWrapper>
29
+ <ProductList>
30
+ <AutoScroll scrollId='orderItAgain'>
31
+ {productList.map((product, i) => (
32
+ <SingleProductCard
33
+ key={i}
34
+ isSoldOut={product.inventoried && !product.quantity}
35
+ businessId={businessId}
36
+ product={product}
37
+ onProductClick={onProductClick}
38
+ isPreviously
39
+ />
40
+ ))}
41
+ </AutoScroll>
42
+ </ProductList>
43
+ </ProductListWrapper>
44
+ </Container>
45
+ )
46
+ }