ordering-ui-external 1.8.5 → 1.8.7

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 (20) hide show
  1. package/_bundles/{0.ordering-ui.c12070c3ccac5ea49732.js → 0.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  2. package/_bundles/{1.ordering-ui.c12070c3ccac5ea49732.js → 1.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  3. package/_bundles/{2.ordering-ui.c12070c3ccac5ea49732.js → 2.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  4. package/_bundles/{4.ordering-ui.c12070c3ccac5ea49732.js → 4.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  5. package/_bundles/{5.ordering-ui.c12070c3ccac5ea49732.js → 5.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  6. package/_bundles/{6.ordering-ui.c12070c3ccac5ea49732.js → 6.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  7. package/_bundles/{7.ordering-ui.c12070c3ccac5ea49732.js → 7.ordering-ui.60a6722d164d6e8ead44.js} +1 -1
  8. package/_bundles/{7.ordering-ui.c12070c3ccac5ea49732.js.LICENSE.txt → 7.ordering-ui.60a6722d164d6e8ead44.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.c12070c3ccac5ea49732.js → 8.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  10. package/_bundles/{9.ordering-ui.c12070c3ccac5ea49732.js → 9.ordering-ui.60a6722d164d6e8ead44.js} +0 -0
  11. package/_bundles/ordering-ui.60a6722d164d6e8ead44.js +2 -0
  12. package/_bundles/{ordering-ui.c12070c3ccac5ea49732.js.LICENSE.txt → ordering-ui.60a6722d164d6e8ead44.js.LICENSE.txt} +0 -0
  13. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
  14. package/_modules/themes/five/src/components/Cart/index.js +4 -24
  15. package/_modules/themes/five/src/components/UserFormDetails/index.js +1 -1
  16. package/package.json +2 -2
  17. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
  18. package/src/themes/five/src/components/Cart/index.js +17 -6
  19. package/src/themes/five/src/components/UserFormDetails/index.js +1 -1
  20. package/_bundles/ordering-ui.c12070c3ccac5ea49732.js +0 -2
@@ -371,7 +371,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
371
371
  businessList: businessesList.businesses,
372
372
  userLocation: orderState === null || orderState === void 0 ? void 0 : (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : (_orderState$options6$ = _orderState$options6.address) === null || _orderState$options6$ === void 0 ? void 0 : _orderState$options6$.location,
373
373
  setErrors: setMapErrors
374
- })), hasHighRatedBusiness && !props.franchiseId && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_HighestRated.HighestRated, {
374
+ })), !isChew && hasHighRatedBusiness && !props.franchiseId && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_HighestRated.HighestRated, {
375
375
  handleClickAddress: handleClickAddress,
376
376
  setHasHighRatedBusiness: setHasHighRatedBusiness,
377
377
  onBusinessClick: onBusinessClick,
@@ -20,7 +20,6 @@ var _useWindowSize = require("../../../../../hooks/useWindowSize");
20
20
  var _TaxInformation = require("../TaxInformation");
21
21
  var _Inputs = require("../../styles/Inputs");
22
22
  var _SpinnerLoader = require("../../../../../components/SpinnerLoader");
23
- var _CartStoresListing = require("../../../../franchise/src/components/CartStoresListing");
24
23
  var _DriverTips = require("../DriverTips");
25
24
  var _ServiceForm = require("../ServiceForm");
26
25
  var _styles = require("./styles");
@@ -95,6 +94,9 @@ var CartUI = function CartUI(props) {
95
94
  _useSite2 = _slicedToArray(_useSite, 1),
96
95
  site = _useSite2[0].site;
97
96
  var windowSize = (0, _useWindowSize.useWindowSize)();
97
+ var _useCustomer = (0, _orderingComponentsExternal.useCustomer)(),
98
+ _useCustomer2 = _slicedToArray(_useCustomer, 1),
99
+ user = _useCustomer2[0].user;
98
100
  var driverTipsOptions = typeof (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o = configs.driver_tip_options) === null || _configs$driver_tip_o === void 0 ? void 0 : _configs$driver_tip_o.value) === 'string' ? JSON.parse(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o2 = configs.driver_tip_options) === null || _configs$driver_tip_o2 === void 0 ? void 0 : _configs$driver_tip_o2.value) || [] : (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o3 = configs.driver_tip_options) === null || _configs$driver_tip_o3 === void 0 ? void 0 : _configs$driver_tip_o3.value) || [];
99
101
  var _useState = (0, _react.useState)({
100
102
  open: false,
@@ -133,7 +135,6 @@ var CartUI = function CartUI(props) {
133
135
  setIsUpselling = _useState14[1];
134
136
  var _useState15 = (0, _react.useState)(false),
135
137
  _useState16 = _slicedToArray(_useState15, 2),
136
- openChangeStore = _useState16[0],
137
138
  setOpenChangeStore = _useState16[1];
138
139
  var businessUrlTemplate = (site === null || site === void 0 ? void 0 : site.business_url_template) || '/store/:business_slug';
139
140
  var isCouponEnabled = validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie = validationFields.fields) === null || _validationFields$fie === void 0 ? void 0 : (_validationFields$fie2 = _validationFields$fie.checkout) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.coupon) === null || _validationFields$fie3 === void 0 ? void 0 : _validationFields$fie3.enabled;
@@ -267,7 +268,7 @@ var CartUI = function CartUI(props) {
267
268
  setConfirm(_objectSpread(_objectSpread({}, confirm), {}, {
268
269
  open: false
269
270
  }));
270
- handleRemoveOfferClick(id);
271
+ handleRemoveOfferClick(id, user === null || user === void 0 ? void 0 : user.id);
271
272
  }
272
273
  });
273
274
  };
