ordering-ui-external 14.1.46 → 14.1.48

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 (30) hide show
  1. package/_bundles/{0.ordering-ui.247fbb361bb31d72a262.js → 0.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  2. package/_bundles/{1.ordering-ui.247fbb361bb31d72a262.js → 1.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  3. package/_bundles/{2.ordering-ui.247fbb361bb31d72a262.js → 2.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  4. package/_bundles/{4.ordering-ui.247fbb361bb31d72a262.js → 4.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  5. package/_bundles/{5.ordering-ui.247fbb361bb31d72a262.js → 5.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  6. package/_bundles/{6.ordering-ui.247fbb361bb31d72a262.js → 6.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  7. package/_bundles/{7.ordering-ui.247fbb361bb31d72a262.js → 7.ordering-ui.4754b59ff7216a67c8b5.js} +2 -2
  8. package/_bundles/{8.ordering-ui.247fbb361bb31d72a262.js → 8.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  9. package/_bundles/{9.ordering-ui.247fbb361bb31d72a262.js → 9.ordering-ui.4754b59ff7216a67c8b5.js} +1 -1
  10. package/_bundles/ordering-ui.4754b59ff7216a67c8b5.js +2 -0
  11. package/_modules/components/LogoutButton/index.js +1 -7
  12. package/_modules/themes/callcenterOriginal/src/components/Header/index.js +5 -7
  13. package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +8 -12
  14. package/_modules/themes/callcenterOriginal/src/components/HeaderOption/index.js +6 -26
  15. package/_modules/themes/callcenterOriginal/src/components/HeaderOption/styles.js +1 -1
  16. package/_modules/themes/callcenterOriginal/src/components/SidebarMenu/index.js +74 -69
  17. package/_modules/themes/callcenterOriginal/src/components/UserPopover/index.js +30 -21
  18. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +20 -30
  19. package/package.json +2 -2
  20. package/src/components/LogoutButton/index.js +3 -5
  21. package/src/themes/callcenterOriginal/src/components/Header/index.js +14 -12
  22. package/src/themes/callcenterOriginal/src/components/Header/styles.js +18 -40
  23. package/src/themes/callcenterOriginal/src/components/HeaderOption/index.js +30 -51
  24. package/src/themes/callcenterOriginal/src/components/HeaderOption/styles.js +2 -4
  25. package/src/themes/callcenterOriginal/src/components/SidebarMenu/index.js +75 -101
  26. package/src/themes/callcenterOriginal/src/components/UserPopover/index.js +36 -17
  27. package/src/themes/five/src/components/ProductItemAccordion/index.js +20 -27
  28. package/_bundles/ordering-ui.247fbb361bb31d72a262.js +0 -2
  29. /package/_bundles/{7.ordering-ui.247fbb361bb31d72a262.js.LICENSE.txt → 7.ordering-ui.4754b59ff7216a67c8b5.js.LICENSE.txt} +0 -0
  30. /package/_bundles/{ordering-ui.247fbb361bb31d72a262.js.LICENSE.txt → ordering-ui.4754b59ff7216a67c8b5.js.LICENSE.txt} +0 -0
@@ -15,24 +15,24 @@ var _styledComponents = require("styled-components");
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
19
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
21
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
22
- 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); }
23
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
19
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
20
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
27
22
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
24
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
26
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
27
+ 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); }
28
28
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
29
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
30
30
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
31
31
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
32
32
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
33
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
- var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAccordion(props) {
35
- var _theme$viewString, _theme$business_view, _productInfo, _productInfo2, _props$beforeElements, _props$beforeComponen, _product$valid, _theme$images, _theme$images2, _product$calendar_eve, _configs$format_time, _product$calendar_eve2, _configs$format_time2, _toppingsRemoved$remo, _props$afterComponent, _props$afterElements;
34
+ var ProductItemAccordionUI = function ProductItemAccordionUI(props) {
35
+ var _theme$viewString, _theme$business_view, _productInfo$ingredie, _productInfo$options, _props$beforeElements, _props$beforeComponen, _product$valid, _theme$images, _theme$images2, _product$calendar_eve, _configs$format_time, _product$calendar_eve2, _configs$format_time2, _toppingsRemoved$remo, _props$afterComponent, _props$afterElements;
36
36
  var isDisabledEdit = props.isDisabledEdit,
37
37
  isCartPending = props.isCartPending,
38
38
  isCartProduct = props.isCartProduct,
@@ -45,7 +45,8 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
45
45
  isCheckout = props.isCheckout,
46
46
  isStore = props.isStore,
47
47
  isConfirmationPage = props.isConfirmationPage,
48
- toppingsRemoved = props.toppingsRemoved;
48
+ toppingsRemoved = props.toppingsRemoved,
49
+ productInfo = props.productInfo;
49
50
  var theme = (0, _styledComponents.useTheme)();
50
51
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
51
52
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
@@ -81,24 +82,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
81
82
  var viewString = isConfirmationPage ? 'confirmation' : isStore ? 'business_view' : 'header';
82
83
  var showProductImage = !(theme !== null && theme !== void 0 && (_theme$viewString = theme[viewString]) !== null && _theme$viewString !== void 0 && (_theme$viewString = _theme$viewString.components) !== null && _theme$viewString !== void 0 && (_theme$viewString = _theme$viewString.cart) !== null && _theme$viewString !== void 0 && (_theme$viewString = _theme$viewString.components) !== null && _theme$viewString !== void 0 && (_theme$viewString = _theme$viewString.products) !== null && _theme$viewString !== void 0 && (_theme$viewString = _theme$viewString.components) !== null && _theme$viewString !== void 0 && (_theme$viewString = _theme$viewString.image) !== null && _theme$viewString !== void 0 && _theme$viewString.hidden);
83
84
  var hideProductDummyLogo = 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 = _theme$business_view.products) === null || _theme$business_view === void 0 || (_theme$business_view = _theme$business_view.components) === null || _theme$business_view === void 0 || (_theme$business_view = _theme$business_view.product) === null || _theme$business_view === void 0 || (_theme$business_view = _theme$business_view.components) === null || _theme$business_view === void 0 || (_theme$business_view = _theme$business_view.dummy) === null || _theme$business_view === void 0 ? void 0 : _theme$business_view.hidden;
84
- var productInfo = function productInfo() {
85
- if (isCartProduct) {
86
- var _product$ingredients, _product$options;
87
- var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
88
- var options = JSON.parse(JSON.stringify(Object.values((_product$options = product.options) !== null && _product$options !== void 0 ? _product$options : {})));
89
- options = options.map(function (option) {
90
- var _option$suboptions;
91
- option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
92
- return option;
93
- });
94
- return _objectSpread(_objectSpread({}, productInfo), {}, {
95
- ingredients: ingredients,
96
- options: options
97
- });
98
- }
99
- return product;
100
- };
101
- var showArrowIcon = props.showArrowIcon && (((_productInfo = productInfo()) === null || _productInfo === void 0 || (_productInfo = _productInfo.ingredients) === null || _productInfo === void 0 ? void 0 : _productInfo.length) > 0 || ((_productInfo2 = productInfo()) === null || _productInfo2 === void 0 || (_productInfo2 = _productInfo2.options) === null || _productInfo2 === void 0 ? void 0 : _productInfo2.length) > 0 || (product === null || product === void 0 ? void 0 : product.comment));
85
+ var showArrowIcon = props.showArrowIcon && ((productInfo === null || productInfo === void 0 || (_productInfo$ingredie = productInfo.ingredients) === null || _productInfo$ingredie === void 0 ? void 0 : _productInfo$ingredie.length) > 0 || (productInfo === null || productInfo === void 0 || (_productInfo$options = productInfo.options) === null || _productInfo$options === void 0 ? void 0 : _productInfo$options.length) > 0 || (product === null || product === void 0 ? void 0 : product.comment));
102
86
  var toggleAccordion = function toggleAccordion(e) {
103
87
  var _productSelect$curren, _productActionsEdit$c, _productActionsDelete;
104
88
  var isActionsClick = ((_productSelect$curren = productSelect.current) === null || _productSelect$curren === void 0 ? void 0 : _productSelect$curren.contains(e.target)) || ((_productActionsEdit$c = productActionsEdit.current) === null || _productActionsEdit$c === void 0 ? void 0 : _productActionsEdit$c.contains(e.target)) || ((_productActionsDelete = productActionsDelete.current) === null || _productActionsDelete === void 0 ? void 0 : _productActionsDelete.contains(e.target));
@@ -182,7 +166,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
182
166
  className: "".concat(setRotate)
183
167
  }), product.valid && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((product === null || product === void 0 ? void 0 : product.valid) || !isCartProduct) && windowSize.width > 410 && /*#__PURE__*/_react.default.createElement(_styles.ProductPriceSection, null, /*#__PURE__*/_react.default.createElement(_styles.ProductPrice, {
184
168
  className: "prod-price"
185
- }, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
169
+ }, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (productInfo.ingredients.length > 0 || productInfo.options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
186
170
  className: "".concat(setRotate)
187
171
  }))), isCartProduct && !isCartPending && /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, !isDisabledEdit && /*#__PURE__*/_react.default.createElement(_styles.ProductActionsEdit, {
188
172
  ref: productActionsEdit,
@@ -229,14 +213,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
229
213
  style: {
230
214
  maxHeight: "".concat(setHeight)
231
215
  }
232
- }, productInfo().ingredients.length > 0 && productInfo().ingredients.some(function (ingredient) {
216
+ }, productInfo.ingredients.length > 0 && productInfo.ingredients.some(function (ingredient) {
233
217
  return !ingredient.selected;
234
- }) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), productInfo().ingredients.map(function (ingredient) {
218
+ }) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), productInfo.ingredients.map(function (ingredient) {
235
219
  return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
236
220
  className: "ingredient",
237
221
  key: ingredient.id
238
222
  }, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
239
- })), productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, productInfo().options.sort(function (a, b) {
223
+ })), productInfo.options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, productInfo.options.sort(function (a, b) {
240
224
  return a.rank - b.rank;
241
225
  }).map(function (option) {
242
226
  return /*#__PURE__*/_react.default.createElement("li", {
@@ -269,4 +253,10 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
269
253
  key: i
270
254
  }, AfterElement);
271
255
  }));
