ordering-ui-external 1.3.2 → 1.4.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 (133) hide show
  1. package/_bundles/0.ordering-ui.eec38d66166bc4458215.js +1 -0
  2. package/_bundles/{0.ordering-ui.8d3ec9f208550df10621.js → 1.ordering-ui.eec38d66166bc4458215.js} +1 -1
  3. package/_bundles/{1.ordering-ui.8d3ec9f208550df10621.js → 2.ordering-ui.eec38d66166bc4458215.js} +1 -1
  4. package/_bundles/{4.ordering-ui.8d3ec9f208550df10621.js → 4.ordering-ui.eec38d66166bc4458215.js} +1 -1
  5. package/_bundles/{5.ordering-ui.8d3ec9f208550df10621.js → 5.ordering-ui.eec38d66166bc4458215.js} +1 -1
  6. package/_bundles/{6.ordering-ui.8d3ec9f208550df10621.js → 6.ordering-ui.eec38d66166bc4458215.js} +1 -1
  7. package/_bundles/7.ordering-ui.eec38d66166bc4458215.js +2 -0
  8. package/_bundles/{7.ordering-ui.8d3ec9f208550df10621.js.LICENSE.txt → 7.ordering-ui.eec38d66166bc4458215.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.8d3ec9f208550df10621.js → 8.ordering-ui.eec38d66166bc4458215.js} +1 -1
  10. package/_bundles/{9.ordering-ui.8d3ec9f208550df10621.js → 9.ordering-ui.eec38d66166bc4458215.js} +1 -1
  11. package/_bundles/ordering-ui.eec38d66166bc4458215.js +2 -0
  12. package/_bundles/{ordering-ui.8d3ec9f208550df10621.js.LICENSE.txt → ordering-ui.eec38d66166bc4458215.js.LICENSE.txt} +0 -0
  13. package/_modules/themes/five/index.js +7 -0
  14. package/_modules/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +47 -0
  15. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +14 -29
  16. package/_modules/themes/five/src/components/BusinessProductsList/index.js +10 -6
  17. package/_modules/themes/five/src/components/BusinessProductsList/styles.js +8 -7
  18. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +1 -1
  19. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +3 -3
  20. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +4 -1
  21. package/_modules/themes/five/src/components/Cart/index.js +3 -1
  22. package/_modules/themes/five/src/components/Checkout/index.js +52 -39
  23. package/_modules/themes/five/src/components/Favorite/index.js +16 -2
  24. package/_modules/themes/five/src/components/FavoriteList/index.js +15 -1
  25. package/_modules/themes/five/src/components/Header/index.js +2 -2
  26. package/_modules/themes/five/src/components/Header/styles.js +5 -3
  27. package/_modules/themes/five/src/components/Modal/index.js +2 -2
  28. package/_modules/themes/five/src/components/Modal/styles.js +8 -4
  29. package/_modules/themes/five/src/components/MyOrders/index.js +9 -2
  30. package/_modules/themes/five/src/components/OrderDetails/ActionsSection.js +1 -0
  31. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +10 -40
  32. package/_modules/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/index.js +25 -0
  33. package/_modules/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/styles.js +19 -0
  34. package/_modules/themes/five/src/components/OrdersOption/index.js +16 -13
  35. package/_modules/themes/five/src/components/ProductForm/index.js +5 -5
  36. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
  37. package/_modules/themes/five/src/components/SidebarMenu/index.js +39 -17
  38. package/_modules/themes/five/src/components/SingleProductCard/styles.js +1 -1
  39. package/_modules/themes/five/src/components/SingleProfessionalCard/index.js +95 -0
  40. package/_modules/themes/five/src/components/SingleProfessionalCard/styles.js +47 -0
  41. package/_modules/themes/five/src/styles/Selects/index.js +1 -1
  42. package/index-template.js +28 -5
  43. package/package.json +6 -3
  44. package/src/themes/five/index.js +2 -0
  45. package/src/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +44 -0
  46. package/src/themes/five/src/components/BusinessListingSearch/index.js +8 -30
  47. package/src/themes/five/src/components/BusinessProductsList/index.js +29 -22
  48. package/src/themes/five/src/components/BusinessProductsList/styles.js +25 -2
  49. package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -1
  50. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +4 -3
  51. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
  52. package/src/themes/five/src/components/Cart/index.js +2 -0
  53. package/src/themes/five/src/components/Checkout/index.js +22 -14
  54. package/src/themes/five/src/components/Favorite/index.js +19 -1
  55. package/src/themes/five/src/components/FavoriteList/index.js +24 -0
  56. package/src/themes/five/src/components/Header/index.js +11 -8
  57. package/src/themes/five/src/components/Header/styles.js +5 -0
  58. package/src/themes/five/src/components/Modal/index.js +9 -6
  59. package/src/themes/five/src/components/Modal/styles.js +15 -1
  60. package/src/themes/five/src/components/MyOrders/index.js +11 -1
  61. package/src/themes/five/src/components/OrderDetails/ActionsSection.js +1 -0
  62. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -29
  63. package/src/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/index.js +32 -0
  64. package/src/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/styles.js +38 -0
  65. package/src/themes/five/src/components/OrdersOption/index.js +18 -9
  66. package/src/themes/five/src/components/ProductForm/index.js +5 -5
  67. package/src/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
  68. package/src/themes/five/src/components/SidebarMenu/index.js +98 -42
  69. package/src/themes/five/src/components/SingleProductCard/styles.js +5 -1
  70. package/src/themes/five/src/components/SingleProfessionalCard/index.js +82 -0
  71. package/src/themes/five/src/components/SingleProfessionalCard/styles.js +92 -0
  72. package/src/themes/five/src/styles/Selects/index.js +1 -0
  73. package/template/Utils/index.js +4 -0
  74. package/template/app.js +554 -143
  75. package/template/assets/images/business-hero.jpg +0 -0
  76. package/template/assets/images/business-signup-background.png +0 -0
  77. package/template/assets/images/business_signup.png +0 -0
  78. package/template/assets/images/congratulation_approval.png +0 -0
  79. package/template/assets/images/congratulation_no_approval.png +0 -0
  80. package/template/assets/images/credit.png +0 -0
  81. package/template/assets/images/delivery-types/curbside.jpg +0 -0
  82. package/template/assets/images/delivery-types/delivery.jpg +0 -0
  83. package/template/assets/images/delivery-types/drive_thru.jpg +0 -0
  84. package/template/assets/images/delivery-types/eat_in.jpg +0 -0
  85. package/template/assets/images/delivery-types/pickup.jpg +0 -0
  86. package/template/assets/images/driver-signup-background.png +0 -0
  87. package/template/assets/images/driver-signup-hero.png +0 -0
  88. package/template/assets/images/driver_congratulation_approval.png +0 -0
  89. package/template/assets/images/driver_congratulation_no_approval.png +0 -0
  90. package/template/assets/images/driver_signup.png +0 -0
  91. package/template/assets/images/home-hero.jpg +0 -0
  92. package/template/assets/images/loyalty_level.png +0 -0
  93. package/template/assets/images/mastercard.png +0 -0
  94. package/template/assets/images/not-found.svg +94 -1
  95. package/template/assets/images/not-network.svg +226 -1
  96. package/template/assets/images/visa.png +0 -0
  97. package/template/components/HelmetTags/index.js +5 -4
  98. package/template/components/ListenPageChanges/index.js +25 -12
  99. package/template/components/ScrollToTop/index.js +4 -0
  100. package/template/config.js +14 -0
  101. package/template/config.json +1 -0
  102. package/template/helmetdata.json +91 -28
  103. package/template/pages/AddressList/index.js +34 -0
  104. package/template/pages/AddressList/styles.js +43 -0
  105. package/template/pages/BusinessListingSearch/index.js +106 -0
  106. package/template/pages/BusinessProductsList/index.js +152 -29
  107. package/template/pages/BusinessesList/index.js +17 -6
  108. package/template/pages/Checkout/index.js +14 -4
  109. package/template/pages/Favorite/index.js +12 -0
  110. package/template/pages/Help/index.js +7 -2
  111. package/template/pages/Home/index.js +58 -36
  112. package/template/pages/Home/styles.js +14 -0
  113. package/template/pages/MessagesList/index.js +19 -0
  114. package/template/pages/MultiCheckout/index.js +26 -0
  115. package/template/pages/MultiOrdersDetails/index.js +21 -0
  116. package/template/pages/MyOrders/index.js +87 -3
  117. package/template/pages/OrderDetails/index.js +12 -2
  118. package/template/pages/Profile/index.js +16 -3
  119. package/template/pages/Promotions/index.js +13 -0
  120. package/template/pages/ResetPassword/index.js +15 -9
  121. package/template/pages/SessionsList/index.js +12 -0
  122. package/template/pages/SignUpBusiness/index.js +12 -0
  123. package/template/pages/SignUpDriver/index.js +12 -0
  124. package/template/pages/UserVerification/index.js +12 -0
  125. package/template/pages/Wallets/index.js +12 -0
  126. package/template/service-worker.js +72 -0
  127. package/template/theme.json +27 -51
  128. package/_bundles/3.ordering-ui.8d3ec9f208550df10621.js +0 -1
  129. package/_bundles/7.ordering-ui.8d3ec9f208550df10621.js +0 -2
  130. package/_bundles/ordering-ui.8d3ec9f208550df10621.js +0 -2
  131. package/template/assets/images/exclamation.svg +0 -3
  132. package/template/assets/images/order-creating.png +0 -0
  133. package/template/assets/images/order-sucess.png +0 -0