@@ -587,27 +588,6 @@ var CartUI = function CartUI(props) {
587
588
  openUpselling: openUpselling,
588
589
  canOpenUpselling: canOpenUpselling,
589
590
  setCanOpenUpselling: setCanOpenUpselling
590
- })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
591
- width: "70%",
592
- title: t('CHANGE_STORE', 'Change store'),
593
- open: openChangeStore,
594
- padding: "20px",
595
- closeOnBackdrop: true,
596
- modalTitleStyle: {
597
- display: 'flex',
598
- justifyContent: 'center'
599
- },
600
- onClose: function onClose() {
601
- return setOpenChangeStore(false);
602
- }
603
- }, /*#__PURE__*/_react.default.createElement(_CartStoresListing.CartStoresListing, {
604
- isStore: isStore,
605
- pageChangeStore: "business",
606
- cartuuid: cart === null || cart === void 0 ? void 0 : cart.uuid,
607
- onClose: function onClose() {
608
- return setOpenChangeStore(false);
609
- },
610
- handleCustomStoreRedirect: handleStoreRedirect
611
591
  }))), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
612
592
  return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
613
593
  key: i
@@ -289,7 +289,7 @@ var UserFormDetailsUI = function UserFormDetailsUI(props) {
289
289
  (0, _react.useEffect)(function () {
290
290
  var _formState$changes9, _formState$changes10, _configs$verification2;
291
291
  if (isChanged && userPhoneNumber && isValidPhoneNumber && formState !== null && formState !== void 0 && (_formState$changes9 = formState.changes) !== null && _formState$changes9 !== void 0 && _formState$changes9.country_phone_code && formState !== null && formState !== void 0 && (_formState$changes10 = formState.changes) !== null && _formState$changes10 !== void 0 && _formState$changes10.cellphone && (configs === null || configs === void 0 ? void 0 : (_configs$verification2 = configs.verification_phone_required) === null || _configs$verification2 === void 0 ? void 0 : _configs$verification2.value) === '1') {
292
- setWillVerifyOtpState(true);
292
+ setWillVerifyOtpState && setWillVerifyOtpState(true);
293
293
  }
294
294
  }, [isValidPhoneNumber, userPhoneNumber, configs === null || configs === void 0 ? void 0 : (_configs$verification3 = configs.verification_phone_required) === null || _configs$verification3 === void 0 ? void 0 : _configs$verification3.value, isChanged]);
295
295
  (0, _react.useEffect)(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -85,7 +85,7 @@
85
85
  "libphonenumber-js": "^1.9.4",
86
86
  "lodash": "^4.17.19",
87
87
  "moment": "^2.29.4",
88
- "ordering-components-external": "1.7.1",
88
+ "ordering-components-external": "1.7.2",
89
89
  "polished": "^3.6.6",
90
90
  "react-bootstrap-icons": "^1.7.2",
91
91
  "react-calendar": "^3.3.1",
@@ -368,7 +368,7 @@ const BusinessesListingUI = (props) => {
368
368
  )}
369
369
  </>
370
370
  )}
