ordering-ui-external 10.10.22 → 11.0.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 (49) hide show
  1. package/_bundles/{7.ordering-ui.912d728f17fd4dc8bb87.js → 7.ordering-ui.fa5f19340751cb2d73a3.js} +1 -1
  2. package/_bundles/{ordering-ui.912d728f17fd4dc8bb87.js → ordering-ui.fa5f19340751cb2d73a3.js} +2 -2
  3. package/_modules/components/BusinessProductsList/index.js +15 -4
  4. package/_modules/themes/callcenterOriginal/src/components/CartPopover/styles.js +1 -1
  5. package/_modules/themes/callcenterOriginal/src/components/Header/index.js +0 -1
  6. package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
  7. package/_modules/themes/five/src/components/BusinessProductsList/SubcategoriesComponent/index.js +57 -0
  8. package/_modules/themes/five/src/components/BusinessProductsList/index.js +21 -63
  9. package/_modules/themes/five/src/components/Cart/index.js +1 -1
  10. package/_modules/themes/five/src/components/HighestRated/index.js +40 -7
  11. package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
  12. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +4 -1
  13. package/_modules/themes/five/src/components/OrderDetails/index.js +2 -1
  14. package/_modules/themes/five/src/components/ProductForm/index.js +2 -2
  15. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +14 -13
  16. package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +1 -1
  17. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +3 -2
  18. package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +3 -2
  19. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +7 -13
  20. package/package.json +2 -2
  21. package/src/components/BusinessProductsList/index.js +9 -1
  22. package/src/themes/callcenterOriginal/src/components/CartPopover/styles.js +1 -1
  23. package/src/themes/callcenterOriginal/src/components/Header/index.js +0 -1
  24. package/src/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
  25. package/src/themes/five/src/components/BusinessProductsList/SubcategoriesComponent/index.js +57 -0
  26. package/src/themes/five/src/components/BusinessProductsList/index.js +13 -64
  27. package/src/themes/five/src/components/Cart/index.js +1 -1
  28. package/src/themes/five/src/components/HighestRated/index.js +35 -1
  29. package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
  30. package/src/themes/five/src/components/OrderDetails/OrderEta.js +1 -1
  31. package/src/themes/five/src/components/OrderDetails/index.js +2 -1
  32. package/src/themes/five/src/components/ProductForm/index.js +2 -2
  33. package/src/themes/five/src/components/ProductOptionSubOption/index.js +11 -12
  34. package/src/themes/five/src/components/ProductOptionSubOption/styles.js +1 -1
  35. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +3 -2
  36. package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +3 -2
  37. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +12 -17
  38. package/template/pages/SignUpDriver/index.js +5 -1
  39. /package/_bundles/{0.ordering-ui.912d728f17fd4dc8bb87.js → 0.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  40. /package/_bundles/{1.ordering-ui.912d728f17fd4dc8bb87.js → 1.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  41. /package/_bundles/{2.ordering-ui.912d728f17fd4dc8bb87.js → 2.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  42. /package/_bundles/{4.ordering-ui.912d728f17fd4dc8bb87.js → 4.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  43. /package/_bundles/{5.ordering-ui.912d728f17fd4dc8bb87.js → 5.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  44. /package/_bundles/{6.ordering-ui.912d728f17fd4dc8bb87.js → 6.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  45. /package/_bundles/{7.ordering-ui.912d728f17fd4dc8bb87.js.LICENSE.txt → 7.ordering-ui.fa5f19340751cb2d73a3.js.LICENSE.txt} +0 -0
  46. /package/_bundles/{8.ordering-ui.912d728f17fd4dc8bb87.js → 8.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  47. /package/_bundles/{9.ordering-ui.912d728f17fd4dc8bb87.js → 9.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
  48. /package/_bundles/{ordering-ui.912d728f17fd4dc8bb87.js.LICENSE.txt → ordering-ui.fa5f19340751cb2d73a3.js.LICENSE.txt} +0 -0
  49. /package/template/{utils → Utils}/index.js +0 -0
@@ -27,7 +27,7 @@ import MdRadioButtonUnchecked from '@meronex/icons/md/MdRadioButtonUnchecked'
27
27
 
28
28
  const ProductOptionSubOptionPropsAreEqual = (prevProps, nextProps) => {
29
29
  return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) &&
30
- prevProps.pizzaType === nextProps.pizzaType &&
30
+ JSON.stringify(prevProps.pizzaState) === JSON.stringify(nextProps.pizzaState) &&
31
31
  prevProps.balance === nextProps.balance &&
32
32
  JSON.stringify(prevProps.productCart) === JSON.stringify(nextProps.productCart)
33
33
  }
@@ -44,9 +44,8 @@ const ProductOptionSubOptionUI = React.memo((props) => {
44
44
  changePosition,
45
45
  isSoldOut,
46
46
  setIsScrollAvailable,
47
- onChange,
48
- pizzaType,
49
- productCart
47
+ usePizzaValidation,
48
+ pizzaState
50
49
  } = props
51
50
 
52
51
  const disableIncrement = option?.limit_suboptions_by_max ? (balance === option?.max || state.quantity === suboption.max) : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
@@ -74,16 +73,18 @@ const ProductOptionSubOptionUI = React.memo((props) => {
74
73
  const handleSuboptionClick = () => {
75
74
  dirtyRef.current = true
76
75
  toggleSelect()
77
- if (balance === option?.max && option?.suboptions?.length > balance && !(option?.min === 1 && option?.max === 1) && !state.selected) {
76
+ const minMaxValidation = option?.with_half_option ? usePizzaValidation : (balance === option?.max && option?.suboptions?.length > balance && !(option?.min === 1 && option?.max === 1))
77
+ if (!state.selected && minMaxValidation) {
78
78
  setShowMessage(true)
79
79
  }
80
80
  }
81
81
 
82
82
  useEffect(() => {
83
- if (!(balance === option?.max && option?.suboptions?.length > balance && !(option?.min === 1 && option?.max === 1) && !state.selected)) {
83
+ const minMaxValidation = option?.with_half_option ? usePizzaValidation : (!state.selected && balance === option?.max && option?.suboptions?.length > balance && !(option?.min === 1 && option?.max === 1))
84
+ if (!minMaxValidation) {
84
85
  setShowMessage(false)
85
86
  }
86
- }, [balance])
87
+ }, [balance, pizzaState?.[`option:${option?.id}`]?.value])
87
88
 
88
89
  useEffect(() => {
89
90
  if (balance === option?.max && state?.selected && dirtyRef) {
@@ -95,10 +96,10 @@ const ProductOptionSubOptionUI = React.memo((props) => {
95
96
  }, [state?.selected])
96
97
 
97
98
  useEffect(() => {
98
- if (pizzaType === 'mitad y mitad' && option?.with_half_option) {
99
+ if (option?.with_half_option) {
99
100
  handlePosition({}, 'left')
100
101
  }
101
- }, [pizzaType, state?.selected, suboption?.id])
102
+ }, [state?.selected, suboption?.id])
102
103
 
103
104
  return (
104
105
  <>
@@ -155,20 +156,18 @@ const ProductOptionSubOptionUI = React.memo((props) => {
155
156
  <>
156
157
  <BsCircleHalf
157
158
  className={[
158
- pizzaType === 'center' ? 'disabled disable-clicks' : '',
159
159
  'reverse',
160
160
  state.selected && state.position === 'left' ? 'selected' : null].filter(classname => classname).join(' ')}
161
161
  onClick={(e) => handlePosition(e, 'left')}
162
162
  />
163
163
  <BsCircleFill
164
164
  className={[
165
- pizzaType === 'mitad y mitad' ? 'disabled' : '',
165
+ pizzaState?.[`option:${option?.id}`]?.value === option?.max ? 'disabled' : '',
166
166
  state.selected && state.position === 'whole' ? 'selected' : null].filter(classname => classname).join(' ')}
167
167
  onClick={(e) => handlePosition(e, 'whole')}
168
168
  />
169
169
  <BsCircleHalf
170
170
  className={[
171
- pizzaType === 'center' ? 'disabled disable-clicks' : '',
172
171
  state.selected && state.position === 'right' ? 'selected' : null].filter(classname => classname).join(' ')}
173
172
  onClick={(e) => handlePosition(e, 'right')}
174
173
  />
@@ -56,7 +56,7 @@ export const Text = styled.div`
56
56
  text-overflow: ellipsis;
57
57
  ${props => props.theme?.rtl && css`
58
58
  margin-left: 0;
59
- margin-right: 10px;
59
+ margin-right: 10px;
60
60
  `}
61
61
  }
62
62
 
@@ -54,7 +54,8 @@ const SignUpDriverUI = (props) => {
54
54
  saveCustomerUser,
55
55
  fieldsNotValid,
56
56
  signupData,
57
- enableReCaptcha
57
+ enableReCaptcha,
58
+ isDriverSignup
58
59
  } = props
59
60
 
60
61
  const theme = useTheme()
@@ -385,7 +386,7 @@ const SignUpDriverUI = (props) => {
385
386
  </FormInput>
386
387
  </FormSide>
387
388
  <Alert
388
- title={t('SIGN_UP_FOR_BUSINESS', 'Sign up for business')}
389
+ title={isDriverSignup ? t('SIGN_UP_FOR_DRIVER', 'Sign up for driver') : t('SIGN_UP_FOR_BUSINESS', 'Sign up for business')}
389
390
  content={alertState.content}
390
391
  acceptText={t('ACCEPT', 'Accept')}
391
392
  open={alertState.open}
@@ -52,7 +52,8 @@ const SignUpDriverUI = (props) => {
52
52
  saveCustomerUser,
53
53
  fieldsNotValid,
54
54
  signupData,
55
- enableReCaptcha
55
+ enableReCaptcha,
56
+ isDriverSignup
56
57
  } = props
57
58
 
58
59
  const theme = useTheme()
@@ -381,7 +382,7 @@ const SignUpDriverUI = (props) => {
381
382
  </FormInput>
382
383
  </FormSide>
383
384
  <Alert
384
- title={t('SIGN_UP_FOR_BUSINESS', 'Sign up for business')}
385
+ title={isDriverSignup ? t('SIGN_UP_FOR_DRIVER', 'Sign up for driver') : t('SIGN_UP_FOR_BUSINESS', 'Sign up for business')}
385
386
  content={alertState.content}
386
387
  acceptText={t('ACCEPT', 'Accept')}
387
388
  open={alertState.open}
@@ -22,13 +22,19 @@ import {
22
22
  QuantityContainer,
23
23
  RibbonBox,
24
24
  TitleWrapper,
25
- LastOrder,
26
- SkeletonCardInfo,
27
- SkeletonCardLogo
25
+ LastOrder
28
26
  } from './styles'
29
27
  import { Button } from '../../../../styles/Buttons'
30
28
 
31
- const SingleProductCardUI = (props) => {
29
+ const singleProductCardPropsAreEqual = (prevProps, nextProps) => {
30
+ return JSON.stringify(prevProps.product) === JSON.stringify(nextProps.product) &&
31
+ prevProps.isSkeleton === nextProps.isSkeleton &&
32
+ prevProps.isSoldOut === nextProps.isSoldOut &&
33
+ prevProps.isCartOnProductsList === nextProps.isCartOnProductsList &&
34
+ prevProps.productAddedToCartLength === nextProps.productAddedToCartLength
35
+ }
36
+
37
+ const SingleProductCardUI = React.memo((props) => {
32
38
  const {
33
39
  product,
34
40
  isSoldOut,
@@ -155,7 +161,7 @@ const SingleProductCardUI = (props) => {
155
161
  className='product-card'
156
162
  isShowAddButt={!useCustomFunctionality && !hideAddButton && !isSkeleton}
157
163
  >
158
- {isObservedValidation ? (
164
+ {isObservedValidation && (
159
165
  <div>
160
166
  {!useCustomFunctionality && (
161
167
  <>
@@ -230,17 +236,6 @@ const SingleProductCardUI = (props) => {
230
236
  <span style={{ fontSize: 16, fontWeight: 500 }}>{customText}</span>
231
237
  )}
232
238
  </div>
233
- ) : (
234
- <div>
235
- <SkeletonCardInfo>
236
- <Skeleton width={100} />
237
- <Skeleton width={100} />
238
- <Skeleton width={100} />
239
- </SkeletonCardInfo>
240
- <SkeletonCardLogo>
241
- <Skeleton height={75} width={75} />
242
- </SkeletonCardLogo>
243
- </div>
244
239
  )}
245
240
  {!useCustomFunctionality && !hideAddButton && !isSkeleton && (
246
241
  <Button outline color='primary' disabled={productAddedToCartLength && product?.maximum_per_order && productAddedToCartLength >= product?.maximum_per_order}>
@@ -320,7 +315,7 @@ const SingleProductCardUI = (props) => {
320
315
  />
321
316
  </>
322
317
  )
323
- }
318
+ }, singleProductCardPropsAreEqual)
324
319
 
325
320
  export const SingleProductCard = (props) => {
326
321
  const singleProductCardProps = {
@@ -3,10 +3,14 @@ import { SignUpDriver as SignUpDriverController } from '../../../src/themes/five
3
3
  import { HelmetTags } from '../../components/HelmetTags'
4
4
 
5
5
  export const SignUpDriver = (props) => {
6
+ const SignUpDriverProps = {
7
+ ...props,
8
+ isDriverSignup: true
9
+ }
6
10
  return (
7
11
  <>
8
12
  <HelmetTags page='signup_driver' />
9
- <SignUpDriverController {...props} />
13
+ <SignUpDriverController {...SignUpDriverProps} />
10
14
  </>
11
15
  )
12
16
  }
File without changes