ordering-ui-external 1.7.2 → 1.8.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 (171) hide show
  1. package/_bundles/{0.ordering-ui.f9c3deec77a8e21645ed.js → 0.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  2. package/_bundles/{1.ordering-ui.f9c3deec77a8e21645ed.js → 1.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  3. package/_bundles/2.ordering-ui.cf9ba81c5417ae8af84a.js +1 -0
  4. package/_bundles/{4.ordering-ui.f9c3deec77a8e21645ed.js → 4.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  5. package/_bundles/{5.ordering-ui.f9c3deec77a8e21645ed.js → 5.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  6. package/_bundles/{6.ordering-ui.f9c3deec77a8e21645ed.js → 6.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  7. package/_bundles/{7.ordering-ui.f9c3deec77a8e21645ed.js → 7.ordering-ui.cf9ba81c5417ae8af84a.js} +2 -2
  8. package/_bundles/{7.ordering-ui.f9c3deec77a8e21645ed.js.LICENSE.txt → 7.ordering-ui.cf9ba81c5417ae8af84a.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.f9c3deec77a8e21645ed.js → 8.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  10. package/_bundles/{9.ordering-ui.f9c3deec77a8e21645ed.js → 9.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  11. package/_bundles/ordering-ui.cf9ba81c5417ae8af84a.js +2 -0
  12. package/_bundles/{ordering-ui.f9c3deec77a8e21645ed.js.LICENSE.txt → ordering-ui.cf9ba81c5417ae8af84a.js.LICENSE.txt} +0 -0
  13. package/_modules/components/BusinessInformation/index.js +4 -8
  14. package/_modules/components/OrdersOption/styles.js +4 -2
  15. package/_modules/components/Pagination/index.js +100 -0
  16. package/_modules/components/Pagination/styles.js +56 -0
  17. package/_modules/components/SmartAppBanner/index.js +2 -1
  18. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +92 -0
  19. package/_modules/components/VerticalOrdersLayout/index.js +115 -41
  20. package/_modules/components/VerticalOrdersLayout/styles.js +25 -11
  21. package/_modules/index.js +7 -0
  22. package/_modules/themes/five/src/components/AccordionDropdown/index.js +15 -4
  23. package/_modules/themes/five/src/components/AccordionDropdown/styles.js +14 -4
  24. package/_modules/themes/five/src/components/AddressList/styles.js +2 -2
  25. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +17 -10
  26. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +48 -42
  27. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +5 -1
  28. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +0 -3
  29. package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/index.js +22 -13
  30. package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +15 -7
  31. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +3 -0
  32. package/_modules/themes/five/src/components/BusinessTypeFilter/index.js +15 -5
  33. package/_modules/themes/five/src/components/BusinessesListing/index.js +6 -13
  34. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +66 -40
  35. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +13 -7
  36. package/_modules/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/index.js +16 -7
  37. package/_modules/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/styles.js +21 -15
  38. package/_modules/themes/five/src/components/CardForm/index.js +17 -3
  39. package/_modules/themes/five/src/components/CardForm/styles.js +14 -6
  40. package/_modules/themes/five/src/components/CartPopover/index.js +6 -4
  41. package/_modules/themes/five/src/components/CartPopover/styles.js +4 -2
  42. package/_modules/themes/five/src/components/Footer/index.js +16 -6
  43. package/_modules/themes/five/src/components/Footer/styles.js +11 -9
  44. package/_modules/themes/five/src/components/Header/index.js +14 -9
  45. package/_modules/themes/five/src/components/Header/styles.js +64 -44
  46. package/_modules/themes/five/src/components/HeaderOption/index.js +9 -2
  47. package/_modules/themes/five/src/components/HeaderOption/styles.js +8 -2
  48. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +9 -3
  49. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +5 -3
  50. package/_modules/themes/five/src/components/HorizontalOrdersLayout/index.js +9 -19
  51. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +23 -19
  52. package/_modules/themes/five/src/components/InputPhoneNumber/index.js +1 -0
  53. package/_modules/themes/five/src/components/LoginForm/index.js +3 -2
  54. package/_modules/themes/five/src/components/MyOrders/index.js +24 -56
  55. package/_modules/themes/five/src/components/MyOrders/styles.js +1 -1
  56. package/_modules/themes/five/src/components/OrderDetails/index.js +5 -2
  57. package/_modules/themes/five/src/components/OrderDetails/styles.js +24 -24
  58. package/_modules/themes/five/src/components/OrderItAgain/styles.js +6 -2
  59. package/_modules/themes/five/src/components/OrdersOption/index.js +18 -18
  60. package/_modules/themes/five/src/components/OrdersOption/styles.js +2 -2
  61. package/_modules/themes/five/src/components/PageBanner/index.js +50 -0
  62. package/_modules/themes/five/src/components/PageBanner/styles.js +18 -0
  63. package/_modules/themes/five/src/components/Pagination/index.js +99 -0
  64. package/_modules/themes/five/src/components/Pagination/styles.js +56 -0
  65. package/_modules/themes/five/src/components/ProductForm/index.js +39 -23
  66. package/_modules/themes/five/src/components/ProductForm/styles.js +74 -38
  67. package/_modules/themes/five/src/components/Promotions/index.js +7 -2
  68. package/_modules/themes/five/src/components/Promotions/styles.js +16 -14
  69. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +31 -10
  70. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +19 -11
  71. package/_modules/themes/five/src/components/SidebarMenu/styles.js +1 -1
  72. package/_modules/themes/five/src/components/SignUpForm/index.js +3 -2
  73. package/_modules/themes/five/src/components/SingleOrderCard/index.js +7 -17
  74. package/_modules/themes/five/src/components/SingleProductCard/index.js +7 -298
  75. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +310 -0
  76. package/_modules/themes/five/src/components/SingleProductCard/{styles.js → layouts/original/styles.js} +37 -33
  77. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +305 -0
  78. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/styles.js +143 -0
  79. package/_modules/themes/five/src/components/StripeElementsForm/index.js +1 -0
  80. package/_modules/themes/five/src/components/UserPopover/index.js +3 -1
  81. package/_modules/themes/five/src/components/UserPopover/styles.js +4 -3
  82. package/_modules/themes/five/src/components/UserProfileForm/styles.js +5 -8
  83. package/_modules/themes/six/src/components/BusinessController/index.js +81 -15
  84. package/_modules/themes/six/src/components/BusinessController/styles.js +58 -30
  85. package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +5 -3
  86. package/_modules/themes/six/src/components/BusinessesMap/styles.js +1 -1
  87. package/_modules/themes/six/src/components/SearchBar/index.js +19 -10
  88. package/_modules/themes/six/src/components/SearchBar/styles.js +44 -16
  89. package/index-template.js +3 -1
  90. package/package.json +2 -2
  91. package/src/components/BusinessInformation/index.js +3 -8
  92. package/src/components/OrdersOption/styles.js +5 -5
  93. package/src/components/Pagination/index.js +107 -0
  94. package/src/components/Pagination/styles.js +106 -0
  95. package/src/components/SmartAppBanner/index.js +1 -0
  96. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +89 -0
  97. package/src/components/VerticalOrdersLayout/index.js +86 -48
  98. package/src/components/VerticalOrdersLayout/styles.js +66 -22
  99. package/src/index.js +2 -0
  100. package/src/themes/five/src/components/AccordionDropdown/index.js +19 -6
  101. package/src/themes/five/src/components/AccordionDropdown/styles.js +25 -1
  102. package/src/themes/five/src/components/AddressList/styles.js +2 -0
  103. package/src/themes/five/src/components/BusinessBasicInformation/index.js +21 -11
  104. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +9 -3
  105. package/src/themes/five/src/components/BusinessListingSearch/index.js +1 -0
  106. package/src/themes/five/src/components/BusinessProductsCategories/index.js +0 -2
  107. package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/index.js +23 -12
  108. package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +12 -4
  109. package/src/themes/five/src/components/BusinessProductsListing/index.js +3 -0
  110. package/src/themes/five/src/components/BusinessTypeFilter/index.js +15 -5
  111. package/src/themes/five/src/components/BusinessesListing/index.js +5 -5
  112. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +54 -25
  113. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -26
  114. package/src/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/index.js +19 -6
  115. package/src/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/styles.js +38 -3
  116. package/src/themes/five/src/components/CardForm/index.js +49 -8
  117. package/src/themes/five/src/components/CardForm/styles.js +20 -2
  118. package/src/themes/five/src/components/CartPopover/index.js +2 -1
  119. package/src/themes/five/src/components/CartPopover/styles.js +3 -3
  120. package/src/themes/five/src/components/Footer/index.js +15 -6
  121. package/src/themes/five/src/components/Footer/styles.js +15 -14
  122. package/src/themes/five/src/components/Header/index.js +6 -4
  123. package/src/themes/five/src/components/Header/styles.js +14 -11
  124. package/src/themes/five/src/components/HeaderOption/index.js +13 -10
  125. package/src/themes/five/src/components/HeaderOption/styles.js +2 -2
  126. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +22 -10
  127. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +8 -0
  128. package/src/themes/five/src/components/HorizontalOrdersLayout/index.js +24 -36
  129. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +12 -1
  130. package/src/themes/five/src/components/InputPhoneNumber/index.js +1 -0
  131. package/src/themes/five/src/components/LoginForm/index.js +2 -1
  132. package/src/themes/five/src/components/MyOrders/index.js +20 -62
  133. package/src/themes/five/src/components/MyOrders/styles.js +1 -2
  134. package/src/themes/five/src/components/OrderDetails/index.js +9 -0
  135. package/src/themes/five/src/components/OrderDetails/styles.js +0 -55
  136. package/src/themes/five/src/components/OrderItAgain/styles.js +18 -0
  137. package/src/themes/five/src/components/OrdersOption/index.js +10 -16
  138. package/src/themes/five/src/components/OrdersOption/styles.js +1 -3
  139. package/src/themes/five/src/components/PageBanner/index.js +58 -0
  140. package/src/themes/five/src/components/PageBanner/styles.js +58 -0
  141. package/src/themes/five/src/components/Pagination/index.js +106 -0
  142. package/src/themes/five/src/components/Pagination/styles.js +106 -0
  143. package/src/themes/five/src/components/ProductForm/index.js +108 -84
  144. package/src/themes/five/src/components/ProductForm/styles.js +94 -12
  145. package/src/themes/five/src/components/Promotions/index.js +22 -16
  146. package/src/themes/five/src/components/Promotions/styles.js +10 -4
  147. package/src/themes/five/src/components/RenderProductsLayout/index.js +94 -66
  148. package/src/themes/five/src/components/RenderProductsLayout/styles.js +23 -22
  149. package/src/themes/five/src/components/SidebarMenu/styles.js +1 -1
  150. package/src/themes/five/src/components/SignUpForm/index.js +2 -1
  151. package/src/themes/five/src/components/SingleOrderCard/index.js +0 -21
  152. package/src/themes/five/src/components/SingleProductCard/index.js +7 -300
  153. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +312 -0
  154. package/src/themes/five/src/components/SingleProductCard/{styles.js → layouts/original/styles.js} +9 -6
  155. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +313 -0
  156. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/styles.js +353 -0
  157. package/src/themes/five/src/components/StripeElementsForm/index.js +1 -0
  158. package/src/themes/five/src/components/UserPopover/index.js +2 -0
  159. package/src/themes/five/src/components/UserPopover/styles.js +2 -2
  160. package/src/themes/five/src/components/UserProfileForm/styles.js +3 -11
  161. package/src/themes/six/src/components/BusinessController/index.js +163 -62
  162. package/src/themes/six/src/components/BusinessController/styles.js +53 -14
  163. package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -1
  164. package/src/themes/six/src/components/BusinessesMap/styles.js +1 -1
  165. package/src/themes/six/src/components/SearchBar/index.js +27 -8
  166. package/src/themes/six/src/components/SearchBar/styles.js +33 -2
  167. package/template/app.js +364 -364
  168. package/template/assets/images/chew_logo.png +0 -0
  169. package/template/components/HelmetTags/index.js +5 -4
  170. package/_bundles/2.ordering-ui.f9c3deec77a8e21645ed.js +0 -1
  171. package/_bundles/ordering-ui.f9c3deec77a8e21645ed.js +0 -2
@@ -171,15 +171,6 @@ export const SavedPlaces = styled.div`
171
171
  margin-top: 40px;
172
172
  margin-bottom: 20px;
173
173
 
174
-
175
- h1{
176
- font-size: 24px;
177
- text-align: left;
178
- ${props => props.theme?.rtl && css`
179
- text-align: right;
180
- `}
181
- }
182
-
183
174
  > div{
184
175
  display: flex;
185
176
  flex-direction: column-reverse;
@@ -192,10 +183,11 @@ export const SavedPlaces = styled.div`
192
183
  }
193
184
 
194
185
  @media (min-width: 768px){
195
- width: 90%;
186
+ width: 75%;
196
187
  margin-top: 40px;
197
188
  h1 {
198
- text-align: center;
189
+ font-size: 24px;
190
+ text-align: left;
199
191
  }
200
192
  ul{
201
193
  width: 100%;
@@ -1,5 +1,5 @@
1
- import React, { useState } from 'react'
2
- import { BusinessController as BusinessSingleCard, useLanguage, useUtils } from 'ordering-components-external'
1
+ import React, { useState, useRef } from 'react'
2
+ import { BusinessController as BusinessSingleCard, useLanguage, useSession, useUtils } from 'ordering-components-external'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { useTheme } from 'styled-components'
5
5
  import { Alert } from '../../../../../components/Confirm'
@@ -19,7 +19,9 @@ import {
19
19
  CallCenterInformation,
20
20
  CallCenterInformationBullet,
21
21
  NameWrapper,
22
- BusinessInfomation
22
+ BusinessInfomation,
23
+ Address,
24
+ SelectStoreContainer
23
25
  } from './styles'
24
26
  import GrClock from '@meronex/icons/gr/GrClock'
25
27
  import GrDeliver from '@meronex/icons/gr/GrDeliver'
@@ -27,6 +29,9 @@ import GrLocation from '@meronex/icons/gr/GrLocation'
27
29
  import GrStar from '@meronex/icons/gr/GrStar'
28
30
  import BiCar from '@meronex/icons/bi/BiCar'
29
31
  import BiBasket from '@meronex/icons/bi/BiBasket'
32
+ import { Heart as DisLike, HeartFill as Like } from 'react-bootstrap-icons'
33
+ import dayjs from 'dayjs'
34
+ import { Button } from '../../../../five'
30
35
  // import BusinessInformation from '../BusinessInformation'
31
36
 
32
37
  const BusinessControllerUI = (props) => {
@@ -38,12 +43,21 @@ const BusinessControllerUI = (props) => {
38
43
  orderType,
39
44
  isCustomLayout,
40
45
  isShowCallcenterInformation,
41
- handleShowBusinessInfo
46
+ handleShowBusinessInfo,
47
+ handleFavoriteBusiness
42
48
  } = props
43
49
  const theme = useTheme()
44
50
  const [, t] = useLanguage()
45
51
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils()
52
+ const [{ auth }] = useSession()
53
+ const favoriteRef = useRef(null)
46
54
  const [alertState, setAlertState] = useState({ open: false, content: [] })
55
+
56
+ const layout = theme?.business_listing_view?.components?.layout?.type || 'starbucks'
57
+ const hideCategories = theme?.business_listing_view?.components?.business?.components?.categories?.hidden
58
+ const hideAddress = theme?.business_listing_view?.components?.business?.components?.address?.hidden ?? true
59
+ const hideBusinessFavorite = theme?.business_listing_view?.components?.business?.components?.favorite?.hidden
60
+
47
61
  const types = ['food', 'alcohol', 'groceries', 'laundry']
48
62
  const businessType = () => {
49
63
  if (Object.keys(business).length <= 0) return t('GENERAL', 'General')
@@ -56,6 +70,36 @@ const BusinessControllerUI = (props) => {
56
70
  const handleShowAlert = () => {
57
71
  setAlertState({ open: true, content: [t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The Business is closed at the moment')] })
58
72
  }
73
+
74
+ const handleChangeFavorite = () => {
75
+ if (auth) {
76
+ handleFavoriteBusiness && handleFavoriteBusiness(!business?.favorite)
77
+ }
78
+ }
79
+
80
+ const scheduleFormatted = ({ hour, minute }) => {
81
+ const checkTime = (val) => val < 10 ? `0${val}` : val
82
+ return `${checkTime(hour)}:${checkTime(minute)}`
83
+ }
84
+
85
+ const getScheduleOpen = (business) => {
86
+ const currentDate = dayjs().tz(business?.timezone)
87
+ let lapse = null
88
+ if (business?.today?.enabled) {
89
+ lapse = business?.today?.lapses?.find(lapse => {
90
+ const from = currentDate.hour(lapse.open.hour).minute(lapse.open.minute)
91
+ const to = currentDate.hour(lapse.close.hour).minute(lapse.close.minute)
92
+ return currentDate.unix() >= from.unix() && currentDate.unix() <= to.unix()
93
+ })
94
+ }
95
+ return lapse ? `${scheduleFormatted(lapse.open)} - ${scheduleFormatted(lapse.close)}` : ''
96
+ }
97
+
98
+ const handleClickBusiness = (e, business) => {
99
+ if (favoriteRef?.current?.contains(e.target)) return
100
+ handleClick(business)
101
+ }
102
+
59
103
  return (
60
104
  <>
61
105
  {props.beforeElements?.map((BeforeElement, i) => (
@@ -65,7 +109,7 @@ const BusinessControllerUI = (props) => {
65
109
  {props.beforeComponents?.map((BeforeComponent, i) => (
66
110
  <BeforeComponent key={i} {...props} />))}
67
111
  <ContainerCard isSkeleton={isSkeleton}>
68
- <WrapperBusinessCard isSkeleton={isSkeleton} onClick={() => !isSkeleton && handleClick && (!business?.open && isCustomLayout ? handleShowAlert() : handleClick(business))}>
112
+ <WrapperBusinessCard isSkeleton={isSkeleton} onClick={(e) => !isSkeleton && handleClick && (!business?.open && isCustomLayout ? handleShowAlert() : handleClickBusiness(e, business))}>
69
113
  <BusinessContent>
70
114
  <WrapperBusinessLogo isSkeleton={isSkeleton}>
71
115
  {!isSkeleton && (business?.logo || theme.images?.dummies?.businessLogo) ? (
@@ -82,8 +126,38 @@ const BusinessControllerUI = (props) => {
82
126
  ) : (
83
127
  <Skeleton width={100} />
84
128
  )}
129
+ {layout === 'mapview' && (
130
+ <BusinessInfomation>
131
+ {business?.reviews?.total > 0 ? (
132
+ <div className='reviews'>
133
+ <GrStar />
134
+ <span>{business?.reviews?.total}</span>
135
+ </div>
136
+ ) : (
137
+ business?.reviews?.total !== 0 && <Skeleton width={50} />
138
+ )}
139
+ {!hideBusinessFavorite && (
140
+ <div className='favorite' ref={favoriteRef} onClick={handleChangeFavorite}>
141
+ {!isSkeleton ? (
142
+ <>
143
+ {(business?.favorite) ? <Like /> : <DisLike />}
144
+ </>
145
+ ) : (
146
+ <Skeleton width={16} height={16} />
147
+ )}
148
+ </div>
149
+ )}
150
+ {
151
+ (business && handleShowBusinessInfo) ? (
152
+ <BsExclamationCircle onClick={() => handleShowBusinessInfo(business)} />
153
+ ) : (
154
+ <Skeleton width={20} />
155
+ )
156
+ }
157
+ </BusinessInfomation>
158
+ )}
85
159
  </NameWrapper>
86
- {!isShowCallcenterInformation && (
160
+ {!isShowCallcenterInformation && !hideCategories && (
87
161
  <Categories>
88
162
  {
89
163
  Object.keys(business).length > 0 ? (
@@ -94,73 +168,100 @@ const BusinessControllerUI = (props) => {
94
168
  }
95
169
  </Categories>
96
170
  )}
97
- <Medadata isCustomerMode={isShowCallcenterInformation}>
98
- {Object.keys(business).length > 0 ? (
99
- <p className='bullet'>
100
- <GrClock />
101
- {convertHoursToMinutes(orderState?.options?.type === 1 ? business?.delivery_time : business?.pickup_time) || <Skeleton width={100} />}
102
- </p>
103
- ) : (
104
- <Skeleton width={70} />
105
- )}
106
- {business?.distance >= 0 ? (
107
- <p className='bullet'>
108
- <GrLocation />
109
- {parseDistance(business?.distance)}
110
- </p>
111
- ) : (
112
- <Skeleton width={70} />
113
- )}
114
- {orderType === 1 && (
171
+ {!isShowCallcenterInformation && !hideAddress && (
172
+ <Address>
173
+ {
174
+ Object.keys(business).length > 0 ? (
175
+ business?.address
176
+ ) : (
177
+ <Skeleton width={100} />
178
+ )
179
+ }
180
+ </Address>
181
+ )}
182
+ {layout !== 'mapview' && (
183
+ <Medadata isCustomerMode={isShowCallcenterInformation}>
184
+ {Object.keys(business).length > 0 ? (
185
+ <p className='bullet'>
186
+ <GrClock />
187
+ {convertHoursToMinutes(orderState?.options?.type === 1 ? business?.delivery_time : business?.pickup_time) || <Skeleton width={100} />}
188
+ </p>
189
+ ) : (
190
+ <Skeleton width={70} />
191
+ )}
192
+ {business?.distance >= 0 ? (
193
+ <p className='bullet'>
194
+ <GrLocation />
195
+ {parseDistance(business?.distance)}
196
+ </p>
197
+ ) : (
198
+ <Skeleton width={70} />
199
+ )}
200
+ {orderType === 1 && (
201
+ <>
202
+ {business?.delivery_price >= 0 ? (
203
+ <p>
204
+ <GrDeliver />
205
+ {business && parsePrice(business?.delivery_price)}
206
+ </p>
207
+ ) : (
208
+ <Skeleton width={70} />
209
+ )}
210
+ </>
211
+ )}
212
+ {isShowCallcenterInformation && (
213
+ <CallCenterInformation>
214
+ <CallCenterInformationBullet bgcolor='green'>
215
+ <BiCar />
216
+ {business?.available_drivers?.length}
217
+ </CallCenterInformationBullet>
218
+ <CallCenterInformationBullet bgcolor='red'>
219
+ <BiCar />
220
+ {business?.busy_drivers?.length}
221
+ </CallCenterInformationBullet>
222
+ <CallCenterInformationBullet bgcolor='rgb(252,225,5)'>
223
+ <BiBasket />
224
+ {business?.active_orders?.length}
225
+ </CallCenterInformationBullet>
226
+ </CallCenterInformation>
227
+ )}
115
228
  <>
116
- {business?.delivery_price >= 0 ? (
117
- <p>
118
- <GrDeliver />
119
- {business && parsePrice(business?.delivery_price)}
120
- </p>
229
+ {business?.reviews?.total > 0 ? (
230
+ <div className='reviews'>
231
+ <GrStar />
232
+ <span>{business?.reviews?.total}</span>
233
+ </div>
121
234
  ) : (
122
- <Skeleton width={70} />
235
+ business?.reviews?.total !== 0 && <Skeleton width={50} />
123
236
  )}
124
237
  </>
125
- )}
126
- {isShowCallcenterInformation && (
127
- <CallCenterInformation>
128
- <CallCenterInformationBullet bgcolor='green'>
129
- <BiCar />
130
- {business?.available_drivers?.length}
131
- </CallCenterInformationBullet>
132
- <CallCenterInformationBullet bgcolor='red'>
133
- <BiCar />
134
- {business?.busy_drivers?.length}
135
- </CallCenterInformationBullet>
136
- <CallCenterInformationBullet bgcolor='rgb(252,225,5)'>
137
- <BiBasket />
138
- {business?.active_orders?.length}
139
- </CallCenterInformationBullet>
140
- </CallCenterInformation>
141
- )}
142
- {business?.reviews?.total > 0 ? (
143
- <div className='reviews'>
144
- <GrStar />
145
- <span>{business?.reviews?.total}</span>
146
- </div>
238
+ </Medadata>
239
+ )}
240
+ <Medadata>
241
+ {!isSkeleton > 0 ? (
242
+ <>
243
+ <div className='schedule'>
244
+ {`${t('SCHEDULE', 'Schedule')}: ${getScheduleOpen(business)}`}
245
+ </div>
246
+ <SelectStoreContainer>
247
+ <Button
248
+ outline
249
+ >
250
+ {t('SELECT_BUSINESS', 'Select business')}
251
+ </Button>
252
+ </SelectStoreContainer>
253
+ </>
147
254
  ) : (
148
- business?.reviews?.total !== 0 && <Skeleton width={50} />
255
+ <>
256
+ <Skeleton width={70} />
257
+ <Skeleton width={120} height={20} />
258
+ </>
149
259
  )}
150
260
  </Medadata>
151
261
  </BusinessInfoItem>
152
262
  </BusinessInfo>
153
263
  </BusinessContent>
154
264
  </WrapperBusinessCard>
155
- <BusinessInfomation>
156
- {
157
- (business && handleShowBusinessInfo) ? (
158
- <BsExclamationCircle onClick={() => handleShowBusinessInfo(business)} />
159
- ) : (
160
- <Skeleton width={20} />
161
- )
162
- }
163
- </BusinessInfomation>
164
265
  </ContainerCard>
165
266
  <Alert
166
267
  title={t('BUSINESS_CLOSED', 'Business Closed')}
@@ -2,10 +2,8 @@ import React from 'react'
2
2
  import styled, { css } from 'styled-components'
3
3
 
4
4
  export const ContainerCard = styled.div`
5
- margin: 12px 24px;
6
5
  width: 100%;
7
6
  position: relative;
8
-
9
7
  `
10
8
 
11
9
  export const WrapperBusinessCard = styled.div`
@@ -65,7 +63,10 @@ export const BusinessTags = styled.div`
65
63
  top: 0;
66
64
  margin: 15px;
67
65
  width: calc(100% - 35px);
68
-
66
+
67
+ ${({ theme }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
68
+ width: 100%;
69
+ `}
69
70
  span.crown {
70
71
  background-color: rgba(0, 0, 0, 0.5);
71
72
  font-size: 20px;
@@ -97,14 +98,14 @@ export const BusinessTags = styled.div`
97
98
  ` : css`
98
99
  margin-right: 0px;
99
100
  `
100
- }
101
+ }
101
102
  }
102
103
  }
103
104
  `
104
105
 
105
106
  export const BusinessContent = styled.div`
106
107
  display: flex;
107
- margin-top: 15px;
108
+ margin: 12px 24px;
108
109
  max-height: 115px;
109
110
  `
110
111
 
@@ -113,8 +114,8 @@ export const WrapperBusinessLogo = styled.div`
113
114
  width: 65px;
114
115
  height: 65px;
115
116
  min-height: 65px;
116
- max-width: 65px;
117
-
117
+ min-width: 65px;
118
+ min-height: 65px;
118
119
  ${({ isSkeleton }) => isSkeleton && css`
119
120
  width: auto;
120
121
  height: auto;
@@ -125,6 +126,8 @@ export const WrapperBusinessLogo = styled.div`
125
126
  max-height: 75px;
126
127
  height: 75px;
127
128
  width: 75px;
129
+ min-width: 75px;
130
+ min-height: 75px;
128
131
  }
129
132
  `
130
133
 
@@ -167,6 +170,8 @@ export const BusinessInfo = styled.div`
167
170
 
168
171
  @media (min-width: 481px){
169
172
  width: calc(100% - 75px);
173
+ ${({ theme }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
174
+ `}
170
175
  }
171
176
  `
172
177
 
@@ -197,6 +202,9 @@ export const BusinessInfoItem = styled.div`
197
202
  div {
198
203
  display: flex;
199
204
  justify-content: space-between;
205
+ ${({ theme }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
206
+ align-items: center;
207
+ `}
200
208
  p {
201
209
  text-transform: capitalize;
202
210
  display: flex;
@@ -223,6 +231,10 @@ export const BusinessInfoItem = styled.div`
223
231
  }
224
232
 
225
233
  @media (min-width: 481px){
234
+ ${({ theme }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
235
+ min-width: 100%;
236
+ width: 100%;
237
+ `}
226
238
  padding: 0px 5px 0px 16px;
227
239
  font-size: 16px;
228
240
 
@@ -256,6 +268,10 @@ export const Medadata = styled.div`
256
268
  display: flex;
257
269
  font-weight: 300;
258
270
  font-size: 12px;
271
+ .schedule{
272
+ font-size: 12px;
273
+ color: #ADB5BD;
274
+ }
259
275
  ${({ isCustomerMode }) => isCustomerMode && css`
260
276
  > div {
261
277
  flex-direction: column;
@@ -302,18 +318,20 @@ export const NameWrapper = styled.div`
302
318
  justify-content: space-between;
303
319
  `
304
320
  export const BusinessInfomation = styled.div`
305
- position: absolute;
306
- top: 10px;
307
- right: 0;
308
- width: 30px;
309
- height: 30px;
310
321
  display: flex;
311
322
  justify-content: center;
312
323
  align-items: center;
313
324
  cursor: pointer;
314
325
  z-index: 2;
315
-
316
-
326
+ .reviews {
327
+ margin-right: 10px;
328
+ }
329
+ .favorite {
330
+ margin-right: 10px;
331
+ svg {
332
+ color: #E63757
333
+ }
334
+ }
317
335
  ${props => props.theme?.rtl && css`
318
336
  right: unset;
319
337
  left: 0;
@@ -327,3 +345,24 @@ export const BusinessInfomation = styled.div`
327
345
  font-size: 21px;
328
346
  }
329
347
  `
348
+
349
+ export const Address = styled.p`
350
+ width: 70%;
351
+ white-space: nowrap;
352
+ overflow: hidden;
353
+ text-overflow: ellipsis;
354
+ margin: 0;
355
+ font-size: 14px;
356
+ `
357
+
358
+ export const SelectStoreContainer = styled.div`
359
+ button{
360
+ background: transparent;
361
+ color: ${({ theme }) => theme?.colors?.primary};
362
+ border-color: ${({ theme }) => theme?.colors?.primary};
363
+ height: 27px;
364
+ line-height: 0;
365
+ font-size: 14px;
366
+ white-space: nowrap;
367
+ }
368
+ `
@@ -19,6 +19,7 @@ export const SearchProducts = (props) => {
19
19
  const [, t] = useLanguage()
20
20
  const [orderingTheme] = useOrderingTheme()
21
21
  const showSort = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
22
+ const searchLayout = theme?.business_view?.components?.product_search?.components?.layout?.type
22
23
 
23
24
  return (
24
25
  <>
@@ -27,8 +28,9 @@ export const SearchProducts = (props) => {
27
28
  search={searchValue}
28
29
  placeholder={t('SEARCH_PRODUCTS', theme?.defaultLanguages?.SEARCH_PRODUCTS || 'Search Products')}
29
30
  lazyLoad={businessState?.business?.lazy_load_products_recommended}
31
+ disablePadding={props.disablePadding}
30
32
  />
31
- {showSort && (
33
+ {showSort && searchLayout !== 'floating' && (
32
34
  <Select
33
35
  notAsync
34
36
  notReload
@@ -5,7 +5,7 @@ export const WrapperMap = styled.div`
5
5
  display: flex;
6
6
  justify-content: center;
7
7
  box-sizing: border-box;
8
- min-height: 30vh;
8
+ min-height: 70vh;
9
9
  height:100%;
10
10
 
11
11
  > div {
@@ -1,10 +1,11 @@
1
1
  import React, { useRef, useEffect } from 'react'
2
2
  import { Input } from '../../styles/Inputs'
3
- import { useTheme } from '../../../../../contexts/ThemeContext'
4
3
  import { useLanguage } from 'ordering-components-external'
4
+ import AiOutlineSearch from '@meronex/icons/ai/AiOutlineSearch'
5
5
  import {
6
6
  BusinessSearch,
7
- DeleteContent
7
+ DeleteContent,
8
+ SearchWrapper
8
9
  } from './styles'
9
10
  export const SearchBar = (props) => {
10
11
  const {
@@ -14,7 +15,7 @@ export const SearchBar = (props) => {
14
15
  lazyLoad,
15
16
  isCustomLayout
16
17
  } = props
17
- const [theme] = useTheme()
18
+
18
19
  const [, t] = useLanguage()
19
20
  let timeout = null
20
21
  let previousSearch
@@ -24,10 +25,16 @@ export const SearchBar = (props) => {
24
25
  if (previousSearch !== e.target.value) {
25
26
  if (!lazyLoad) {
26
27
  onSearch(e.target.value)
28
+ if (el.current) {
29
+ el.current.value = e.target.value
30
+ }
27
31
  } else {
28
32
  clearTimeout(timeout)
29
33
  timeout = setTimeout(function () {
30
34
  onSearch(e.target.value)
35
+ if (el.current) {
36
+ el.current.value = e.target.value
37
+ }
31
38
  }, 750)
32
39
  }
33
40
  }
@@ -39,11 +46,13 @@ export const SearchBar = (props) => {
39
46
  useEffect(() => {
40
47
  el.current.onkeyup = onChangeSearch
41
48
  }, [])
49
+
42
50
  useEffect(() => {
43
51
  if (!search) {
44
52
  el.current.value = ''
45
53
  }
46
54
  }, [search])
55
+
47
56
  return (
48
57
  <>
49
58
  {props.beforeElements?.map((BeforeElement, i) => (
@@ -56,21 +65,31 @@ export const SearchBar = (props) => {
56
65
  className={!isCustomLayout && 'search-bar'}
57
66
  isCustomLayout={isCustomLayout}
58
67
  hasValue={el.current?.value}
68
+ disablePadding={props.disablePadding}
59
69
  >
60
70
  <Input
61
71
  ref={el}
62
72
  name='search'
63
73
  aria-label='search'
74
+ id='select-input'
64
75
  placeholder={placeholder}
65
76
  isCustomLayout={isCustomLayout}
66
77
  autoComplete='off'
67
78
  maxLength='500'
68
79
  />
69
- <DeleteContent>
70
- {el.current?.value
71
- ? <span onClick={handleClear}>{t('CLEAR', 'Clear')}</span>
72
- : <img src={theme?.images?.general?.searchIcon} />}
73
- </DeleteContent>
80
+ {el.current?.value && (
81
+ <DeleteContent
82
+ isHome={props.isHome}
83
+ isClear
84
+ >
85
+ <span onClick={handleClear}>{t('CLEAR', 'Clear')}</span>
86
+ </DeleteContent>
87
+ )}
88
+ <SearchWrapper
89
+ isHome={props.isHome}
90
+ >
91
+ <AiOutlineSearch />
92
+ </SearchWrapper>
74
93
  </BusinessSearch>
75
94
  {props.afterComponents?.map((AfterComponent, i) => (
76
95
  <AfterComponent key={i} {...props} />))}
@@ -22,7 +22,16 @@ export const BusinessSearch = styled.div`
22
22
  padding-right: 60px;
23
23
  `}
24
24
 
25
- ${({ isCustomLayout }) => !isCustomLayout && css`
25
+ ${({ theme, disablePadding }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
26
+ border-bottom: none;
27
+ ${props => props.theme?.rtl ? css`
28
+ padding-right: 70px;
29
+ ` : css`
30
+ padding-left: 70px;
31
+ `}
32
+ `}
33
+
34
+ ${({ isCustomLayout, theme }) => !isCustomLayout && theme?.business_view?.components?.product_search?.components?.layout?.type !== 'floating' && css`
26
35
  justify-content: center;
27
36
  -webkit-transition: width 0.4s ease-in-out;
28
37
  transition: width 0.4s ease-in-out;
@@ -30,12 +39,17 @@ export const BusinessSearch = styled.div`
30
39
 
31
40
  @media (min-width: 681px) {
32
41
  width: 100%;
33
- ${({ isCustomLayout }) => !isCustomLayout && css`
42
+ ${({ isCustomLayout, theme }) => !isCustomLayout && theme?.business_view?.components?.product_search?.components?.layout?.type !== 'floating' && css`
34
43
  width: 200px;
35
44
  &:focus {
36
45
  width: 50%;
37
46
  }
38
47
  `}
48
+ ${({ theme, disablePadding }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
49
+ ${disablePadding && css`
50
+ padding-left: 0;
51
+ `}
52
+ `}
39
53
  }
40
54
  }
41
55
  `
@@ -49,12 +63,26 @@ export const DeleteContent = styled.span`
49
63
  transform: translate(-30%, 0%);
50
64
  border-radius: 25%;
51
65
  max-height: 100%;
66
+ ${({ theme, isHome }) => theme?.business_listing_view?.components?.layout?.type === 'mapview' && css`
67
+ left: ${isHome ? '40px' : '30px'};
68
+ `}
69
+ ${({ isClear, isHome }) => isClear && css`
70
+ left: initial;
71
+ right: 20px;
72
+ `}
52
73
  ${props => props.theme?.rtl && css`
53
74
  transform: translate(30%, 0%);
54
75
  `}
55
76
  span{
56
77
  cursor: pointer;
57
78
  }
79
+ svg {
80
+ color: #ADB5BD;
81
+ width: 24px;
82
+ height: 24px;
83
+ position: relative;
84
+ bottom: 4px;
85
+ }
58
86
  img{
59
87
  width: 20px;
60
88
  transform: translate(-25%, 0%);
@@ -63,6 +91,9 @@ export const DeleteContent = styled.span`
63
91
  `}
64
92
  }
65
93
  `
94
+
95
+ export const SearchWrapper = styled(DeleteContent)``
96
+
66
97
  export const SearchIcon = styled.div`
67
98
  background-image: url(${props => props.theme?.images?.general?.searchIcon});
68
99
  background-position: right 10px center;