ordering-ui-external 1.4.5 → 1.5.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 (155) hide show
  1. package/_bundles/{0.ordering-ui.9c913f613f7ccfd32dd9.js → 0.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  2. package/_bundles/{1.ordering-ui.9c913f613f7ccfd32dd9.js → 1.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  3. package/_bundles/{2.ordering-ui.9c913f613f7ccfd32dd9.js → 2.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  4. package/_bundles/{4.ordering-ui.9c913f613f7ccfd32dd9.js → 4.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  5. package/_bundles/{5.ordering-ui.9c913f613f7ccfd32dd9.js → 5.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  6. package/_bundles/{6.ordering-ui.9c913f613f7ccfd32dd9.js → 6.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  7. package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js → 7.ordering-ui.5de718771fdf8a9bc402.js} +2 -2
  8. package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → 7.ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.9c913f613f7ccfd32dd9.js → 8.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  10. package/_bundles/{9.ordering-ui.9c913f613f7ccfd32dd9.js → 9.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
  11. package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js → ordering-ui.5de718771fdf8a9bc402.js} +2 -2
  12. package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt} +0 -0
  13. package/_modules/components/LogoutButton/index.js +9 -4
  14. package/_modules/components/PaymentOptions/index.js +14 -7
  15. package/_modules/components/SpinnerLoader/styles.js +1 -1
  16. package/_modules/components/UserProfileForm/index.js +15 -2
  17. package/_modules/components/UserProfileForm/styles.js +1 -1
  18. package/_modules/hooks/useRecaptcha.js +62 -0
  19. package/_modules/themes/five/src/components/AddressForm/styles.js +3 -3
  20. package/_modules/themes/five/src/components/AddressList/index.js +1 -1
  21. package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
  22. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +5 -5
  23. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +12 -10
  24. package/_modules/themes/five/src/components/BusinessController/index.js +6 -4
  25. package/_modules/themes/five/src/components/BusinessController/styles.js +10 -4
  26. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +21 -6
  27. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +6 -17
  28. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +3 -4
  29. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -3
  30. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +2 -2
  31. package/_modules/themes/five/src/components/BusinessReviews/index.js +16 -8
  32. package/_modules/themes/five/src/components/BusinessReviews/styles.js +6 -4
  33. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +58 -34
  34. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -23
  35. package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
  36. package/_modules/themes/five/src/components/Footer/index.js +2 -1
  37. package/_modules/themes/five/src/components/Footer/styles.js +1 -1
  38. package/_modules/themes/five/src/components/Header/index.js +18 -11
  39. package/_modules/themes/five/src/components/Header/styles.js +7 -7
  40. package/_modules/themes/five/src/components/HomeHero/index.js +0 -15
  41. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +116 -31
  42. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +36 -37
  43. package/_modules/themes/five/src/components/LoginForm/index.js +62 -21
  44. package/_modules/themes/five/src/components/LoginForm/styles.js +1 -1
  45. package/_modules/themes/five/src/components/Messages/index.js +19 -3
  46. package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +6 -6
  47. package/_modules/themes/five/src/components/MyOrders/index.js +4 -4
  48. package/_modules/themes/five/src/components/NavigationBar/index.js +145 -34
  49. package/_modules/themes/five/src/components/NavigationBar/styles.js +1 -1
  50. package/_modules/themes/five/src/components/OrderDetails/index.js +46 -7
  51. package/_modules/themes/five/src/components/OrderDetails/styles.js +11 -3
  52. package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
  53. package/_modules/themes/five/src/components/PaymentOptions/index.js +23 -16
  54. package/_modules/themes/five/src/components/PaymentOptions/styles.js +1 -1
  55. package/_modules/themes/five/src/components/ProductForm/index.js +9 -7
  56. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +10 -4
  57. package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +11 -3
  58. package/_modules/themes/five/src/components/ProductShare/ProductCopyURL.js +61 -0
  59. package/_modules/themes/five/src/components/ProductShare/index.js +107 -0
  60. package/_modules/themes/five/src/components/ProductShare/styles.js +40 -0
  61. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
  62. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +18 -16
  63. package/_modules/themes/five/src/components/ReviewProduct/index.js +5 -3
  64. package/_modules/themes/five/src/components/ReviewProduct/styles.js +19 -3
  65. package/_modules/themes/five/src/components/SearchProducts/index.js +13 -2
  66. package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
  67. package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +57 -17
  68. package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +57 -17
  69. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +57 -17
  70. package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +57 -17
  71. package/_modules/themes/five/src/components/SignUpForm/index.js +60 -20
  72. package/_modules/themes/five/src/components/SignUpForm/styles.js +2 -2
  73. package/_modules/themes/five/src/components/SingleProductCard/index.js +36 -2
  74. package/_modules/themes/five/src/components/UserProfileForm/index.js +105 -8
  75. package/_modules/themes/five/src/components/UserProfileForm/styles.js +30 -17
  76. package/_modules/utils/index.js +26 -11
  77. package/index-template.js +11 -1
  78. package/package.json +2 -2
  79. package/src/components/LogoutButton/index.js +10 -8
  80. package/src/components/PaymentOptions/index.js +16 -11
  81. package/src/components/SpinnerLoader/styles.js +1 -0
  82. package/src/components/UserProfileForm/index.js +12 -2
  83. package/src/components/UserProfileForm/styles.js +1 -1
  84. package/src/hooks/useRecaptcha.js +40 -0
  85. package/src/themes/five/src/components/AddressForm/styles.js +3 -2
  86. package/src/themes/five/src/components/AddressList/index.js +1 -1
  87. package/src/themes/five/src/components/AddressList/styles.js +2 -2
  88. package/src/themes/five/src/components/BusinessBasicInformation/index.js +74 -71
  89. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +69 -20
  90. package/src/themes/five/src/components/BusinessController/index.js +3 -1
  91. package/src/themes/five/src/components/BusinessController/styles.js +8 -0
  92. package/src/themes/five/src/components/BusinessListingSearch/index.js +16 -1
  93. package/src/themes/five/src/components/BusinessProductsCategories/index.js +6 -18
  94. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  95. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  96. package/src/themes/five/src/components/BusinessProductsListing/styles.js +2 -3
  97. package/src/themes/five/src/components/BusinessReviews/index.js +17 -10
  98. package/src/themes/five/src/components/BusinessReviews/styles.js +7 -0
  99. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +64 -19
  100. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +99 -1
  101. package/src/themes/five/src/components/DriverTips/styles.js +1 -1
  102. package/src/themes/five/src/components/Footer/index.js +9 -5
  103. package/src/themes/five/src/components/Footer/styles.js +2 -6
  104. package/src/themes/five/src/components/Header/index.js +16 -8
  105. package/src/themes/five/src/components/Header/styles.js +49 -8
  106. package/src/themes/five/src/components/HomeHero/index.js +0 -6
  107. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +163 -60
  108. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +145 -82
  109. package/src/themes/five/src/components/LoginForm/index.js +30 -4
  110. package/src/themes/five/src/components/LoginForm/styles.js +8 -0
  111. package/src/themes/five/src/components/Messages/index.js +8 -2
  112. package/src/themes/five/src/components/MultiOrdersDetails/styles.js +34 -1
  113. package/src/themes/five/src/components/MyOrders/index.js +4 -4
  114. package/src/themes/five/src/components/NavigationBar/index.js +153 -39
  115. package/src/themes/five/src/components/NavigationBar/styles.js +2 -2
  116. package/src/themes/five/src/components/OrderDetails/index.js +45 -8
  117. package/src/themes/five/src/components/OrderDetails/styles.js +50 -0
  118. package/src/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
  119. package/src/themes/five/src/components/PaymentOptions/index.js +13 -7
  120. package/src/themes/five/src/components/PaymentOptions/styles.js +5 -0
  121. package/src/themes/five/src/components/ProductForm/index.js +9 -7
  122. package/src/themes/five/src/components/ProductItemAccordion/index.js +67 -53
  123. package/src/themes/five/src/components/ProductItemAccordion/styles.js +26 -0
  124. package/src/themes/five/src/components/ProductShare/ProductCopyURL.js +53 -0
  125. package/src/themes/five/src/components/ProductShare/index.js +104 -0
  126. package/src/themes/five/src/components/ProductShare/styles.js +165 -0
  127. package/src/themes/five/src/components/RenderProductsLayout/index.js +2 -8
  128. package/src/themes/five/src/components/RenderProductsLayout/styles.js +5 -0
  129. package/src/themes/five/src/components/ReviewProduct/index.js +10 -3
  130. package/src/themes/five/src/components/ReviewProduct/styles.js +43 -0
  131. package/src/themes/five/src/components/SearchProducts/index.js +16 -3
  132. package/src/themes/five/src/components/SignUpApproval/index.js +8 -7
  133. package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +26 -2
  134. package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +26 -2
  135. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +26 -2
  136. package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +26 -2
  137. package/src/themes/five/src/components/SignUpForm/index.js +26 -1
  138. package/src/themes/five/src/components/SignUpForm/styles.js +9 -2
  139. package/src/themes/five/src/components/SingleProductCard/index.js +26 -1
  140. package/src/themes/five/src/components/UserPopover/index.js +1 -1
  141. package/src/themes/five/src/components/UserProfileForm/index.js +83 -5
  142. package/src/themes/five/src/components/UserProfileForm/styles.js +49 -0
  143. package/src/utils/index.js +36 -9
  144. package/template/app.js +12 -11
  145. package/template/assets/images/amex.svg +30 -0
  146. package/template/assets/images/diners.svg +16 -0
  147. package/template/assets/images/discover.svg +17 -0
  148. package/template/assets/images/jcb.svg +33 -0
  149. package/template/assets/images/unionpay.svg +25 -0
  150. package/template/components/HelmetTags/index.js +1 -1
  151. package/template/components/ScrollToTop/index.js +7 -5
  152. package/template/pages/BusinessProductsList/index.js +8 -4
  153. package/template/pages/MyOrders/index.js +4 -1
  154. package/template/pages/OrderDetails/index.js +11 -2
  155. package/template/pages/Profile/index.js +8 -2
@@ -13,7 +13,7 @@ import {
13
13
  } from '../SidebarMenu/styles'
14
14
 
15
15
  const LogoutButtonUI = (props) => {
16
- const { onCustomClick } = props
16
+ const { onCustomClick, hideText } = props
17
17
  const [, t] = useLanguage()
18
18
 
19
19
  const isHome = window.location.pathname === '/' || window.location.pathname === '/home'
@@ -40,16 +40,18 @@ const LogoutButtonUI = (props) => {
40
40
  }
41
41
 
42
42
  return (
43
- <MenuLink onClick={handleLogOutClick} isHome={isHome}>
44
- <WrappContent>
43
+ <MenuLink id='logoutbtn' onClick={handleLogOutClick} isHome={isHome} style={props.styleContainer}>
44
+ <WrappContent style={props.styleWrappContent}>
45
45
  <MenuLinkIcon isHome={isHome}>
46
46
  <FaSignOutAlt />
47
47
  </MenuLinkIcon>
48
- <MenuLinkText>
49
- <TextInfo isHome={isHome}>
50
- {t('LOGOUT', 'Logout')}
51
- </TextInfo>
52
- </MenuLinkText>
48
+ {!hideText && (
49
+ <MenuLinkText>
50
+ <TextInfo isHome={isHome}>
51
+ {t('LOGOUT', 'Logout')}
52
+ </TextInfo>
53
+ </MenuLinkText>
54
+ )}
53
55
  <MenuLinkSeparator>
54
56
  <div>
55
57
  <hr />
@@ -8,9 +8,10 @@ import FaCcStripe from '@meronex/icons/fa/FaCcStripe'
8
8
  import FaStripeS from '@meronex/icons/fa/FaStripeS'
9
9
  import GrStripe from '@meronex/icons/gr/GrStripe'
10
10
  import EnPaypal from '@meronex/icons/en/EnPaypal'
11
- import {
11
+ import {
12
12
  PaymentOptions as PaymentOptionsController,
13
13
  useLanguage,
14
+ useOrder,
14
15
  useSession
15
16
  } from 'ordering-components-external'
16
17
 
@@ -83,10 +84,14 @@ const PaymentOptionsUI = (props) => {
83
84
  setCardData,
84
85
  onPlaceOrderClick,
85
86
  setCreateOrder,
86
- handlePlaceOrder
87
+ handlePlaceOrder,
88
+ paymethods
87
89
  } = props
88
90
  const [, t] = useLanguage()
89
91
  const [{ token }] = useSession()
92
+ const [{ loading: loadingOptions }] = useOrder()
93
+
94
+ const list = paymethods ? paymethods?.map(pay => pay.paymethod) : paymethodsList?.paymethods
90
95
 
91
96
  const paymethodSelected = props.paySelected || props.paymethodSelected
92
97
 
@@ -100,10 +105,10 @@ const PaymentOptionsUI = (props) => {
100
105
  }
101
106
 
102
107
  useEffect(() => {
103
- if (paymethodsList.paymethods.length === 1) {
104
- handlePaymethodClick && handlePaymethodClick(paymethodsList.paymethods[0])
108
+ if (list?.length === 1) {
109
+ handlePaymethodClick && handlePaymethodClick(list[0])
105
110
  }
106
- }, [paymethodsList.paymethods])
111
+ }, [list])
107
112
 
108
113
  useEffect(() => {
109
114
  if (paymethodSelected?.gateway !== 'cash' && errorCash) {
@@ -134,8 +139,9 @@ const PaymentOptionsUI = (props) => {
134
139
  <BeforeComponent key={i} {...props} />))}
135
140
  <PaymentMethodsContainer>
136
141
  <PaymentMethodsList className='payments-list'>
137
- {paymethodsList.paymethods.length > 0 && (
138
- paymethodsList.paymethods.sort((a, b) => a.id - b.id).map(paymethod => (
142
+ {!(paymethodsList.loading || isLoading || loadingOptions) &&
143
+ list?.length > 0 && (
144
+ list?.sort((a, b) => a.id - b.id).map(paymethod => (
139
145
  <React.Fragment key={paymethod.id}>
140
146
  {
141
147
  (!isCustomerMode || (isCustomerMode && (paymethod.gateway === 'card_delivery' || paymethod.gateway === 'cash'))) && (
@@ -154,8 +160,7 @@ const PaymentOptionsUI = (props) => {
154
160
  </React.Fragment>
155
161
  ))
156
162
  )}
157
-
158
- {(paymethodsList.loading || isLoading) && (
163
+ {(paymethodsList.loading || isLoading || loadingOptions) && (
159
164
  [...Array(5).keys()].map(i => (
160
165
  <PayCard key={i} isSkeleton>
161
166
  <Skeleton key={i} width={100} height={60} style={{ marginLeft: '10px' }} />
@@ -169,9 +174,9 @@ const PaymentOptionsUI = (props) => {
169
174
  />
170
175
  )}
171
176
 
172
- {!(paymethodsList.loading || isLoading) &&
177
+ {!(paymethodsList.loading || isLoading || loadingOptions) &&
173
178
  !paymethodsList.error &&
174
- (!paymethodsList?.paymethods || paymethodsList.paymethods.length === 0) &&
179
+ !(list || list?.length) &&
175
180
  (
176
181
  <p>{t('NO_PAYMENT_METHODS', 'No payment methods!')}</p>
177
182
  )}
@@ -6,6 +6,7 @@ export const Container = styled.div`
6
6
  display: flex;
7
7
  justify-content: center;
8
8
  align-items: center;
9
+ z-index: 2001;
9
10
  flex-direction: column;
10
11
  `
11
12
 
@@ -9,6 +9,7 @@ import {
9
9
  useOrderingTheme
10
10
  } from 'ordering-components-external'
11
11
 
12
+ import { useWindowSize } from '../../hooks/useWindowSize'
12
13
  import { UserFormDetailsUI } from '../UserFormDetails'
13
14
  import { UserFormDetailsUI as UserFormDetailsFiveUI } from '../../themes/five/src/components/UserFormDetails'
14
15
  import { AddressList } from '../AddressList'
@@ -35,6 +36,7 @@ import {
35
36
  SkeletonWrapper,
36
37
  WrapperForm
37
38
  } from './styles'
39
+ import { LogoutButton } from '../LogoutButton'
38
40
 
39
41
  const UserProfileFormUI = (props) => {
40
42
  const {
@@ -53,6 +55,7 @@ const UserProfileFormUI = (props) => {
53
55
  const [alertState, setAlertState] = useState({ open: false, content: [] })
54
56
  const inputRef = useRef(null)
55
57
  const [orderingTheme] = useOrderingTheme()
58
+ const windowSize = useWindowSize()
56
59
 
57
60
  const showCustomerPicture = !orderingTheme?.theme?.profile?.components?.picture?.hidden
58
61
  const showCustomerName = !orderingTheme?.theme?.profile?.components?.name?.hidden
@@ -119,7 +122,7 @@ const UserProfileFormUI = (props) => {
119
122
  </React.Fragment>))}
120
123
  {props.beforeComponents?.map((BeforeComponent, i) => (
121
124
  <BeforeComponent key={i} {...props} />))}
122
- {!isHiddenAddress && (
125
+ {!isHiddenAddress && !props.hideOptions && (
123
126
  <ProfileOptions value='account' />
124
127
  )}
125
128
  <Container>
@@ -141,7 +144,7 @@ const UserProfileFormUI = (props) => {
141
144
  </UploadImageIcon>
142
145
  )
143
146
  : formState?.changes?.photo && formState.result.error &&
144
- <img src={formState?.changes?.photo} alt='user image' loading='lazy' />
147
+ <img src={formState?.changes?.photo} alt='user image' loading='lazy' />
145
148
  )}
146
149
  </DragAndDrop>
147
150
  </ExamineClick>
@@ -177,6 +180,13 @@ const UserProfileFormUI = (props) => {
177
180
  {t('EDIT', 'Edit')}
178
181
  </Button>
179
182
  )}
183
+ {windowSize.width <= 576 && props.showLogout && (
184
+ <LogoutButton
185
+ hideText
186
+ styleContainer={{ margin: 'auto', width: 24 }}
187
+ styleWrappContent={{ paddingRight: 0, paddingLeft: 0 }}
188
+ />
189
+ )}
180
190
  </UserData>
181
191
  )
182
192
  ) : (
@@ -110,7 +110,7 @@ export const UserData = styled.div`
110
110
  font-size: 20px
111
111
  }
112
112
 
113
- > * {
113
+ > *:not(#logoutbtn) {
114
114
  margin: 5px 0;
115
115
  width: 75%;
116
116
  }
@@ -0,0 +1,40 @@
1
+ import { useEffect, useState } from 'react'
2
+ import { useConfig, useLanguage, useToast, ToastType } from 'ordering-components-external'
3
+
4
+ /**
5
+ * Hook to mangage Recaptcha version
6
+ * @param {boolean} enableRecaptcha
7
+ */
8
+ export const useRecaptcha = (enableRecaptcha) => {
9
+ const [{ configs }] = useConfig()
10
+ const [reCaptchaConfig, setRecaptchaConfig] = useState({ version: 'v3', siteKey: '' })
11
+ const [, { showToast }] = useToast()
12
+ const [, t] = useLanguage()
13
+
14
+ useEffect(() => {
15
+ if (configs && Object.keys(configs).length > 0 && enableRecaptcha && reCaptchaConfig?.siteKey === '') {
16
+ if (configs?.security_recaptcha_type?.value === 'v3' &&
17
+ configs?.security_recaptcha_score_v3?.value > 0 &&
18
+ configs?.security_recaptcha_site_key_v3?.value
19
+ ) {
20
+ setRecaptchaConfig({
21
+ version: 'v3',
22
+ siteKey: configs?.security_recaptcha_site_key_v3?.value,
23
+ error: false
24
+ })
25
+ return
26
+ }
27
+ if (configs?.security_recaptcha_site_key?.value) {
28
+ setRecaptchaConfig({
29
+ version: 'v2',
30
+ siteKey: configs?.security_recaptcha_site_key?.value,
31
+ error: false
32
+ })
33
+ return
34
+ }
35
+ showToast(ToastType.Error, t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key'))
36
+ }
37
+ }, [configs, enableRecaptcha])
38
+
39
+ return [reCaptchaConfig]
40
+ }
@@ -26,7 +26,7 @@ export const FormControl = styled.form`
26
26
  input {
27
27
  box-sizing: border-box;
28
28
  margin: 10px 0px;
29
- height: 43px;
29
+ height: 50px;
30
30
  width: 100%;
31
31
  &.internal_number,
32
32
  &.zipcode {
@@ -106,6 +106,7 @@ export const AddressWrap = styled.div`
106
106
  justify-content: space-between;
107
107
  align-items: center;
108
108
  position: relative;
109
+ margin-top: -11px;
109
110
 
110
111
  button {
111
112
  height: 41px;
@@ -204,7 +205,7 @@ export const WrapperMap = styled.div`
204
205
  export const WrapperSkeleton = styled.div`
205
206
  display: flex;
206
207
  flex-direction: column;
207
- padding: 10px;
208
+ padding: 9px 10px;
208
209
 
209
210
  span {
210
211
  width: 100%;
@@ -79,7 +79,7 @@ const AddressListUI = (props) => {
79
79
  const { width } = useWindowSize()
80
80
  const isCompletedLayout = width < 769 || isProfile
81
81
  const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
82
- (address, i, self) =>
82
+ (address, i, self) => address.address &&
83
83
  i === self.findIndex(obj => (
84
84
  address.address === obj.address &&
85
85
  address.address_notes === obj.address_notes &&
@@ -252,9 +252,9 @@ export const CloseIcon = styled.div`
252
252
 
253
253
  export const TitleFormContainer = styled.div`
254
254
  display: flex;
255
- align-items: center;
255
+ align-items: flex-start;
256
256
  h1 {
257
- margin: auto;
257
+ margin: 0 auto;
258
258
  font-size: 24px;
259
259
  }
260
260
  `
@@ -33,7 +33,8 @@ import {
33
33
  SearchIconWrapper,
34
34
  SearchComponentContainer,
35
35
  SocialList,
36
- IconWrapper
36
+ IconWrapper,
37
+ BusinessInfoWrapper
37
38
  } from './styles'
38
39
  import { BusinessPreorder } from '../BusinessPreorder'
39
40
 
@@ -377,81 +378,83 @@ export const BusinessBasicInformation = (props) => {
377
378
  business={businessState.business}
378
379
  />
379
380
  )}
380
- {!isInfoShrunken && (
381
- <BusinessInfoComponent />
382
- )}
383
- <BusinessContainer bgimage={business?.header} isSkeleton={isSkeleton} id='container' isClosed={!business?.open}>
384
- {(!loading && !business?.open) && <h1>{t('CLOSED', 'Closed')}</h1>}
385
- {showLogo && (
386
- <BusinessContent>
387
- <WrapperBusinessLogo>
388
- {!loading ? (
389
- <BusinessLogo bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_200,c_limit')} />
390
- ) : (
391
- <Skeleton height={70} width={70} />
392
- )}
393
- </WrapperBusinessLogo>
394
- </BusinessContent>
395
- )}
396
- {isInfoShrunken && (
381
+ <BusinessInfoWrapper>
382
+ {!isInfoShrunken && (
397
383
  <BusinessInfoComponent />
398
384
  )}
399
- {!loading && (
400
- <>
401
- {isInfoShrunken && (
402
- <SearchComponentContainer>
403
- <SearchComponent />
404
- </SearchComponentContainer>
405
- )}
406
- <BusinessMoreDetail>
407
- <BsInfoCircle onClick={() => setOpenBusinessInformation(true)} />
408
- </BusinessMoreDetail>
409
- </>
410
- )}
411
- <Modal
412
- width='70%'
413
- open={openBusinessInformation}
414
- onClose={setOpenBusinessInformation}
415
- padding='0'
416
- hideCloseDefault
417
- isTransparent
418
- >
419
- <BusinessInformation
420
- business={business}
421
- getBusinessType={getBusinessType}
422
- optimizeImage={optimizeImage}
385
+ <BusinessContainer bgimage={business?.header || theme?.images?.dummies?.businessHeader} isSkeleton={isSkeleton} id='container' isClosed={!business?.open}>
386
+ {(!loading && !business?.open) && <h1>{t('CLOSED', 'Closed')}</h1>}
387
+ {showLogo && (
388
+ <BusinessContent>
389
+ <WrapperBusinessLogo>
390
+ {!loading ? (
391
+ <BusinessLogo bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_200,c_limit')} />
392
+ ) : (
393
+ <Skeleton height={70} width={70} />
394
+ )}
395
+ </WrapperBusinessLogo>
396
+ </BusinessContent>
397
+ )}
398
+ {isInfoShrunken && (
399
+ <BusinessInfoComponent />
400
+ )}
401
+ {!loading && (
402
+ <>
403
+ {isInfoShrunken && (
404
+ <SearchComponentContainer>
405
+ <SearchComponent />
406
+ </SearchComponentContainer>
407
+ )}
408
+ <BusinessMoreDetail>
409
+ <BsInfoCircle onClick={() => setOpenBusinessInformation(true)} />
410
+ </BusinessMoreDetail>
411
+ </>
412
+ )}
413
+ <Modal
414
+ width='70%'
415
+ open={openBusinessInformation}
423
416
  onClose={setOpenBusinessInformation}
424
- />
425
- </Modal>
426
- <Modal
427
- width='70%'
428
- open={isBusinessReviews}
429
- onClose={() => setIsBusinessReviews(false)}
430
- padding='20px'
431
- >
432
- <BusinessReviews
433
- businessId={business.id}
434
- reviews={business.reviews?.reviews}
435
- businessName={business.name}
436
- stars={business.reviews?.total}
437
- />
438
- </Modal>
439
- <Modal
440
- open={isPreOrder}
441
- width={isCustomerMode ? '700px' : '760px'}
442
- onClose={() => setIsPreOrder(false)}
443
- padding={isCustomerMode && '20px'}
444
- >
445
- {isCustomerMode ? (
446
- <MomentContent onClose={() => setIsPreOrder(false)} />
447
- ) : (
448
- <BusinessPreorder
417
+ padding='0'
418
+ hideCloseDefault
419
+ isTransparent
420
+ >
421
+ <BusinessInformation
449
422
  business={business}
450
- handleClick={() => setIsPreOrder(false)}
423
+ getBusinessType={getBusinessType}
424
+ optimizeImage={optimizeImage}
425
+ onClose={setOpenBusinessInformation}
451
426
  />
452
- )}
453
- </Modal>
454
- </BusinessContainer>
427
+ </Modal>
428
+ <Modal
429
+ width='70%'
430
+ open={isBusinessReviews}
431
+ onClose={() => setIsBusinessReviews(false)}
432
+ padding='20px'
433
+ >
434
+ <BusinessReviews
435
+ businessId={business.id}
436
+ reviews={business.reviews?.reviews}
437
+ businessName={business.name}
438
+ stars={business.reviews?.total}
439
+ />
440
+ </Modal>
441
+ <Modal
442
+ open={isPreOrder}
443
+ width={isCustomerMode ? '700px' : '760px'}
444
+ onClose={() => setIsPreOrder(false)}
445
+ padding={isCustomerMode && '20px'}
446
+ >
447
+ {isCustomerMode ? (
448
+ <MomentContent onClose={() => setIsPreOrder(false)} />
449
+ ) : (
450
+ <BusinessPreorder
451
+ business={business}
452
+ handleClick={() => setIsPreOrder(false)}
453
+ />
454
+ )}
455
+ </Modal>
456
+ </BusinessContainer>
457
+ </BusinessInfoWrapper>
455
458
  {props.afterComponents?.map((AfterComponent, i) => (
456
459
  <AfterComponent key={i} {...props} />))}
457
460
  {props.afterElements?.map((AfterElement, i) => (
@@ -14,9 +14,8 @@ export const BusinessContainer = styled.div`
14
14
  object-fit: cover;
15
15
  background-position: center;
16
16
  min-height: 200px;
17
- justify-content: center;
17
+ justify-content: start;
18
18
  align-items: flex-end;
19
- border-radius: 7.6px;
20
19
 
21
20
  ${props => props.isSkeleton && css`
22
21
  background-color: #cccccc;
@@ -40,27 +39,45 @@ export const BusinessContainer = styled.div`
40
39
  padding: 0;
41
40
  }
42
41
 
43
- @media (min-width: 490px) {
44
- justify-content: flex-start;
42
+ @media (min-width: 576px) {
43
+ border-radius: 7.6px;
45
44
  }
45
+
46
+
46
47
  `
47
48
 
48
49
  export const BusinessContent = styled.div`
49
- border-radius: 10px;
50
- margin: 10px;
51
- max-height: 124px;
52
- width: 124px;
50
+ margin: 0;
51
+ margin-left: 35px;
52
+ margin-bottom: -35px;
53
+ max-height: 80px;
54
+ width: 80px;
55
+ box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
56
+
57
+ @media (min-width: 576px) {
58
+ border-radius: 10px;
59
+ margin: 10px;
60
+ max-height: 124px;
61
+ width: 124px;
62
+ }
53
63
 
54
- @media (min-width: 426px) {
64
+ @media (min-width: 768px) {
55
65
  margin: 25px;
56
66
  }
57
67
  `
58
68
 
59
69
  export const WrapperBusinessLogo = styled.div`
60
- max-width: 124px;
61
- max-height: 124px;
62
- height: 124px;
63
- width: 124px;
70
+ max-width: 80px;
71
+ max-height: 80px;
72
+ width: 80px;
73
+ height: 80px;
74
+
75
+ @media (min-width: 576px) {
76
+ max-width: 124px;
77
+ max-height: 124px;
78
+ height: 124px;
79
+ width: 124px;
80
+ }
64
81
  `
65
82
 
66
83
  const BusinessLogoStyled = styled.div`
@@ -73,8 +90,11 @@ const BusinessLogoStyled = styled.div`
73
90
  background-size: cover;
74
91
  object-fit: cover;
75
92
  background-position: center;
76
- min-height: 124px;
93
+ min-height: 80px;
77
94
  border-radius: 7.6px;
95
+ @media (min-width: 576px) {
96
+ min-height: 124px;
97
+ }
78
98
  `
79
99
  export const BusinessLogo = (props) => {
80
100
  const style = {}
@@ -141,18 +161,31 @@ export const BusinessInfoItem = styled.div`
141
161
  `
142
162
 
143
163
  export const BusinessInfoContainer = styled.div`
144
- padding: 10px 0px;
145
- margin-bottom: 15px;
164
+ padding-top: 40px;
165
+ padding-left: 5px;
166
+ padding-right: 5px;
146
167
  display: flex;
147
168
  justify-content: space-between;
148
169
  flex-direction: column;
170
+ box-sizing: border-box;
171
+ align-items: flex-end;
172
+
173
+ @media (min-width: 576px) {
174
+ padding-top: 0px;
175
+ padding-left: 0px;
176
+ padding-right: 0px;
177
+ margin-top: 10px;
178
+ }
149
179
 
150
- @media (min-width: 700px) {
180
+ @media (min-width: 768px) {
151
181
  flex-direction: row;
182
+ margin-bottom: 25px;
152
183
  }
153
184
  `
154
185
 
155
- export const BusinessInfoContent = styled.div``
186
+ export const BusinessInfoContent = styled.div`
187
+ width: 100%;
188
+ `
156
189
 
157
190
  export const WrapperSearch = styled.div`
158
191
  margin: 15px 0px 0px;
@@ -296,9 +329,17 @@ export const TitleWrapper = styled.div`
296
329
  flex-wrap: wrap;
297
330
 
298
331
  h2 {
299
- font-weight: 600;
300
- font-size: 32px;
332
+ font-size: 24px;
333
+ line-height: 36px;
301
334
  margin: 0 0 10px 0;
335
+ font-weight: 600;
336
+ width: 100%;
337
+ overflow: hidden;
338
+ white-space: nowrap;
339
+ text-overflow: ellipsis;
340
+ @media (min-width: 768px) {
341
+ font-size: 32px;
342
+ }
302
343
  }
303
344
  `
304
345
 
@@ -404,3 +445,11 @@ export const IconWrapper = styled.a`
404
445
  }
405
446
  }
406
447
  `
448
+
449
+ export const BusinessInfoWrapper = styled.div`
450
+ display: flex;
451
+ flex-direction: column-reverse;
452
+ @media (min-width: 768px) {
453
+ flex-direction: column;
454
+ }
455
+ `
@@ -8,7 +8,7 @@ import { Modal } from '../Modal'
8
8
  import { LoginForm } from '../LoginForm'
9
9
  import { SignUpForm } from '../SignUpForm'
10
10
  import { ForgotPasswordForm } from '../ForgotPasswordForm'
11
- import { convertHoursToMinutes, shape } from '../../../../../utils'
11
+ import { convertHoursToMinutes, LightenDarkenColor, shape } from '../../../../../utils'
12
12
 
13
13
  import {
14
14
  ContainerCard,
@@ -145,6 +145,8 @@ const BusinessControllerUI = (props) => {
145
145
  {business?.ribbon?.enabled && (
146
146
  <RibbonBox
147
147
  bgColor={business?.ribbon?.color}
148
+ colorText={LightenDarkenColor(business?.ribbon?.color, -200)}
149
+ borderRibbon={LightenDarkenColor(business?.ribbon?.color, -200)}
148
150
  isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
149
151
  isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
150
152
  >
@@ -449,6 +449,14 @@ export const RibbonBox = styled.div`
449
449
  ${({ isCapsule }) => isCapsule && css`
450
450
  border-radius: 50px;
451
451
  `}
452
+
453
+ ${({ colorText }) => colorText && css`
454
+ color: ${colorText};
455
+ `}
456
+
457
+ ${({ borderRibbon }) => borderRibbon && css`
458
+ border: 1px solid ${borderRibbon};
459
+ `}
452
460
  `
453
461
 
454
462
  export const FavoriteWrapper = styled.div`
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react'
1
+ import React, { useState, useEffect, useCallback } from 'react'
2
2
  import {
3
3
  BusinessListingSearchContainer,
4
4
  FiltersContainer,
@@ -55,6 +55,8 @@ import { Modal } from '../Modal'
55
55
  import { ProductForm } from '../ProductForm'
56
56
  import { MaxSectionItem } from './MaxSectionItem'
57
57
 
58
+ const PIXELS_TO_SCROLL = 300
59
+
58
60
  export const BusinessListingSearchUI = (props) => {
59
61
  const {
60
62
  businessesSearchList,
@@ -99,6 +101,14 @@ export const BusinessListingSearchUI = (props) => {
99
101
 
100
102
  const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
101
103
 
104
+ const handleScroll = useCallback(() => {
105
+ const innerHeightScrolltop = window.innerHeight + document.documentElement?.scrollTop + PIXELS_TO_SCROLL
106
+ const badScrollPosition = innerHeightScrolltop < document.documentElement?.offsetHeight
107
+ const hasMore = !(paginationProps?.totalPages === paginationProps?.currentPage)
108
+ if (badScrollPosition || businessesSearchList?.loading || businessesSearchList.error?.length > 0 || !hasMore) return
109
+ handleSearchbusinessAndProducts()
110
+ }, [businessesSearchList.loading, paginationProps])
111
+
102
112
  const handleChangeBrandFilter = (brandId) => {
103
113
  let franchiseIds = [...filters?.franchise_ids]
104
114
  if (filters?.franchise_ids?.includes(brandId)) franchiseIds = filters?.franchise_ids?.filter(item => item !== brandId)
@@ -124,6 +134,11 @@ export const BusinessListingSearchUI = (props) => {
124
134
  setCurProduct({ business: null, product: null })
125
135
  }
126
136
 
137
+ useEffect(() => {
138
+ window.addEventListener('scroll', handleScroll)
139
+ return () => window.removeEventListener('scroll', handleScroll)
140
+ }, [handleScroll])
141
+
127
142
  return (
128
143
  <BusinessListingSearchContainer>
129
144
  <BusinessesTitle>