ordering-ui-external 1.2.2 → 1.3.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 (97) hide show
  1. package/_bundles/{0.ordering-ui.fc62fe574704c7c4d033.js → 0.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  2. package/_bundles/{1.ordering-ui.fc62fe574704c7c4d033.js → 1.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  3. package/_bundles/{3.ordering-ui.fc62fe574704c7c4d033.js → 3.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  4. package/_bundles/{4.ordering-ui.fc62fe574704c7c4d033.js → 4.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  5. package/_bundles/5.ordering-ui.aee3f88f00476e436e39.js +1 -0
  6. package/_bundles/{6.ordering-ui.fc62fe574704c7c4d033.js → 6.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  7. package/_bundles/7.ordering-ui.aee3f88f00476e436e39.js +2 -0
  8. package/_bundles/{7.ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt → 7.ordering-ui.aee3f88f00476e436e39.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.fc62fe574704c7c4d033.js → 8.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  10. package/_bundles/{9.ordering-ui.fc62fe574704c7c4d033.js → 9.ordering-ui.aee3f88f00476e436e39.js} +1 -1
  11. package/_bundles/ordering-ui.aee3f88f00476e436e39.js +2 -0
  12. package/_bundles/{ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt → ordering-ui.aee3f88f00476e436e39.js.LICENSE.txt} +0 -0
  13. package/_modules/components/AutoScroll/styles.js +3 -3
  14. package/_modules/hooks/useIsMounted.js +24 -0
  15. package/_modules/index.js +8 -0
  16. package/_modules/themes/five/index.js +33 -1
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +2 -2
  18. package/_modules/themes/five/src/components/BusinessController/styles.js +42 -42
  19. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +12 -2
  20. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +5 -2
  21. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -3
  22. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +7 -3
  23. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -0
  24. package/_modules/themes/five/src/components/MultiCheckout/styles.js +1 -1
  25. package/_modules/themes/five/src/components/MyOrders/index.js +9 -3
  26. package/_modules/themes/five/src/components/NavigationBar/index.js +159 -0
  27. package/_modules/themes/five/src/components/NavigationBar/styles.js +33 -0
  28. package/_modules/themes/five/src/components/OrderDetails/index.js +71 -41
  29. package/_modules/themes/five/src/components/ProfessionalBusinessFilter/index.js +96 -0
  30. package/_modules/themes/five/src/components/ProfessionalBusinessFilter/styles.js +48 -0
  31. package/_modules/themes/five/src/components/ProfessionalFilter/index.js +35 -7
  32. package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +10 -4
  33. package/_modules/themes/five/src/components/ProfessionalInfo/index.js +120 -0
  34. package/_modules/themes/five/src/components/ProfessionalInfo/styles.js +100 -0
  35. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +36 -13
  36. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +21 -18
  37. package/_modules/themes/five/src/components/ReviewProfessional/index.js +314 -0
  38. package/_modules/themes/five/src/components/ReviewProfessional/styles.js +137 -0
  39. package/_modules/themes/five/src/components/SignUpApproval/index.js +106 -0
  40. package/_modules/themes/five/src/components/SignUpApproval/styles.js +71 -0
  41. package/_modules/themes/five/src/components/SignUpBusiness/index.js +7 -383
  42. package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +405 -0
  43. package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/styles.js +110 -0
  44. package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +400 -0
  45. package/_modules/themes/five/src/components/SignUpBusiness/{styles.js → layouts/OldSignUpBusiness/styles.js} +0 -0
  46. package/_modules/themes/five/src/components/SignUpDriver/index.js +7 -383
  47. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +405 -0
  48. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/styles.js +106 -0
  49. package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +400 -0
  50. package/_modules/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js} +0 -0
  51. package/_modules/themes/five/src/components/SingleProductCard/styles.js +1 -1
  52. package/_modules/utils/index.js +103 -0
  53. package/package.json +2 -2
  54. package/src/components/AutoScroll/styles.js +11 -12
  55. package/src/hooks/useIsMounted.js +18 -0
  56. package/src/index.js +2 -0
  57. package/src/themes/five/index.js +9 -1
  58. package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
  59. package/src/themes/five/src/components/BusinessController/styles.js +3 -6
  60. package/src/themes/five/src/components/BusinessProductsCategories/index.js +10 -2
  61. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +5 -0
  62. package/src/themes/five/src/components/BusinessProductsListing/index.js +8 -2
  63. package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
  64. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -0
  65. package/src/themes/five/src/components/MultiCheckout/index.js +1 -0
  66. package/src/themes/five/src/components/MultiCheckout/styles.js +1 -0
  67. package/src/themes/five/src/components/MyOrders/index.js +6 -3
  68. package/src/themes/five/src/components/NavigationBar/index.js +104 -0
  69. package/src/themes/five/src/components/NavigationBar/styles.js +44 -0
  70. package/src/themes/five/src/components/OrderDetails/index.js +19 -11
  71. package/src/themes/five/src/components/ProfessionalBusinessFilter/index.js +82 -0
  72. package/src/themes/five/src/components/ProfessionalBusinessFilter/styles.js +71 -0
  73. package/src/themes/five/src/components/ProfessionalFilter/index.js +30 -7
  74. package/src/themes/five/src/components/ProfessionalFilter/styles.js +15 -2
  75. package/src/themes/five/src/components/ProfessionalInfo/index.js +133 -0
  76. package/src/themes/five/src/components/ProfessionalInfo/styles.js +140 -0
  77. package/src/themes/five/src/components/RenderProductsLayout/index.js +37 -16
  78. package/src/themes/five/src/components/RenderProductsLayout/styles.js +6 -1
  79. package/src/themes/five/src/components/ReviewProfessional/index.js +239 -0
  80. package/src/themes/five/src/components/ReviewProfessional/styles.js +233 -0
  81. package/src/themes/five/src/components/SignUpApproval/index.js +108 -0
  82. package/src/themes/five/src/components/SignUpApproval/styles.js +98 -0
  83. package/src/themes/five/src/components/SignUpBusiness/index.js +10 -374
  84. package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +382 -0
  85. package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/styles.js +256 -0
  86. package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +378 -0
  87. package/src/themes/five/src/components/SignUpBusiness/{styles.js → layouts/OldSignUpBusiness/styles.js} +0 -0
  88. package/src/themes/five/src/components/SignUpDriver/index.js +10 -374
  89. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +382 -0
  90. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/styles.js +262 -0
  91. package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +378 -0
  92. package/src/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js} +0 -0
  93. package/src/themes/five/src/components/SingleProductCard/styles.js +3 -1
  94. package/src/utils/index.js +54 -0
  95. package/_bundles/5.ordering-ui.fc62fe574704c7c4d033.js +0 -1
  96. package/_bundles/7.ordering-ui.fc62fe574704c7c4d033.js +0 -2
  97. package/_bundles/ordering-ui.fc62fe574704c7c4d033.js +0 -2
@@ -72,7 +72,9 @@ import { ProductOption } from './src/components/ProductOption'
72
72
  import { ProductOptionSubOption } from './src/components/ProductOptionSubOption'
73
73
  import { ProfileOptions } from './src/components/UserProfileForm/ProfileOptions'
74
74
  import { Promotions } from './src/components/Promotions'
75
+ import { ProfessionalInfo } from './src/components/ProfessionalInfo'
75
76
  import { RenderProductsLayout } from './src/components/RenderProductsLayout'
77
+ import { ReviewProfessional } from './src/components/ReviewProfessional'
76
78
  import { ResetPassword } from './src/components/ResetPassword'
77
79
  import { SearchBar } from './src/components/SearchBar'
78
80
  import { SessionsList } from './src/components/SessionsList'
@@ -80,6 +82,7 @@ import { SidebarMenu } from './src/components/SidebarMenu'
80
82
  import { SignUpForm } from './src/components/SignUpForm'
81
83
  import { SignUpBusiness } from './src/components/SignUpBusiness'
82
84
  import { SignUpDriver } from './src/components/SignUpDriver'
85
+ import { SignUpApproval } from './src/components/SignUpApproval'
83
86
  import { SingleProductCard } from './src/components/SingleProductCard'
84
87
  import { StripeElementsForm } from './src/components/StripeElementsForm'
85
88
  import { StripeRedirectForm } from './src/components/StripeRedirectForm'
@@ -106,6 +109,7 @@ import { Button } from './src/styles/Buttons'
106
109
  import { Input, TextArea } from './src/styles/Inputs'
107
110
  import { Select } from './src/styles/Select'
108
111
  import { Checkbox } from '../../styles/Checkbox'
112
+ import { NavigationBar } from './src/components/NavigationBar'
109
113
 
110
114
  export {
111
115
  AccordionDropdown,
@@ -182,7 +186,9 @@ export {
182
186
  ProfileOptions,
183
187
  ProductOptionSubOption,
184
188
  Promotions,
189
+ ProfessionalInfo,
185
190
  PhoneAutocomplete,
191
+ ReviewProfessional,
186
192
  RenderProductsLayout,
187
193
  ResetPassword,
188
194
  SearchBar,
@@ -191,6 +197,7 @@ export {
191
197
  SignUpForm,
192
198
  SignUpBusiness,
193
199
  SignUpDriver,
200
+ SignUpApproval,
194
201
  SingleProductCard,
195
202
  StripeElementsForm,
196
203
  StripeRedirectForm,
@@ -217,5 +224,6 @@ export {
217
224
  Input,
218
225
  TextArea,
219
226
  Select,
220
- Checkbox
227
+ Checkbox,
228
+ NavigationBar
221
229
  }
@@ -348,7 +348,7 @@ export const BusinessBasicInformation = (props) => {
348
348
  </BusinessInfoItem>
349
349
  </BusinessInfo>
350
350
  </BusinessInfoContent>
351
- {(categoryState?.products?.length !== 0 || searchValue) && !errorQuantityProducts && !isInfoShrunken && (
351
+ {(categoryState?.products?.length !== 0 || searchValue) && !errorQuantityProducts && !isInfoShrunken && !business?.professionals?.length && (
352
352
  <SearchComponent />
353
353
  )}
354
354
  </BusinessInfoContainer>
@@ -33,9 +33,7 @@ export const ContainerCard = styled.div`
33
33
  margin-left: 0;
34
34
  `}
35
35
 
36
- ${({ businessRows }) => businessRows ? css`
37
- width: ${() => businessRows === 4 ? 'calc(25% - 40px)' : businessRows === 3 ? 'calc(33% - 40px)' : 'calc(50% - 40px)'};
38
- ` : css`
36
+ ${({ businessRows }) => css`
39
37
  width: calc(100% - 40px);
40
38
 
41
39
  @media (min-width: 481px) {
@@ -51,7 +49,7 @@ export const ContainerCard = styled.div`
51
49
  }
52
50
 
53
51
  @media (min-width: 1200px) {
54
- width: calc(25% - 40px);
52
+ width: ${() => businessRows === 4 ? 'calc(25% - 40px)' : businessRows === 3 ? 'calc(33% - 40px)' : 'calc(50% - 40px)'};
55
53
  }
56
54
  `}
57
55
 
@@ -160,8 +158,7 @@ export const BusinessTags = styled.div`
160
158
  margin-left: 0px;
161
159
  ` : css`
162
160
  margin-right: 0px;
163
- `
164
- }
161
+ `}
165
162
  }
166
163
  }
167
164
  `
@@ -17,7 +17,8 @@ const BusinessProductsCategoriesUI = (props) => {
17
17
  business,
18
18
  handlerClickCategory,
19
19
  categorySelected,
20
- useKioskApp
20
+ useKioskApp,
21
+ isProfessional
21
22
  } = props
22
23
 
23
24
  const theme = useTheme()
@@ -155,6 +156,13 @@ const BusinessProductsCategoriesUI = (props) => {
155
156
  return () => window.removeEventListener('scroll', handleScroll)
156
157
  }, [useKioskApp])
157
158
 
159
+ useEffect(() => {
160
+ if (business?.professionals?.length > 0 && !useKioskApp) {
161
+ const element = document.getElementById('category-lists')
162
+ element.setAttribute('style', 'width: 100% !important')
163
+ }
164
+ }, [business?.professionals, useKioskApp])
165
+
158
166
  return (
159
167
  <>
160
168
  {props.beforeElements?.map((BeforeElement, i) => (
@@ -163,7 +171,7 @@ const BusinessProductsCategoriesUI = (props) => {
163
171
  </React.Fragment>))}
164
172
  {props.beforeComponents?.map((BeforeComponent, i) => (
165
173
  <BeforeComponent key={i} {...props} />))}
166
- <CategoriesContainer id='category-lists' className='category-lists' featured={featured} w={props.wContainerStyle}>
174
+ <CategoriesContainer id='category-lists' className='category-lists' featured={featured} w={props.wContainerStyle} isProfessional={isProfessional}>
167
175
  {!isSkeleton ? (
168
176
  <Tabs variant='primary'>
169
177
  {openBusinessInformation ? (
@@ -36,6 +36,11 @@ export const CategoriesContainer = styled.div`
36
36
  /* @media (min-width: 381px) {
37
37
  padding: 15px 0px 0px 0px;
38
38
  } */
39
+ @media (min-width: 769px) {
40
+ ${({ isProfessional }) => isProfessional && css`
41
+ width: 100%;
42
+ `}
43
+ }
39
44
  @media (min-width: 992px) {
40
45
  width: ${props => props.w ?? 'auto'};
41
46
  }
@@ -34,6 +34,7 @@ import { ProductForm } from '../ProductForm'
34
34
  import { Modal } from '../Modal'
35
35
  import { Button } from '../../styles/Buttons'
36
36
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
37
+ import { useIsMounted } from '../../../../../hooks/useIsMounted'
37
38
  import { RenderProductsLayout } from '../RenderProductsLayout'
38
39
  import { Cart } from '../Cart'
39
40
  import { Alert } from '../../../../../components/Confirm'
@@ -74,7 +75,9 @@ const BusinessProductsListingUI = (props) => {
74
75
  professionalSelected,
75
76
  handleChangeProfessionalSelected,
76
77
  onChangeMetaTag,
77
- onBusinessClick
78
+ onBusinessClick,
79
+ handleChangePriceFilterValues,
80
+ priceFilterValues
78
81
  } = props
79
82
 
80
83
  const { business, loading, error } = businessState
@@ -96,6 +99,7 @@ const BusinessProductsListingUI = (props) => {
96
99
  const [isCartOpen, setIsCartOpen] = useState(false)
97
100
  const [isCartModal, setisCartModal] = useState(false)
98
101
  const [subcategoriesSelected, setSubcategoriesSelected] = useState([])
102
+ const isMounted = useIsMounted()
99
103
 
100
104
  const currentCart = Object.values(carts).find(cart => cart?.business?.slug === business?.slug) ?? {}
101
105
  const isLazy = businessState?.business?.lazy_load_products_recommended
@@ -290,10 +294,12 @@ const BusinessProductsListingUI = (props) => {
290
294
  professionalSelected={professionalSelected}
291
295
  handleChangeProfessionalSelected={handleChangeProfessionalSelected}
292
296
  onBusinessClick={onBusinessClick}
297
+ priceFilterValues={priceFilterValues}
298
+ handleChangePriceFilterValues={handleChangePriceFilterValues}
293
299
  />
294
300
 
295
301
  {
296
- !loading && business && !Object.keys(business).length && (
302
+ isMounted && !loading && business && !Object.keys(business).length && (
297
303
  <NotFoundSource
298
304
  content={t('NOT_FOUND_BUSINESS_PRODUCTS', theme?.defaultLanguages?.NOT_FOUND_BUSINESS_PRODUCTS || 'No products to show at this business, please try with other business.')}
299
305
  btnTitle={t('SEARCH_REDIRECT', theme?.defaultLanguages?.SEARCH_REDIRECT || 'Go to Businesses')}
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components'
1
+ import styled, { css } from 'styled-components'
2
2
 
3
3
  export const ProductsContainer = styled.div`
4
4
  width: 95%;
@@ -9,6 +9,7 @@ import {
9
9
  useSession,
10
10
  useLanguage,
11
11
  useConfig,
12
+ useOrderingTheme,
12
13
  BusinessList as BusinessListController
13
14
  } from 'ordering-components-external'
14
15
 
@@ -75,6 +76,7 @@ const BusinessesListingUI = (props) => {
75
76
  const [orderState, { changeCityFilter }] = useOrder()
76
77
  const [{ auth }] = useSession()
77
78
  const [{ configs }] = useConfig()
79
+ const orderingTheme = useOrderingTheme()
78
80
  const theme = useTheme()
79
81
  const [modals, setModals] = useState({ listOpen: false, formOpen: false, citiesOpen: false })
80
82
  const [alertState, setAlertState] = useState({ open: false, content: [] })
@@ -74,6 +74,7 @@ const MultiCheckoutUI = (props) => {
74
74
  const maximumCarts = 5
75
75
  const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || openCarts.length > maximumCarts
76
76
  const walletCarts = (Object.values(orderState?.carts)?.filter(cart => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
77
+
77
78
  const handlePlaceOrder = () => {
78
79
  if (!userErrors.length) {
79
80
  handleGroupPlaceOrder && handleGroupPlaceOrder()
@@ -148,4 +148,5 @@ export const WarningText = styled.p`
148
148
  margin: 10px auto;
149
149
  text-align: center;
150
150
  color: ${props => props.theme.colors.danger500};
151
+ font-size: 14px;
151
152
  `
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { useLanguage } from 'ordering-components-external'
2
+ import { useLanguage, useOrderingTheme } from 'ordering-components-external'
3
3
  import { ProfileOptions } from '../../../../../components/UserProfileForm/ProfileOptions'
4
4
  import { OrdersOption } from '../OrdersOption'
5
5
  import { Button } from '../../styles/Buttons'
@@ -24,6 +24,9 @@ export const MyOrders = (props) => {
24
24
  const [, t] = useLanguage()
25
25
  const history = useHistory()
26
26
 
27
+ const [orderingTheme] = useOrderingTheme()
28
+ const layout = orderingTheme?.theme?.orders?.components?.layout?.type || 'original'
29
+
27
30
  const [selectItem, setSelectItem] = useState('all')
28
31
  const [isEmptyActive, setIsEmptyActive] = useState(false)
29
32
  const [isEmptyPast, setIsEmptyPast] = useState(false)
@@ -69,7 +72,7 @@ export const MyOrders = (props) => {
69
72
  )}
70
73
  <Container hideOrders={hideOrders}>
71
74
  {!hideOrders && (
72
- <h1>{t('MY_ORDERS', 'My orders')}</h1>
75
+ <h1>{layout === 'appointments' ? t('MY_APPOINTMENTS', 'My appointments') : t('MY_ORDERS', 'My orders')}</h1>
73
76
  )}
74
77
  {!allEmpty && (
75
78
  <MyOrdersMenuContainer className='category-lists'>
@@ -87,7 +90,7 @@ export const MyOrders = (props) => {
87
90
  </Tabs>
88
91
  </MyOrdersMenuContainer>
89
92
  )}
90
- {!(isEmptyActive && isEmptyPast && isEmptyPreorder) && selectedOption === 'orders' && (
93
+ {!(isEmptyActive && isEmptyPast && isEmptyPreorder) && selectedOption === 'orders' && layout !== 'appointments' && (
91
94
  <OrderGroupFilterWrapper>
92
95
  {filterList?.map((order, i) => (
93
96
  <Button
@@ -0,0 +1,104 @@
1
+ import React, { useState } from 'react'
2
+ import { useLocation } from 'react-router-dom'
3
+ import { useLanguage, useEvent, useOrder, useSession } from 'ordering-components-external'
4
+ import BsHouse from '@meronex/icons/bs/BsHouse'
5
+ import BsSearch from '@meronex/icons/bs/BsSearch'
6
+ import AiOutlineShoppingCart from '@meronex/icons/ai/AiOutlineShoppingCart'
7
+ import BsCardChecklist from '@meronex/icons/bs/BsCardChecklist'
8
+ import FaRegUser from '@meronex/icons/fa/FaRegUser'
9
+
10
+ import { CartContent } from '../CartContent'
11
+ import { Modal } from '../Modal'
12
+ import { AddressForm } from '../AddressForm'
13
+
14
+ import {
15
+ NavigationBarContainer,
16
+ NavigationLink
17
+ } from './styles'
18
+
19
+ export const NavigationBar = () => {
20
+ const [, t] = useLanguage()
21
+ const location = useLocation()
22
+ const [events] = useEvent()
23
+ const [orderState] = useOrder()
24
+ const [{ auth }] = useSession()
25
+ const [isCart, setIsCart] = useState(false)
26
+ const [isAddress, setIsAddress] = useState(false)
27
+
28
+ const cartsWithProducts = (orderState?.carts && Object.values(orderState?.carts).filter(cart => cart.products && cart.products?.length > 0)) || null
29
+
30
+ const handleGoToPage = (data) => {
31
+ events.emit('go_to_page', data)
32
+ }
33
+
34
+ const handleChangeExplore = () => {
35
+ if (auth) handleGoToPage({ page: 'search' })
36
+ else setIsAddress(true)
37
+ }
38
+
39
+ return (
40
+ <>
41
+ <NavigationBarContainer>
42
+ <NavigationLink
43
+ active={location.pathname === '/search' || isAddress}
44
+ onClick={handleChangeExplore}
45
+ >
46
+ <BsHouse />
47
+ <p>{t('HOME', 'Home')}</p>
48
+ </NavigationLink>
49
+ <NavigationLink
50
+ active={location.pathname === '/business_search'}
51
+ onClick={() => handleGoToPage({ page: 'business_search' })}
52
+ >
53
+ <BsSearch />
54
+ <p>{t('BROWSE', 'Browse')}</p>
55
+ </NavigationLink>
56
+ <NavigationLink
57
+ active={location.pathname === '/profile/orders'}
58
+ onClick={() => handleGoToPage({ page: 'orders' })}
59
+ >
60
+ <BsCardChecklist />
61
+ <p>{t('ORDERS', 'Orders')}</p>
62
+ </NavigationLink>
63
+ <NavigationLink
64
+ active={isCart}
65
+ onClick={() => setIsCart(true)}
66
+ >
67
+ <AiOutlineShoppingCart />
68
+ <p>{t('MY_CART', 'My cart')}</p>
69
+ </NavigationLink>
70
+ <NavigationLink
71
+ active={location.pathname === '/profile'}
72
+ onClick={() => handleGoToPage({ page: 'profile' })}
73
+ >
74
+ <FaRegUser />
75
+ <p>{t('PROFILE', 'Profile')}</p>
76
+ </NavigationLink>
77
+ </NavigationBarContainer>
78
+ <Modal
79
+ open={isCart}
80
+ onClose={() => setIsCart(false)}
81
+ width='50%'
82
+ >
83
+ <CartContent
84
+ carts={cartsWithProducts}
85
+ isOrderStateCarts={!!orderState.carts}
86
+ onClose={() => setIsCart(false)}
87
+ />
88
+ </Modal>
89
+ <Modal
90
+ open={isAddress}
91
+ title={t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?')}
92
+ onClose={() => setIsAddress(false)}
93
+ width='50%'
94
+ >
95
+ <AddressForm
96
+ useValidationFileds
97
+ address={orderState?.options?.address || {}}
98
+ onCancel={() => setIsAddress(false)}
99
+ onSaveAddress={() => setIsAddress(false)}
100
+ />
101
+ </Modal>
102
+ </>
103
+ )
104
+ }
@@ -0,0 +1,44 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const NavigationBarContainer = styled.div`
4
+ background: #FFFFFF;
5
+ box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.1);
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: space-between;
9
+ padding: 15px 10vw;
10
+ position: sticky;
11
+ bottom: 0px;
12
+ left: 0px;
13
+ width: 100%;
14
+ box-sizing: border-box;
15
+ z-index: 100;
16
+ `
17
+
18
+ export const NavigationLink = styled.div`
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+
23
+ svg {
24
+ font-size: 18px;
25
+ color: #B1BCCC;
26
+ }
27
+
28
+ p {
29
+ margin-top: 2px;
30
+ margin-bottom: 0px;
31
+ color: #B1BCCC;
32
+ font-size: 12px;
33
+ }
34
+
35
+ ${({ active }) => active && css`
36
+ svg {
37
+ color: ${props => props.theme.colors.primary};
38
+ }
39
+
40
+ p {
41
+ color: ${props => props.theme.colors.headingColor};
42
+ }
43
+ `}
44
+ `
@@ -72,6 +72,7 @@ import { TaxInformation } from '../TaxInformation'
72
72
 
73
73
  import { getGoogleMapImage } from '../../../../../utils'
74
74
  import { OrderHistory } from './OrderHistory'
75
+ import { ReviewProfessional } from '../ReviewProfessional'
75
76
 
76
77
  const OrderDetailsUI = (props) => {
77
78
  const {
@@ -103,9 +104,10 @@ const OrderDetailsUI = (props) => {
103
104
  const [isOrderReviewed, setIsOrderReviewed] = useState(false)
104
105
  const [isProductReviewed, setIsProductReviewed] = useState(false)
105
106
  const [isDriverReviewed, setIsDriverReviewed] = useState(false)
107
+ const [isProReviewed, setIsProReviewed] = useState(false)
106
108
  const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
107
109
  const [isReviewOpen, setIsReviewOpen] = useState(false)
108
- const [reviewStatus, setReviewStatus] = useState({ order: false, product: false, driver: false })
110
+ const [reviewStatus, setReviewStatus] = useState({ order: false, product: false, driver: false, professional: false })
109
111
  const [openTaxModal, setOpenTaxModal] = useState({ open: false, tax: null })
110
112
  const [isService, setIsService] = useState(false)
111
113
  const [isOrderHistory, setIsOrderHistory] = useState(false)
@@ -212,9 +214,10 @@ const OrderDetailsUI = (props) => {
212
214
  ]
213
215
 
214
216
  const handleOpenReview = () => {
215
- if (!order?.review && !isOrderReviewed) setReviewStatus({ order: true, product: false, driver: false })
216
- else if (!isProductReviewed) setReviewStatus({ order: false, product: true, driver: false })
217
- else if (order?.driver && !order?.user_review && !isDriverReviewed) setReviewStatus({ order: false, product: false, driver: true })
217
+ if (!order?.review && !isOrderReviewed) setReviewStatus({ order: true, product: false, driver: false, professional: false })
218
+ else if (!isProductReviewed) setReviewStatus({ order: false, product: true, driver: false, professional: false })
219
+ else if (order?.driver && !order?.user_review && !isDriverReviewed) setReviewStatus({ order: false, product: false, driver: true, professional: false })
220
+ else if (isService && !isProReviewed) setReviewStatus({ order: false, product: false, driver: false, professional: true })
218
221
  else {
219
222
  setIsReviewOpen(false)
220
223
  return
@@ -223,18 +226,19 @@ const OrderDetailsUI = (props) => {
223
226
  }
224
227
 
225
228
  const handleCloseReivew = () => {
226
- setReviewStatus({ order: false, product: false, driver: false })
229
+ setReviewStatus({ order: false, product: false, driver: false, professional: false })
227
230
  setIsReviewOpen(false)
228
231
  }
229
232
 
230
233
  const closeReviewOrder = () => {
231
- if (!isProductReviewed) setReviewStatus({ order: false, product: true, driver: false })
232
- else if (order?.driver && !order?.user_review && !isDriverReviewed) setReviewStatus({ order: false, product: false, driver: true })
234
+ if (!isProductReviewed) setReviewStatus({ order: false, product: true, driver: false, professional: false })
235
+ else if (order?.driver && !order?.user_review && !isDriverReviewed) setReviewStatus({ order: false, product: false, driver: true, professional: false })
233
236
  else handleCloseReivew()
234
237
  }
235
238
 
236
239
  const closeReviewProduct = () => {
237
- if (order?.driver && !order?.user_review && !isDriverReviewed) setReviewStatus({ order: false, product: false, driver: true })
240
+ if (isService && !isProReviewed) setReviewStatus({ order: false, product: false, driver: false, professional: true })
241
+ else if (order?.driver && !order?.user_review && !isDriverReviewed) setReviewStatus({ order: false, product: false, driver: true, professional: false })
238
242
  else {
239
243
  setIsDriverReviewed(true)
240
244
  handleCloseReivew()
@@ -483,7 +487,7 @@ const OrderDetailsUI = (props) => {
483
487
  active={
484
488
  acceptedStatus.includes(parseInt(order?.status, 10)) &&
485
489
  (!order?.review || (order.driver && !order?.user_review)) &&
486
- (!isOrderReviewed || !isProductReviewed || !isDriverReviewed)
490
+ (!isOrderReviewed || !isProductReviewed || (isService && !isProReviewed) || !isDriverReviewed)
487
491
  }
488
492
  >
489
493
  <span onClick={handleOpenReview}>{t('REVIEW_ORDER', theme?.defaultLanguages?.REVIEW_ORDER || 'Review your Order')}</span>
@@ -736,7 +740,9 @@ const OrderDetailsUI = (props) => {
736
740
  ? t('REVIEW_ORDER', 'Review order')
737
741
  : (reviewStatus?.product
738
742
  ? t('REVIEW_PRODUCT', 'Review Product')
739
- : t('REVIEW_DRIVER', 'Review Driver')))
743
+ : (reviewStatus?.professional
744
+ ? t('PROFESSIONAL_REVIEW', 'Professional review')
745
+ : t('REVIEW_DRIVER', 'Review Driver'))))
740
746
  : t('LOADING', theme?.defaultLanguages?.LOADING || 'Loading...')}
741
747
  >
742
748
  <ReviewWrapper>
@@ -745,7 +751,9 @@ const OrderDetailsUI = (props) => {
745
751
  ? <ReviewOrder order={order} closeReviewOrder={closeReviewOrder} setIsReviewed={setIsOrderReviewed} />
746
752
  : (reviewStatus?.product
747
753
  ? <ReviewProduct order={order} closeReviewProduct={closeReviewProduct} setIsProductReviewed={setIsProductReviewed} />
748
- : <ReviewDriver order={order} closeReviewDriver={handleCloseReivew} setIsDriverReviewed={setIsDriverReviewed} />)
754
+ : (reviewStatus?.professional
755
+ ? <ReviewProfessional order={order} closeReviewProfessional={handleCloseReivew} setIsProfessionalReviewed={setIsProReviewed} isProfessional />
756
+ : <ReviewDriver order={order} closeReviewDriver={handleCloseReivew} setIsDriverReviewed={setIsDriverReviewed} />))
749
757
  }
750
758
  </ReviewWrapper>
751
759
 
@@ -0,0 +1,82 @@
1
+ import React from 'react'
2
+ import { useLanguage } from 'ordering-components-external'
3
+ import {
4
+ Container,
5
+ FilterWrapper,
6
+ FilterItem,
7
+ Divider,
8
+ SearchWrapper
9
+ } from './styles'
10
+ import { useTheme } from 'styled-components'
11
+ import { Input } from '../../styles/Inputs'
12
+ import { Select } from '../../styles/Select'
13
+ import { useWindowSize } from '../../../../../hooks/useWindowSize'
14
+ import { SearchBar } from '../SearchBar'
15
+
16
+ export const ProfessionalBusinessFilter = (props) => {
17
+ const {
18
+ sortByValue,
19
+ sortByOptions,
20
+ handleChangeSortBy,
21
+ handleChangeSearch,
22
+ searchValue,
23
+ business,
24
+ handleChangePriceFilterValues,
25
+ priceFilterValues
26
+ } = props
27
+
28
+ const [, t] = useLanguage()
29
+ const { width } = useWindowSize()
30
+ const theme = useTheme()
31
+
32
+ return (
33
+ <>
34
+ <SearchWrapper>
35
+ <SearchBar
36
+ onSearch={handleChangeSearch}
37
+ search={searchValue}
38
+ placeholder={t('SEARCH_PRODUCTS', theme?.defaultLanguages?.SEARCH_PRODUCTS || 'Search Products')}
39
+ lazyLoad={business?.lazy_load_products_recommended}
40
+ />
41
+ </SearchWrapper>
42
+ <Container>
43
+ <FilterWrapper>
44
+ <FilterItem>
45
+ <span>{t('PREORDER_STEP_2_TIME_OPTION_MIN', 'Min')}.</span>
46
+ <Input
47
+ value={priceFilterValues?.min || ''}
48
+ onKeyPress={(e) => {
49
+ if (!/^[0-9.]$/.test(e.key)) {
50
+ e.preventDefault()
51
+ }
52
+ }}
53
+ onChange={(e) => handleChangePriceFilterValues('min', e.target.value)}
54
+ placeholder={t('PREORDER_STEP_2_TIME_OPTION_MIN', 'Min')}
55
+ />
56
+ </FilterItem>
57
+ <FilterItem>
58
+ <span>{t('MAX', 'Max')}.</span>
59
+ <Input
60
+ value={priceFilterValues?.max || ''}
61
+ onKeyPress={(e) => {
62
+ if (!/^[0-9.]$/.test(e.key)) {
63
+ e.preventDefault()
64
+ }
65
+ }}
66
+ onChange={(e) => handleChangePriceFilterValues('max', e.target.value)}
67
+ placeholder={t('MAX', 'Max')}
68
+ />
69
+ </FilterItem>
70
+ </FilterWrapper>
71
+ {width > 576 && <Divider />}
72
+ <Select
73
+ notAsync
74
+ notReload
75
+ options={sortByOptions}
76
+ defaultValue={sortByValue}
77
+ onChange={(val) => handleChangeSortBy && handleChangeSortBy(val)}
78
+ />
79
+ </Container>
80
+ </>
81
+ )
82
+ }
@@ -0,0 +1,71 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const Container = styled.div`
4
+ margin-bottom: 40px;
5
+ display: flex;
6
+ align-items: center;
7
+
8
+ #select-input {
9
+ border-radius: 8px;
10
+ height: 40px;
11
+ > div:first-child {
12
+ height: 100%;
13
+ }
14
+ }
15
+ `
16
+
17
+ export const FilterWrapper = styled.div`
18
+ display: flex;
19
+ align-items: center;
20
+ `
21
+
22
+ export const FilterItem = styled.div`
23
+ span {
24
+ font-weight: 400;
25
+ font-size: 14px;
26
+ margin-right: 15px;
27
+ ${props => props.theme.rtl && css`
28
+ margin-left: 15px;
29
+ margin-right: 0px;
30
+ `}
31
+ }
32
+ input {
33
+ width: 50px;
34
+ box-sizing: border-box;
35
+ }
36
+ margin-right: 15px;
37
+ ${props => props.theme.rtl && css`
38
+ margin-left: 15px;
39
+ margin-right: 0px;
40
+ `}
41
+
42
+ @media (min-width: 500px) {
43
+ input {
44
+ width: 100px;
45
+ }
46
+ margin-right: 25px;
47
+ ${props => props.theme.rtl && css`
48
+ margin-left: 25px;
49
+ margin-right: 0px;
50
+ `}
51
+ }
52
+ `
53
+
54
+ export const Divider = styled.div`
55
+ width: 1px;
56
+ height: 40px;
57
+ background-color: ${props => props.theme.colors.disabled};
58
+ margin-right: 25px;
59
+ ${props => props.theme.rtl && css`
60
+ margin-right: 0px;
61
+ margin-left: 25px;
62
+ `}
63
+ `
64
+
65
+ export const SearchWrapper = styled.div`
66
+ width: 100%;
67
+ margin-bottom: 23px;
68
+ input {
69
+ width: 100%;
70
+ }
71
+ `