256
+ };
257
+ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAccordion(props) {
258
+ var productItemAccordion = _objectSpread(_objectSpread({}, props), {}, {
259
+ UIComponent: ProductItemAccordionUI
260
+ });
261
+ return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.ProductItemAccordion, productItemAccordion);
272
262
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "14.1.46",
3
+ "version": "14.1.48",
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": "13.0.40",
91
+ "ordering-components-external": "13.0.42",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -16,8 +16,6 @@ const LogoutButtonUI = (props) => {
16
16
  const { onCustomClick, hideText } = props
17
17
  const [, t] = useLanguage()
18
18
 
19
- const isHome = window.location.pathname === '/' || window.location.pathname === '/home'
20
-
21
19
  const handleLogOutClick = () => {
22
20
  window.FB.getLoginStatus((response) => {
23
21
  if (response.status === 'connected') {
@@ -40,14 +38,14 @@ const LogoutButtonUI = (props) => {
40
38
  }
41
39
 
42
40
  return (
43
- <MenuLink id='logoutbtn' onClick={handleLogOutClick} isHome={isHome} style={props.styleContainer}>
41
+ <MenuLink id='logoutbtn' onClick={handleLogOutClick} style={props.styleContainer}>
44
42
  <WrappContent style={props.styleWrappContent}>
45
- <MenuLinkIcon isHome={isHome}>
43
+ <MenuLinkIcon>
46
44
  <FaSignOutAlt />
47
45
  </MenuLinkIcon>
48
46
  {!hideText && (
49
47
  <MenuLinkText>
50
- <TextInfo isHome={isHome}>
48
+ <TextInfo>
51
49
  {t('LOGOUT', 'Logout')}
52
50
  </TextInfo>
53
51
  </MenuLinkText>
@@ -168,20 +168,24 @@ export const Header = (props) => {
168
168
  {isShowOrderOptions && (
169
169
  <>
170
170
  <Menu className='left-header' id='center-side'>
171
- <AddressMenu
172
- onClick={(e) => handleClickUserCustomer(e)}
173
- >
174
- <GeoAlt /> <span><p>{orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}</p></span>
175
- </AddressMenu>
176
- <Divider />
177
- {isCustomerMode && windowSize.width > 450 && (
171
+ {windowSize.width > 820 && (
172
+ <>
173
+ <AddressMenu
174
+ onClick={(e) => handleClickUserCustomer(e)}
175
+ >
176
+ <GeoAlt /> <span><p>{orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}</p></span>
177
+ </AddressMenu>
178
+ <Divider />
179
+ </>
180
+ )}
181
+ {isCustomerMode && (
178
182
  <CustomerInfo
179
183
  onClick={(e) => handleClickUserCustomer(e)}
180
184
  >
181
185
  <span>
182
186
  <p>
183
- {windowSize.width > 940 ? userCustomer?.name : cutCharactersName({ str: userCustomer?.name })}
184
- {' '}{windowSize.width > 940 ? userCustomer?.lastname : null}
187
+ {windowSize.width > 1200 ? userCustomer?.name : cutCharactersName({ str: userCustomer?.name })}
188
+ {' '}{windowSize.width > 1200 ? userCustomer?.lastname : null}
185
189
  </p>
186
190
  </span>
187
191
  <span
@@ -218,14 +222,12 @@ export const Header = (props) => {
218
222
  </>
219
223
  )}
220
224
  <>
221
- {user?.level === 0 && (
225
+ {user?.level === 0 && windowSize.width > 1200 && (
222
226
  <>
223
227
  {!isShowOrderOptions && (
224
228
  <Menu className='left-header invisible' id='center-side' />
225
229
  )}
226
230
  <AdminAreaPopover
227
- withLogout
228
- isCustomerMode={isCustomerMode}
229
231
  open={openPopover.admin}
230
232
  onClick={() => handleTogglePopover('admin')}
231
233
  onClose={() => handleClosePopover('admin')}
@@ -16,25 +16,7 @@ export const InnerHeader = styled.div`
16
16
  align-items: center;
17
17
 
18
18
  #center-side {
19
- width: ${({ theme }) => theme?.header?.components?.layout?.type === 'starbucks' ? 'calc(60% - 140px)' : 'calc(60% - 30px)'};
20
- }
21
-
22
- @media (min-width: 1024px) {
23
- #center-side {
24
- width: calc(60% - 100px);
25
- }
26
- }
27
-
28
- @media (min-width: 1200px) {
29
- #center-side {
30
- width: calc(60% - 160px);
31
- }
32
- }
33
-
34
- @media (min-width: 1500px) {
35
- #center-side {
36
- width: calc(60% - 200px);
37
- }
19
+ width: calc(60% - 30px);
38
20
  }
39
21
  `
40
22
 
@@ -241,32 +223,28 @@ export const SubMenu = styled(InnerHeader)`
241
223
  `
242
224
 
243
225
  export const CustomerInfo = styled.div`
244
- display: none;
226
+ display: flex;
227
+ justify-content: center;
228
+ align-items: center;
245
229
  cursor: pointer;
246
230
  flex: 1;
247
231
  position: relative;
248
- @media (min-width: 450px) {
249
- display: flex;
250
- justify-content: center;
251
- align-items: center;
252
232
 
253
- span {
254
- display: flex;
255
- align-items: center;
233
+ span {
234
+ align-items: center;
235
+ margin: 0;
236
+ p {
237
+ max-width: 250px;
238
+ overflow: hidden;
239
+ text-overflow: ellipsis;
240
+ white-space: nowrap;
241
+ color: #909BA9;
256
242
  margin: 0;
257
- p {
258
- max-width: 250px;
259
- overflow: hidden;
260
- text-overflow: ellipsis;
261
- white-space: nowrap;
262
- color: #909BA9;
263
- margin: 0;
264
- }
265
- svg {
266
- color: #748194;
267
- margin: 0;
268
- font-size: 20px;
269
- }
243
+ }
244
+ svg {
245
+ color: #748194;
246
+ margin: 0;
247
+ font-size: 20px;
270
248
  }
271
249
  }
272
250
  `
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import { useUtils, useLanguage, useConfig, useOrder } from 'ordering-components-external'
3
- import AiOutlineShoppingCart from '@meronex/icons/ai/AiOutlineShoppingCart'
3
+ import { Cart3 } from 'react-bootstrap-icons'
4
4
  import FaMapMarkerAlt from '@meronex/icons/fa/FaMapMarkerAlt'
5
5
 
6
6
  import {
@@ -23,57 +23,36 @@ export const HeaderOption = (props) => {
23
23
  const [orderStatus] = useOrder()
24
24
 
25
25
  return (
26
- <>
27
- {props.beforeElements?.map((BeforeElement, i) => (
28
- <React.Fragment key={i}>
29
- {BeforeElement}
30
- </React.Fragment>))}
26
+ <Container
27
+ variant={variant}
28
+ onClick={() => props.onClick(variant)}
29
+ >
30
+ {variant === 'cart' && (
31
+ <span>
32
+ <Cart3 />
33
+ {totalCarts > 0 && <span>{totalCarts}</span>}
34
+ </span>
35
+ )}
36
+ {variant === 'address' && (
37
+ <>
38
+ <FaMapMarkerAlt id='icon' />
39
+ {addressState || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
40
+ </>
41
+ )}
42
+ {variant === 'moment' && (
43
+ <>
44
+ {momentState
45
+ ? parseDate(momentState, { outputFormat: configs?.dates_moment_format?.value })
46
+ : t('ASAP_ABBREVIATION', 'ASAP')}
47
+ </>
48
+ )}
31
49
  {
32
- props.beforeComponents?.map((BeforeComponent, i) => (
33
- <BeforeComponent key={i} {...props} />))
50
+ variant === 'delivery' && (
51
+ <DeliveryType>
52
+ {(orderTypeList && orderTypeList[orderStatus?.options.type - 1]) || t('DELIVERY', 'Delivery')}
53
+ </DeliveryType>
54
+ )
34
55
  }
35
- <Container
36
- variant={variant}
37
- onClick={() => props.onClick(variant)}
38
- isHome={props.isHome}
39
- >
40
- {variant === 'cart' && (
41
- <span>
42
- <AiOutlineShoppingCart id='icon' />
43
- {totalCarts > 0 && <p>{totalCarts}</p>}
44
- </span>
45
- )}
46
- {variant === 'address' && (
47
- <>
48
- <FaMapMarkerAlt id='icon' />
49
- {addressState || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
50
- </>
51
- )}
52
- {variant === 'moment' && (
53
- <>
54
- {momentState
55
- ? parseDate(momentState, { outputFormat: configs?.dates_moment_format?.value })
56
- : t('ASAP_ABBREVIATION', 'ASAP')}
57
- </>
58
- )}
59
- {
60
- variant === 'delivery' && (
61
- <DeliveryType>
62
- {(orderTypeList && orderTypeList[orderStatus?.options.type - 1]) || t('DELIVERY', 'Delivery')}
63
- </DeliveryType>
64
- )
65
- }
66
- </Container>
67
- {
68
- props.afterComponents?.map((AfterComponent, i) => (
69
- <AfterComponent key={i} {...props} />))
70
- }
71
- {
72
- props.afterElements?.map((AfterElement, i) => (
73
- <React.Fragment key={i}>
74
- {AfterElement}
75
- </React.Fragment>))
76
- }
77
- </>
56
+ </Container>
78
57
  )
79
58
  }
@@ -5,9 +5,7 @@ export const Container = styled.div`
5
5
 
6
6
  ${({ variant }) => variant === 'cart' && css`
7
7
  > span {
8
- cursor: pointer;
9
- height: 20px;
10
- padding: 10px 9px;
8
+ padding: 10px;
11
9
  display: flex;
12
10
  align-items: center;
13
11
  background: ${props => props.theme.colors.primary};
@@ -21,7 +19,7 @@ export const Container = styled.div`
21
19
  margin-right: 10px;
22
20
  ` : css`
23
21
  margin-left: 10px;
24
- `}
22
+ `}
25
23
  }
26
24
  svg {
27
25
  font-size: 17px;