@@ -125,6 +125,7 @@ const CheckoutUI = (props) => {
125
125
  placing ||
126
126
  errorCash ||
127
127
  loading ||
128
+ (options?.type === 3 && !(cartState?.cart?.spot_number || cart?.spot_number)) ||
128
129
  !cart?.valid_maximum ||
129
130
  (!cart?.valid_minimum && !(cart?.discount_type === 1 && cart?.discount_rate === 100)) ||
130
131
  // (((placeSpotTypes.includes(options?.type) && !cart?.place) && hasBusinessPlaces)) ||
@@ -507,11 +508,11 @@ const CheckoutUI = (props) => {
507
508
  </WarningText>
508
509
  )}
509
510
 
510
- {/* {placeSpotTypes.includes(options?.type) && !cart?.place && hasBusinessPlaces && (
511
+ {options?.type === 3 && !cart?.spot_number && (
511
512
  <WarningText>
512
513
  {t('WARNING_PLACE_SPOT', 'Please, select your spot to place order.')}
513
514
  </WarningText>
514
- )} */}
515
+ )}
515
516
 
516
517
  {options.type === 1 &&
517
518
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
@@ -624,19 +625,26 @@ export const Checkout = (props) => {
624
625
 
625
626
  const getOrder = async (cartId) => {
626
627
  try {
627
- setCartState({ ...cartState, loading: true })
628
+ let result = {}
629
+ const cart = cartsWithProducts.find(cart => cart.uuid === cartId)
628
630
  const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
629
- const url = userCustomer
630
- ? `${ordering.root}/carts/${cartId}?user_id=${userCustomer?.id}`
631
- : `${ordering.root}/carts/${cartId}`
632
- const response = await fetch(url, {
633
- method: 'GET',
634
- headers: {
635
- 'Content-Type': 'application/json',
636
- Authorization: `Bearer ${token}`
637
- }
638
- })
639
- const { result } = await response.json()
631
+ if (cart && !userCustomer) {
632
+ result = { ...cart }
633
+ } else {
634
+ setCartState({ ...cartState, loading: true })
635
+ const url = userCustomer
636
+ ? `${ordering.root}/carts/${cartId}?user_id=${userCustomer?.id}`
637
+ : `${ordering.root}/carts/${cartId}`
638
+ const response = await fetch(url, {
639
+ method: 'GET',
640
+ headers: {
641
+ 'Content-Type': 'application/json',
642
+ Authorization: `Bearer ${token}`
643
+ }
644
+ })
645
+ const content = await response.json()
646
+ result = content.result
647
+ }
640
648
 
641
649
  if (result.status === 1 && result.order?.uuid) {
642
650
  handleOrderRedirect(result.order.uuid)
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { useLanguage, useOrder } from 'ordering-components-external'
2
+ import { useLanguage, useOrder, useOrderingTheme } from 'ordering-components-external'
3
3
  import { FavoriteList } from '../FavoriteList'
4
4
  import { Tabs } from '../../styles/Tabs'
5
5
  import {
@@ -12,7 +12,9 @@ import {
12
12
 
13
13
  export const Favorite = (props) => {
14
14
  const [, t] = useLanguage()
15
+ const [orderingTheme] = useOrderingTheme()
15
16
  const [orderState] = useOrder()
17
+ const layout = orderingTheme?.theme?.favorite?.components?.layout?.type || 'original'
16
18
 
17
19
  const [tabSelected, setTabSelected] = useState('businesses')
18
20
 
@@ -44,6 +46,15 @@ export const Favorite = (props) => {
44
46
  {item?.name}
45
47
  </Tab>
46
48
  ))}
49
+ {layout === 'appointments' && (
50
+ <Tab
51
+ borderBottom
52
+ active={tabSelected === 'professionals'}
53
+ onClick={() => setTabSelected('professionals')}
54
+ >
55
+ {t('PROFESSIONALS', 'Professionals')}
56
+ </Tab>
57
+ )}
47
58
  </Tabs>
48
59
  </TabsContainer>
49
60
  <ContentWrapper>
@@ -70,6 +81,13 @@ export const Favorite = (props) => {
70
81
  isOrder
71
82
  />
72
83
  )}
84
+ {tabSelected === 'professionals' && (
85
+ <FavoriteList
86
+ favoriteURL='favorite_users'
87
+ originalURL='users'
88
+ isProfessional
89
+ />
90
+ )}
73
91
  </ContentWrapper>
74
92
  </FavoritesContainer>
75
93
  {props.afterComponents?.map((AfterComponent, i) => (
@@ -11,6 +11,7 @@ import { SingleProductCard } from '../SingleProductCard'
11
11
  import { useTheme } from 'styled-components'
12
12
  import { SingleOrderCard } from '../SingleOrderCard'
13
13
  import { checkSiteUrl } from '../../../../../utils'
14
+ import { SingleProfessionalCard } from '../SingleProfessionalCard'
14
15
 
15
16
  import {
16
17
  Container,
@@ -29,6 +30,7 @@ const FavoriteListUI = (props) => {
29
30
  isBusiness,
30
31
  isProduct,
31
32
  isOrder,
33
+ isProfessional,
32
34
  handleReorder,
33
35
  reorderState
34
36
  } = props
@@ -323,6 +325,28 @@ const FavoriteListUI = (props) => {
323
325
  )}
324
326
  </>
325
327
  )}
328
+ {isProfessional && (
329
+ <>
330
+ {
331
+ !favoriteList?.loading && favoriteList?.favorites?.map((professional, i) => (
332
+ <SingleProfessionalCard
333
+ key={i}
334
+ professional={professional}
335
+ handleUpdateProfessionals={handleUpdateFavoriteList}
336
+ />
337
+ ))
338
+ }
339
+ {favoriteList?.loading && (
340
+ [...Array(5).keys()].map(i => (
341
+ <SingleProfessionalCard
342
+ key={i}
343
+ professional={{}}
344
+ isSkeleton
345
+ />
346
+ ))
347
+ )}
348
+ </>
349
+ )}
326
350
  {!favoriteList?.loading && pagination?.totalPages && pagination?.currentPage < pagination?.totalPages && (
327
351
  <ReadMoreCard>
328
352
  <Button
@@ -24,7 +24,8 @@ import {
24
24
  AddressMenu,
25
25
  MomentMenu,
26
26
  FarAwayMessage,
27
- Divider
27
+ Divider,
28
+ AddressFormWrapper
28
29
  } from './styles'
29
30
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
30
31
  import { useOnlineStatus } from '../../../../../hooks/useOnlineStatus'
@@ -433,13 +434,15 @@ export const Header = (props) => {
433
434
  isCustomerMode={isCustomerMode}
434
435
  />
435
436
  ) : (
436
- <AddressForm
437
- useValidationFileds
438
- address={orderState?.options?.address || {}}
439
- onCancel={() => setModalIsOpen(false)}
440
- onSaveAddress={() => setModalIsOpen(false)}
441
- isCustomerMode={isCustomerMode}
442
- />
437
+ <AddressFormWrapper>
438
+ <AddressForm
439
+ useValidationFileds
440
+ address={orderState?.options?.address || {}}
441
+ onCancel={() => setModalIsOpen(false)}
442
+ onSaveAddress={() => setModalIsOpen(false)}
443
+ isCustomerMode={isCustomerMode}
444
+ />
445
+ </AddressFormWrapper>
443
446
  )
444
447
  )}
445
448
  {modalSelected === 'moment' && (
@@ -385,3 +385,8 @@ export const Divider = styled.div`
385
385
  border: 1px solid #DEE2E6;
386
386
  height: 100%;
387
387
  `
388
+ export const AddressFormWrapper = styled.div`
389
+ @media (min-width: 450px) {
390
+ margin-top: 20px;
391
+ }
392
+ `
@@ -7,7 +7,8 @@ import {
7
7
  ModalTitle,
8
8
  ModalIcon,
9
9
  ModalHeader,
10
- ModalBackHeader
10
+ ModalBackHeader,
11
+ ModalIconWrapper
11
12
  } from './styles'
12
13
 
13
14
  import { Button } from '../../styles/Buttons'
@@ -68,11 +69,13 @@ const ModalUI = (props) => {
68
69
  <ModalBackHeader />
69
70
  )}
70
71
  {!hideCloseDefault && (
71
- <ModalIcon isProductForm={isProductForm}>
72
- {
73
- (authModal && onRemove) ? <MdClose onClick={() => onRemove()} /> : <MdClose onClick={() => onClose()} />
74
- }
75
- </ModalIcon>
72
+ <ModalIconWrapper>
73
+ <ModalIcon isProductForm={isProductForm}>
74
+ {
75
+ (authModal && onRemove) ? <MdClose onClick={() => onRemove()} /> : <MdClose onClick={() => onClose()} />
76
+ }
77
+ </ModalIcon>
78
+ </ModalIconWrapper>
76
79
  )}
77
80
  <ModalHeader>
78
81
  {title && (
@@ -86,7 +86,7 @@ export const ModalActions = styled.div`
86
86
  `
87
87
  export const ModalHeader = styled.div`
88
88
  display: flex;
89
- margin-top: 30px;
89
+ margin-top: 40px;
90
90
 
91
91
  @media(min-width: 450px){
92
92
  margin-top: 0;
@@ -172,3 +172,17 @@ export const ModalBackHeader = styled.div`
172
172
  display: none;
173
173
  }
174
174
  `
175
+ export const ModalIconWrapper = styled.div`
176
+ position: fixed;
177
+ top: 0;
178
+ left: 0;
179
+ width: 100%;
180
+ background-color: ${props => props.theme.colors.backgroundPage};
181
+ z-index: 100;
182
+ height: 70px;
183
+
184
+ @media (min-width: 450px) {
185
+ position: initial;
186
+ height: initial;
187
+ }
188
+ `
@@ -48,7 +48,7 @@ export const MyOrders = (props) => {
48
48
  { key: 'products', value: t('PRODUCTS', 'Products') }
49
49
  ]
50
50
 
51
- const notOrderOptions = ['business', 'products']
51
+ const notOrderOptions = ['business', 'products', 'professionals']
52
52
  const allEmpty = (isEmptyActive && isEmptyPast && isEmptyPreorder) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
53
53
 
54
54
  const handleChangeFilter = (key) => {
@@ -87,6 +87,15 @@ export const MyOrders = (props) => {
87
87
  {option?.value}
88
88
  </Tab>
89
89
  ))}
90
+ {layout === 'appointments' && (
91
+ <Tab
92
+ onClick={() => setSelectedOption('professionals')}
93
+ active={selectedOption === 'professionals'}
94
+ borderBottom
95
+ >
96
+ {t('PROFESSIONALS', 'Professionals')}
97
+ </Tab>
98
+ )}
90
99
  </Tabs>
91
100
  </MyOrdersMenuContainer>
92
101
  )}
@@ -165,6 +174,7 @@ export const MyOrders = (props) => {
165
174
  horizontal
166
175
  isBusiness={selectedOption === 'business'}
167
176
  isProducts={selectedOption === 'products'}
177
+ isProfessionals={selectedOption === 'professionals'}
168
178
  activeOrders
169
179
  pastOrders
170
180
  preOrders
@@ -33,6 +33,7 @@ export const ActionsSection = (props) => {
33
33
  ? setUnreadAlert({ ...unreadAlert, business: false })
34
34
  : setUnreadAlert({ ...unreadAlert, driver: false })
35
35
  }
36
+ window.scrollTo(0, 0)
36
37
  }
37
38
 
38
39
  return (
@@ -1,19 +1,17 @@
1
- import React, { useEffect } from 'react'
2
- import { BusinessList as BusinessListController, useOrder } from 'ordering-components-external'
1
+ import React from 'react'
2
+ import { useOrder } from 'ordering-components-external'
3
3
  import { BusinessController } from '../../BusinessController'
4
4
  import { AutoScroll } from '../../AutoScroll'
5
5
  import { BusinessList, BusinessListWrapper } from './styles'
6
6
  import { useWindowSize } from '../../../../../../hooks/useWindowSize'
7
- export const PreviousBusinessOrderedUI = (props) => {
7
+
8
+ export const PreviousBusinessOrdered = (props) => {
8
9
  const {
9
- businessesList,
10
10
  isCustomLayout,
11
11
  isCustomerMode,
12
- setBusinessLoading,
13
12
  onRedirectPage,
14
- businessId,
15
- isLoadingOrders,
16
- handleUpdateBusinessList
13
+ handleUpdateBusinessList,
14
+ businesses
17
15
  } = props
18
16
 
19
17
  const [orderState] = useOrder()
@@ -21,20 +19,13 @@ export const PreviousBusinessOrderedUI = (props) => {
21
19
  const onBusinessClick = (business) => {
22
20
  onRedirectPage({ page: 'business', params: { store: business.slug } })
23
21
  }
24
- useEffect(() => {
25
- if (businessesList?.loading && businessesList?.businesses?.length === 0) {
26
- setBusinessLoading(true)
27
- } else {
28
- setBusinessLoading(false)
29
- }
30
- }, [businessesList?.loading])
31
22
 
32
23
  return (
33
- <BusinessListWrapper isLoading={businessesList?.loading || businessesList.businesses?.length === 0 || isLoadingOrders}>
24
+ <BusinessListWrapper isLoading={businesses?.loading}>
34
25
  <BusinessList>
35
26
  <AutoScroll scrollId='searchlistorder'>
36
27
  {
37
- businessesList.businesses?.filter(business => businessId?.includes(business?.id))?.map((business, i) => (
28
+ businesses?.result?.map((business, i) => (
38
29
  <BusinessController
39
30
  key={business.id}
40
31
  className='card'
@@ -63,15 +54,3 @@ export const PreviousBusinessOrderedUI = (props) => {
63
54
  </BusinessListWrapper>
64
55
  )
65
56
  }
66
-
67
- export const PreviousBusinessOrdered = (props) => {
68
- const previousBusinessOrderedController = {
69
- ...props,
70
- UIComponent: PreviousBusinessOrderedUI,
71
- paginationSettings: { initialPage: 1, pageSize: 50, controlType: 'infinity' }
72
- }
73
-
74
- return (
75
- <BusinessListController {...previousBusinessOrderedController} />
76
- )
77
- }
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+
3
+ import {
4
+ ProductsList,
5
+ ProductsListContainer
6
+ } from './styles'
7
+
8
+ import { AutoScroll } from '../../AutoScroll'
9
+ import { SingleProfessionalCard } from '../../SingleProfessionalCard'
10
+
11
+ export const PreviousProfessionalOrdered = (props) => {
12
+ const {
13
+ professionals,
14
+ handleUpdateProfessionals
15
+ } = props
16
+
17
+ return (
18
+ <ProductsListContainer isLoading={professionals?.length < 1}>
19
+ <ProductsList>
20
+ <AutoScroll>
21
+ {professionals?.map(professional => (
22
+ <SingleProfessionalCard
23
+ key={professional?.id}
24
+ professional={professional}
25
+ handleUpdateProfessionals={handleUpdateProfessionals}
26
+ />
27
+ ))}
28
+ </AutoScroll>
29
+ </ProductsList>
30
+ </ProductsListContainer>
31
+ )
32
+ }
@@ -0,0 +1,38 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const ProductsList = styled.div`
4
+ display: flex;
5
+ box-sizing: border-box;
6
+
7
+ #autoscroll {
8
+ > div {
9
+ width: 300px;
10
+ max-width: 300px;
11
+ }
12
+ }
13
+
14
+ @media(min-width: 480px){
15
+ #autoscroll {
16
+ > div {
17
+ width: 350px;
18
+ max-width: 350px;
19
+ }
20
+ }
21
+ }
22
+ `
23
+
24
+ export const ProductsListContainer = styled.div`
25
+ margin-top: 10px;
26
+ display: flex;
27
+ overflow: scroll hidden;
28
+ ::-webkit-scrollbar {
29
+ width: 6px;
30
+ height: 6px;
31
+ }
32
+ ${({ isLoading }) => isLoading && css`
33
+ ::-webkit-scrollbar {
34
+ width: 0px;
35
+ height: 0px;
36
+ }
37
+ `}
38
+ `
@@ -1,8 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import Skeleton from 'react-loading-skeleton'
3
3
  import moment from 'moment'
4
- import { OrderList, useLanguage, useOrder, useEvent } from 'ordering-components-external'
5
-
4
+ import { useLanguage, useOrder, useEvent, OrderList } from 'ordering-components-external'
6
5
  import { HorizontalOrdersLayout } from '../HorizontalOrdersLayout'
7
6
  import { VerticalOrdersLayout } from '../../../../../components/VerticalOrdersLayout'
8
7
  import { NotFoundSource } from '../../../../../components/NotFoundSource'
@@ -28,6 +27,7 @@ import { BusinessController } from '../BusinessController'
28
27
  import { SingleProductCard } from '../SingleProductCard'
29
28
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
30
29
  import { Alert } from '../Confirm'
30
+ import { PreviousProfessionalOrdered } from './PreviousProfessionalOrdered'
31
31
 
32
32
  const OrdersOptionUI = (props) => {
33
33
  const {
@@ -56,13 +56,17 @@ const OrdersOptionUI = (props) => {
56
56
  handleReorder,
57
57
  isBusiness,
58
58
  isProducts,
59
+ isProfessionals,
59
60
  businessOrderIds,
60
61
  products,
61
62
  hideOrders,
62
63
  onProductRedirect,
63
64
  businessesSearchList,
64
65
  handleUpdateProducts,
65
- onBusinessClick
66
+ onBusinessClick,
67
+ professionals,
68
+ handleUpdateProfessionals,
69
+ businesses
66
70
  } = props
67
71
 
68
72
  const [, t] = useLanguage()
@@ -82,7 +86,6 @@ const OrdersOptionUI = (props) => {
82
86
  : orders.length > 0
83
87
 
84
88
  const [loadingOrders, setLoadingOrders] = useState(true)
85
- const [businessLoading, setBusinessLoading] = useState(true)
86
89
  const [alertState, setAlertState] = useState({ open: false, content: [] })
87
90
  const closeOrderModal = (e) => {
88
91
  const outsideModal = !window.document.getElementById('app-modals') ||
@@ -94,7 +97,7 @@ const OrdersOptionUI = (props) => {
94
97
  }
95
98
  }
96
99
 
97
- const showSkeletons = (!isBusiness && !isProducts && loading) || (businessLoading && isBusiness) || (products?.length === 0 && isProducts && ((!businessesSearchList && loading) || businessesSearchList?.loading))
100
+ const showSkeletons = (!isBusiness && !isProducts && loading) || (businesses?.loading && isBusiness) || (products?.length === 0 && isProducts && ((!businessesSearchList && loading) || businessesSearchList?.loading))
98
101
 
99
102
  const getOrderStatus = (s) => {
100
103
  const status = parseInt(s)
@@ -222,8 +225,7 @@ const OrdersOptionUI = (props) => {
222
225
  )}
223
226
  {isBusiness && businessOrderIds?.length > 0 && (
224
227
  <PreviousBusinessOrdered
225
- businessId={businessOrderIds}
226
- setBusinessLoading={setBusinessLoading}
228
+ businesses={businesses}
227
229
  onRedirectPage={onRedirectPage}
228
230
  isLoadingOrders={loading}
229
231
  />
@@ -238,9 +240,16 @@ const OrdersOptionUI = (props) => {
238
240
  />
239
241
  )}
240
242
 
241
- {(isCustomLayout ? (loadingOrders || loading || isBusinessesLoading) : showSkeletons) && (
243
+ {isProfessionals && (
244
+ <PreviousProfessionalOrdered
245
+ professionals={professionals}
246
+ handleUpdateProfessionals={handleUpdateProfessionals}
247
+ />
248
+ )}
249
+
250
+ {(isCustomLayout ? (loadingOrders || loading || businesses?.loading) : showSkeletons) && (
242
251
  <>
243
- {(businessLoading && isBusiness) ? (
252
+ {(businesses?.loading && isBusiness) ? (
244
253
  <BusinessControllerSkeleton>
245
254
  {[...Array(3).keys()].map((item, i) => (
246
255
  <BusinessController
@@ -640,15 +640,15 @@ const ProductOptionsUI = (props) => {
640
640
  <div className='price-amount-block'>
641
641
  <div className='price'>
642
642
  <h4>{productCart.total && parsePrice(productCart.total)}</h4>
643
- {product?.minimum_per_order && productCart?.quantity < product?.minimum_per_order && <span>{t('MINIMUM_TO_ORDER', 'Minimum _number_ to order').replace('_number_', product?.minimum_per_order)}</span>}
644
- {product?.maximum_per_order && productCart?.quantity > product?.maximum_per_order && <span>{t('MAXIMUM_TO_ORDER', 'Max. _number_ to order'.replace('_number_', product?.maximum_per_order))}</span>}
643
+ {product?.minimum_per_order && productCart?.quantity <= product?.minimum_per_order && productCart?.quantity !== 1 && <span>{t('MINIMUM_TO_ORDER', 'Minimum _number_ to order').replace('_number_', product?.minimum_per_order)}</span>}
644
+ {product?.maximum_per_order && productCart?.quantity >= product?.maximum_per_order && <span>{t('MAXIMUM_TO_ORDER', 'Max. _number_ to order'.replace('_number_', product?.maximum_per_order))}</span>}
645
645
  </div>
646
646
  {
647
647
  productCart && !isSoldOut && maxProductQuantity > 0 && (
648
648
  <div className={isHaveWeight ? 'incdec-control show-weight-unit' : 'incdec-control'}>
649
649
  <FiMinusCircle
650
650
  onClick={decrement}
651
- className={`${productCart.quantity === 1 || !productCart.quantity || isSoldOut ? 'disabled' : ''}`}
651
+ className={`${productCart.quantity === 1 || !productCart.quantity || isSoldOut || (productCart?.quantity <= product?.minimum_per_order) ? 'disabled' : ''}`}
652
652
  />
653
653
  {
654
654
  qtyBy?.pieces && (
@@ -669,7 +669,7 @@ const ProductOptionsUI = (props) => {
669
669
  )}
670
670
  <FiPlusCircle
671
671
  onClick={increment}
672
- className={`${maxProductQuantity <= 0 || productCart.quantity >= maxProductQuantity || isSoldOut ? 'disabled' : ''}`}
672
+ className={`${maxProductQuantity <= 0 || productCart.quantity >= maxProductQuantity || (productCart.quantity >= product?.maximum_per_order && product?.maximum_per_order) || isSoldOut ? 'disabled' : ''}`}
673
673
  />
674
674
  {isHaveWeight && (
675
675
  <WeightUnitSwitch>
@@ -817,7 +817,7 @@ const ProductOptionsUI = (props) => {
817
817
  export const ProductForm = (props) => {
818
818
  const productOptionsProps = {
819
819
  ...props,
820
- productCart: { quantity: props?.product?.minimum_per_order || 1 },
820
+ productCart: { quantity: props?.product?.maximum_per_order || props?.product?.minimum_per_order || 1 },
821
821
  UIComponent: ProductOptionsUI
822
822
  }
823
823
 
@@ -76,7 +76,7 @@ export const BusinessCartContainer = styled(BusinessCategoriesContainer)`
76
76
  margin-top: 0px;
77
77
  `}
78
78
  }
79
- @media (min-width: 1000px) {
79
+ @media (min-width: 1000px) and (min-height: 600px) {
80
80
  display: block;
81
81
  }
82
82
  `