ordering-ui-external 13.0.0 → 13.0.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.
@@ -23,6 +23,7 @@ var _MultiCartsPaymethodsAndWallets = require("../MultiCartsPaymethodsAndWallets
23
23
  var _CouponControl = require("../../../../../components/CouponControl");
24
24
  var _styles = require("./styles");
25
25
  var _DriverTips = require("../DriverTips");
26
+ var _styledComponents = require("styled-components");
26
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
28
  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); }
28
29
  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 && Object.prototype.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; }
@@ -45,7 +46,7 @@ var mapConfigs = {
45
46
  }
46
47
  };
47
48
  var MultiCheckoutUI = function MultiCheckoutUI(props) {
48
- var _Object$values, _cartGroup$result, _paymethodSelected$pa, _cardList$cards, _configs$checkout_mul, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _configs$multi_busine, _configs$driver_tip_o4, _configs$driver_tip_o5, _cartGroup$result2, _loyaltyPlansState$re, _creditPointPlan$busi, _creditPointPlan$busi2, _loyaltyPlansState$re2, _creditPointGeneralPl, _creditPointGeneralPl2, _configs$cash_wallet, _configs$wallet_enabl, _configs$wallet_cash_, _configs$wallet_credi, _theme, _theme$split, _orderState$options6, _configs$google_maps_, _customerState$user, _cartGroup$result3, _cartGroup$result4, _validationFields$fie, _configs$multi_busine2, _validationFields$fie2, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _openCarts$, _configs$multi_busine6, _configs$multi_busine7, _customerState$user2;
49
+ var _Object$values, _cartGroup$result, _paymethodSelected$pa, _cardList$cards, _configs$checkout_mul, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _configs$multi_busine, _configs$driver_tip_o4, _configs$driver_tip_o5, _cartGroup$result2, _loyaltyPlansState$re, _creditPointPlan$busi, _creditPointPlan$busi2, _loyaltyPlansState$re2, _creditPointGeneralPl, _creditPointGeneralPl2, _configs$cash_wallet, _configs$wallet_enabl, _configs$wallet_cash_, _configs$wallet_credi, _theme$colors, _theme$colors$split, _orderState$options6, _configs$google_maps_, _customerState$user, _cartGroup$result3, _cartGroup$result4, _validationFields$fie, _configs$multi_busine2, _validationFields$fie2, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _openCarts$, _configs$multi_busine6, _configs$multi_busine7, _customerState$user2;
49
50
  var placing = props.placing,
50
51
  isCustomerMode = props.isCustomerMode,
51
52
  openCarts = props.openCarts,
@@ -90,6 +91,7 @@ var MultiCheckoutUI = function MultiCheckoutUI(props) {
90
91
  var _useToast = (0, _orderingComponentsExternal.useToast)(),
91
92
  _useToast2 = _slicedToArray(_useToast, 2),
92
93
  showToast = _useToast2[1].showToast;
94
+ var theme = (0, _styledComponents.useTheme)();
93
95
  var _useState = (0, _react.useState)([]),
94
96
  _useState2 = _slicedToArray(_useState, 2),
95
97
  cardList = _useState2[0],
@@ -178,7 +180,7 @@ var MultiCheckoutUI = function MultiCheckoutUI(props) {
178
180
  });
179
181
  }, [checkoutFieldsState, orderState === null || orderState === void 0 ? void 0 : orderState.options]);
180
182
  var hexTest = /[0-9A-Fa-f]{6}/g;
181
- var primaryColor = (_theme = theme) === null || _theme === void 0 || (_theme = _theme.colors) === null || _theme === void 0 || (_theme = _theme.primary) === null || _theme === void 0 || (_theme$split = _theme.split) === null || _theme$split === void 0 || (_theme$split = _theme$split.call(_theme, '#')) === null || _theme$split === void 0 ? void 0 : _theme$split[1];
183
+ var primaryColor = theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 || (_theme$colors = _theme$colors.primary) === null || _theme$colors === void 0 || (_theme$colors$split = _theme$colors.split) === null || _theme$colors$split === void 0 || (_theme$colors$split = _theme$colors$split.call(_theme$colors, '#')) === null || _theme$colors$split === void 0 ? void 0 : _theme$colors$split[1];
182
184
  var accumulationRateBusiness = function accumulationRateBusiness(businessId) {
183
185
  var _loyalBusinessAvailab, _loyalBusinessAvailab2, _creditPointGeneralPl3;
184
186
  var value = (_loyalBusinessAvailab = loyalBusinessAvailable === null || loyalBusinessAvailable === void 0 || (_loyalBusinessAvailab2 = loyalBusinessAvailable.find(function (loyal) {
@@ -370,7 +372,8 @@ var MultiCheckoutUI = function MultiCheckoutUI(props) {
370
372
  openCarts: openCarts,
371
373
  apiKey: configs === null || configs === void 0 || (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value,
372
374
  mapConfigs: mapConfigs,
373
- isCustomerMode: isCustomerMode
375
+ isCustomerMode: isCustomerMode,
376
+ primaryColor: hexTest.test(primaryColor || '') ? "0x".concat(primaryColor) : 'red'
374
377
  }), /*#__PURE__*/_react.default.createElement(_styles.UserDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperUserDetails, null, user !== null && user !== void 0 && user.guest_id && !allowedGuest ? /*#__PURE__*/_react.default.createElement(_styles.AuthButtonList, null, /*#__PURE__*/_react.default.createElement("h2", null, t('CUSTOMER_DETAILS', 'Customer details')), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
375
378
  color: "primary",
376
379
  onClick: function onClick() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "13.0.0",
3
+ "version": "13.0.1",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -46,6 +46,7 @@ import {
46
46
  AuthButtonList
47
47
  } from './styles'
48
48
  import { DriverTips } from '../DriverTips'
49
+ import { useTheme } from 'styled-components'
49
50
 
50
51
  const mapConfigs = {
51
52
  mapZoom: 16,
@@ -84,7 +85,7 @@ const MultiCheckoutUI = (props) => {
84
85
  const [orderState] = useOrder()
85
86
  const history = useHistory()
86
87
  const [, { showToast }] = useToast()
87
-
88
+ const theme = useTheme()
88
89
  const [cardList, setCardList] = useState([])
89
90
  const [userErrors, setUserErrors] = useState([])
90
91
  const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(null)
@@ -316,6 +317,7 @@ const MultiCheckoutUI = (props) => {
316
317
  apiKey={configs?.google_maps_api_key?.value}
317
318
  mapConfigs={mapConfigs}
318
319
  isCustomerMode={isCustomerMode}
320
+ primaryColor={hexTest.test(primaryColor || '') ? `0x${primaryColor}` : 'red'}
319
321
  />
320
322
 
321
323
  <UserDetailsContainer>