371
- {hasHighRatedBusiness && !props.franchiseId && (
371
+ {!isChew && hasHighRatedBusiness && !props.franchiseId && (
372
372
  <HightestRatedWrapper>
373
373
  <Divider />
374
374
  <HighestRated
@@ -1,5 +1,16 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Cart as CartController, useOrder, useLanguage, useEvent, useUtils, useValidationFields, useConfig, useOrderingTheme, useSite } from 'ordering-components-external'
2
+ import {
3
+ Cart as CartController,
4
+ useOrder,
5
+ useLanguage,
6
+ useEvent,
7
+ useUtils,
8
+ useValidationFields,
9
+ useConfig,
10
+ useOrderingTheme,
11
+ useSite,
12
+ useCustomer
13
+ } from 'ordering-components-external'
3
14
  import { Button } from '../../styles/Buttons'
4
15
  import { ProductItemAccordion } from '../ProductItemAccordion'
5
16
  import { BusinessItemAccordion } from '../BusinessItemAccordion'
@@ -13,7 +24,6 @@ import { useWindowSize } from '../../../../../hooks/useWindowSize'
13
24
  import { TaxInformation } from '../TaxInformation'
14
25
  import { TextArea } from '../../styles/Inputs'
15
26
  import { SpinnerLoader } from '../../../../../components/SpinnerLoader'
16
- import { CartStoresListing } from '../../../../franchise/src/components/CartStoresListing'
17
27
  import { DriverTips } from '../DriverTips'
18
28
  import { ServiceForm } from '../ServiceForm'
19
29
  import {
@@ -69,6 +79,7 @@ const CartUI = (props) => {
69
79
  const [{ configs }] = useConfig()
70
80
  const [{ site }] = useSite()
71
81
  const windowSize = useWindowSize()
82
+ const [{ user }] = useCustomer()
72
83
 
73
84
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
74
85
  ? JSON.parse(configs?.driver_tip_options?.value) || []
@@ -81,7 +92,7 @@ const CartUI = (props) => {
81
92
  const [canOpenUpselling, setCanOpenUpselling] = useState(false)
82
93
  const [openTaxModal, setOpenTaxModal] = useState({ open: false, tax: null })
83
94
  const [isUpselling, setIsUpselling] = useState(false)
84
- const [openChangeStore, setOpenChangeStore] = useState(false)
95
+ const [, setOpenChangeStore] = useState(false)
85
96
 
86
97
  const businessUrlTemplate = site?.business_url_template || '/store/:business_slug'
87
98
 
@@ -198,7 +209,7 @@ const CartUI = (props) => {
198
209
  title: t('OFFER', 'Offer'),
199
210
  handleOnAccept: () => {
200
211
  setConfirm({ ...confirm, open: false })
201
- handleRemoveOfferClick(id)
212
+ handleRemoveOfferClick(id, user?.id)
202
213
  }
203
214
  })
204
215
  }
@@ -622,7 +633,7 @@ const CartUI = (props) => {
622
633
  )}
623
634
  </CartSticky>
624
635
 
625
- <Modal
636
+ {/* <Modal
626
637
  width='70%'
627
638
  title={t('CHANGE_STORE', 'Change store')}
628
639
  open={openChangeStore}
@@ -638,7 +649,7 @@ const CartUI = (props) => {
638
649
  onClose={() => setOpenChangeStore(false)}
639
650
  handleCustomStoreRedirect={handleStoreRedirect}
640
651
  />
641
- </Modal>
652
+ </Modal> */}
642
653
 
643
654
  </CartContainer>
644
655
  {props.afterComponents?.map((AfterComponent, i) => (
@@ -260,7 +260,7 @@ export const UserFormDetailsUI = (props) => {
260
260
 
261
261
  useEffect(() => {
262
262
  if (isChanged && userPhoneNumber && isValidPhoneNumber && formState?.changes?.country_phone_code && formState?.changes?.cellphone && configs?.verification_phone_required?.value === '1') {
263
- setWillVerifyOtpState(true)
263
+ setWillVerifyOtpState && setWillVerifyOtpState(true)
264
264
  }
265
265
  }, [isValidPhoneNumber, userPhoneNumber, configs?.verification_phone_required?.value, isChanged])
266
266