ordering-ui-external 10.4.0 → 10.5.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 (80) hide show
  1. package/_bundles/{0.ordering-ui.487a31b3537d90f69a9d.js → 0.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  2. package/_bundles/{1.ordering-ui.487a31b3537d90f69a9d.js → 1.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  3. package/_bundles/{2.ordering-ui.487a31b3537d90f69a9d.js → 2.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  4. package/_bundles/{4.ordering-ui.487a31b3537d90f69a9d.js → 4.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  5. package/_bundles/{5.ordering-ui.487a31b3537d90f69a9d.js → 5.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  6. package/_bundles/{6.ordering-ui.487a31b3537d90f69a9d.js → 6.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  7. package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js → 7.ordering-ui.cc1d13aa04732fde3671.js} +2 -2
  8. package/_bundles/{8.ordering-ui.487a31b3537d90f69a9d.js → 8.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  9. package/_bundles/{9.ordering-ui.487a31b3537d90f69a9d.js → 9.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  10. package/_bundles/ordering-ui.cc1d13aa04732fde3671.js +2 -0
  11. package/_modules/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +4 -2
  12. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +3 -1
  13. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
  14. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -2
  15. package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +25 -19
  16. package/_modules/themes/five/src/components/BusinessProductsList/index.js +35 -13
  17. package/_modules/themes/five/src/components/BusinessProductsList/styles.js +7 -3
  18. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  19. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +133 -31
  20. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +37 -3
  21. package/_modules/themes/five/src/components/Cart/index.js +10 -6
  22. package/_modules/themes/five/src/components/Checkout/index.js +67 -22
  23. package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +53 -0
  24. package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +16 -0
  25. package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +69 -0
  26. package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +16 -0
  27. package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/index.js +90 -0
  28. package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +43 -0
  29. package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +75 -0
  30. package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +19 -0
  31. package/_modules/themes/five/src/components/MyOrders/index.js +6 -1
  32. package/_modules/themes/five/src/components/OrderProgress/index.js +1 -1
  33. package/_modules/themes/five/src/components/OrdersOption/index.js +1 -0
  34. package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +165 -31
  35. package/_modules/themes/five/src/components/PhoneAutocomplete/styles.js +53 -9
  36. package/_modules/themes/five/src/components/ProductForm/index.js +1 -0
  37. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
  38. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  39. package/_modules/themes/five/src/components/UserFormDetails/index.js +5 -17
  40. package/_modules/themes/five/src/components/UserFormDetails/styles.js +3 -7
  41. package/index-template.js +9 -1
  42. package/package.json +2 -2
  43. package/src/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +3 -1
  44. package/src/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +5 -1
  45. package/src/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
  46. package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -2
  47. package/src/themes/five/src/components/BusinessItemAccordion/styles.js +8 -7
  48. package/src/themes/five/src/components/BusinessProductsList/index.js +36 -3
  49. package/src/themes/five/src/components/BusinessProductsList/styles.js +20 -0
  50. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  51. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +156 -36
  52. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +66 -0
  53. package/src/themes/five/src/components/Cart/index.js +7 -4
  54. package/src/themes/five/src/components/Checkout/index.js +61 -35
  55. package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +50 -0
  56. package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +34 -0
  57. package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +75 -0
  58. package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +29 -0
  59. package/src/themes/five/src/components/GiftCard/SingleGiftCard/index.js +79 -0
  60. package/src/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +79 -0
  61. package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +72 -0
  62. package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +31 -0
  63. package/src/themes/five/src/components/MyOrders/index.js +6 -1
  64. package/src/themes/five/src/components/OrderProgress/index.js +1 -1
  65. package/src/themes/five/src/components/OrdersOption/index.js +1 -0
  66. package/src/themes/five/src/components/PhoneAutocomplete/index.js +195 -46
  67. package/src/themes/five/src/components/PhoneAutocomplete/styles.js +106 -10
  68. package/src/themes/five/src/components/ProductForm/index.js +1 -0
  69. package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -0
  70. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  71. package/src/themes/five/src/components/UserFormDetails/index.js +6 -27
  72. package/src/themes/five/src/components/UserFormDetails/styles.js +0 -16
  73. package/template/assets/images/delivery.svg +11 -0
  74. package/template/assets/images/phone-hero-callcenter.png +0 -0
  75. package/template/assets/images/phone.svg +11 -0
  76. package/template/assets/images/pickup.svg +17 -0
  77. package/template/pages/BusinessProductsList/index.js +2 -1
  78. package/_bundles/ordering-ui.487a31b3537d90f69a9d.js +0 -2
  79. /package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → 7.ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
  80. /package/_bundles/{ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
@@ -0,0 +1,72 @@
1
+ import React, { useEffect } from 'react'
2
+ import { useLanguage, GiftCardOrdersList as GiftCardOrdersListController } from 'ordering-components-external'
3
+ import Skeleton from 'react-loading-skeleton'
4
+ import { SingleGiftCard } from '../SingleGiftCard'
5
+ import { Button } from '../../../styles/Buttons'
6
+
7
+ import {
8
+ ProductsListContainer,
9
+ WrappButton,
10
+ SingleGiftCardWrapper
11
+ } from './styles'
12
+
13
+ const VerticalGiftCardOrdersLayoutUI = (props) => {
14
+ const {
15
+ giftCards,
16
+ paginationProps,
17
+ loadMoreOrders,
18
+ title,
19
+ setIsEmpty
20
+ } = props
21
+
22
+ const [, t] = useLanguage()
23
+
24
+ useEffect(() => {
25
+ if (giftCards.loading) return
26
+ if (giftCards.list?.length === 0) setIsEmpty(true)
27
+ }, [giftCards])
28
+
29
+ return (
30
+ <ProductsListContainer>
31
+ {giftCards.loading
32
+ ? <Skeleton width={100} height={24} />
33
+ : giftCards.list?.length > 0 && <h2>{title}</h2>}
34
+ {giftCards.list.map(card => (
35
+ <SingleGiftCardWrapper key={card.id}>
36
+ <SingleGiftCard
37
+ card={card}
38
+ />
39
+ </SingleGiftCardWrapper>
40
+ ))}
41
+ {giftCards.loading && (
42
+ [...Array(10).keys()].map(i => (
43
+ <SingleGiftCardWrapper key={i}>
44
+ <SingleGiftCard
45
+ isSkeleton
46
+ />
47
+ </SingleGiftCardWrapper>
48
+ ))
49
+ )}
50
+ {paginationProps.totalPages && paginationProps.currentPage < paginationProps.totalPages && (
51
+ <WrappButton>
52
+ <Button
53
+ outline
54
+ color='primary'
55
+ bgtransparent
56
+ onClick={loadMoreOrders}
57
+ >
58
+ {t('LOAD_MORE_ORDERS', 'Load more orders')}
59
+ </Button>
60
+ </WrappButton>
61
+ )}
62
+ </ProductsListContainer>
63
+ )
64
+ }
65
+
66
+ export const VerticalGiftCardOrdersLayout = (props) => {
67
+ const giftCardsProps = {
68
+ ...props,
69
+ UIComponent: VerticalGiftCardOrdersLayoutUI
70
+ }
71
+ return <GiftCardOrdersListController {...giftCardsProps} />
72
+ }
@@ -0,0 +1,31 @@
1
+ import styled from 'styled-components'
2
+ import { darken } from 'polished'
3
+
4
+ export const ProductsListContainer = styled.div`
5
+ margin-top: 10px;
6
+ `
7
+ export const SingleGiftCardWrapper = styled.div`
8
+ border-bottom: 1px solid #E9ECEF;
9
+ padding: 20px 0;
10
+ `
11
+ export const WrappButton = styled.div`
12
+ width: 80%;
13
+ display: flex;
14
+ justify-content: center;
15
+ margin: 20px auto;
16
+
17
+ button {
18
+ padding: 10px 0px;
19
+ width: 100%;
20
+ }
21
+
22
+ button:hover{
23
+ color: ${props => darken(0.07, props.theme.colors.primary)};
24
+ }
25
+
26
+ @media (min-width: 768px) {
27
+ button {
28
+ width: 60%;
29
+ }
30
+ }
31
+ `
@@ -2,6 +2,7 @@ import React, { useState } from 'react'
2
2
  import { useLanguage } from 'ordering-components-external'
3
3
  import { ProfileOptions } from '../../../../../components/UserProfileForm/ProfileOptions'
4
4
  import { OrdersOption } from '../OrdersOption'
5
+ import { GiftCardOrdersList } from '../GiftCard/GiftCardOrdersList'
5
6
  import { Button } from '../../styles/Buttons'
6
7
  import MdClose from '@meronex/icons/ios/MdClose'
7
8
  import { useHistory } from 'react-router-dom'
@@ -41,7 +42,8 @@ export const MyOrders = (props) => {
41
42
  const MyOrdersMenu = [
42
43
  { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false },
43
44
  { key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
44
- { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
45
+ { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab },
46
+ { key: 'giftCards', value: t('GIFT_CARD', 'Gift card'), disabled: false }
45
47
  ]
46
48
 
47
49
  const notOrderOptions = ['business', 'products', 'professionals']
@@ -144,6 +146,9 @@ export const MyOrders = (props) => {
144
146
  onProductRedirect={onProductRedirect}
145
147
  />
146
148
  )}
149
+ {selectedOption === 'giftCards' && (
150
+ <GiftCardOrdersList />
151
+ )}
147
152
  </Container>
148
153
  {props.afterComponents?.map((AfterComponent, i) => (
149
154
  <AfterComponent key={i} {...props} />))}
@@ -133,7 +133,7 @@ const OrderProgressUI = (props) => {
133
133
 
134
134
  export const OrderProgress = (props) => {
135
135
  const propsToFetchBusiness = ['name', 'logo', 'slug', 'id']
136
- const propsToFetch = ['cart', 'business', 'status', 'id', 'uuid', 'cart_group_id', 'business_id', 'delivery_datetime', 'delivery_datetime_utc', 'total', 'summary']
136
+ const propsToFetch = ['cart', 'business', 'status', 'id', 'uuid', 'cart_group_id', 'business_id', 'delivery_datetime', 'delivery_datetime_utc', 'total', 'summary', 'eta_current_status_time', 'eta_previous_status_times', 'eta_time', 'delivered_in', 'prepared_in', 'eta_drive_time']
137
137
  const orderProgressProps = {
138
138
  ...props,
139
139
  UIComponent: OrderProgressUI,
@@ -365,6 +365,7 @@ export const OrdersOption = (props) => {
365
365
  const orderListProps = {
366
366
  ...props,
367
367
  UIComponent: OrdersOptionUI,
368
+ noGiftCardOrders: true,
368
369
  orderStatus: getAllOrders
369
370
  ? [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
370
371
  : props.activeOrders
@@ -4,7 +4,8 @@ import {
4
4
  PhoneAutocomplete as PhoneAutocompleteController,
5
5
  useLanguage,
6
6
  useOrder,
7
- useCustomer
7
+ useCustomer,
8
+ useConfig
8
9
  } from 'ordering-components-external'
9
10
  import { useTheme } from 'styled-components'
10
11
 
@@ -22,7 +23,14 @@ import {
22
23
  Slogan,
23
24
  UserEdit,
24
25
  WrappBtn,
25
- SelectContainer
26
+ SelectContainer,
27
+ TypesContainer,
28
+ TypeButton,
29
+ IconTypeButton,
30
+ AdditionalTypesContainer,
31
+ PhoneAutocompleteContainer,
32
+ ImageWrapper,
33
+ ContinueButton
26
34
  } from './styles'
27
35
 
28
36
  import MdcCellphoneAndroid from '@meronex/icons/mdc/MdcCellphoneAndroid'
@@ -39,19 +47,26 @@ const PhoneAutocompleteUI = (props) => {
39
47
  onChangeNumber,
40
48
  setCustomerState,
41
49
  countryCallingCode,
42
- onRedirectPage
50
+ onRedirectPage,
51
+ urlPhone,
52
+ orderTypes,
53
+ localPhoneCode
43
54
  } = props
44
- const [orderState] = useOrder()
55
+ const allOrderTypes = [1, 2, 3, 4, 5]
56
+ const pickupTypes = [2, 3, 4, 5]
57
+ const [orderState, { changeType }] = useOrder()
45
58
  const [, t] = useLanguage()
46
59
  const theme = useTheme()
47
60
  const [, { deleteUserCustomer }] = useCustomer()
61
+ const [configState] = useConfig()
48
62
  const [alertState, setAlertState] = useState({ open: false, content: [] })
49
- const [inputValue, setInputValue] = useState('')
63
+ const [inputValue, setInputValue] = useState(urlPhone ?? '')
50
64
  const [optSelected, setOptSelected] = useState(null)
51
65
  const [isOpenUserData, setIsOpenUserData] = useState(false)
52
66
  const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
67
+ const [isPickupSelected, setIsPickupSelected] = useState(pickupTypes.includes(orderState?.options?.type))
53
68
  const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
54
-
69
+ const configTypes = configState?.configs?.order_types_allowed?.value.split('|').filter(value => (allOrderTypes.includes(Number(value)))).map(value => Number(value)) || []
55
70
  const userName = userCustomer?.lastname
56
71
  ? `${userCustomer?.name} ${userCustomer?.lastname}`
57
72
  : userCustomer?.name
@@ -75,6 +90,15 @@ const PhoneAutocompleteUI = (props) => {
75
90
  }
76
91
  }
77
92
 
93
+ const handleChangeType = (value) => {
94
+ if (!orderState?.loading) {
95
+ changeType(value)
96
+ if (value === 1) {
97
+ setIsPickupSelected(false)
98
+ }
99
+ }
100
+ }
101
+
78
102
  useEffect(() => {
79
103
  if (customersPhones?.error) {
80
104
  setAlertState({ open: true, content: [customersPhones?.error] })
@@ -97,13 +121,16 @@ const PhoneAutocompleteUI = (props) => {
97
121
  }
98
122
 
99
123
  const onChange = (option) => {
100
- if (!option) { onChangeNumber('') }
101
124
  setOptSelected(option)
102
125
  setInputValue(option ? option?.value : '')
126
+ if (!option) { onChangeNumber(''); return }
103
127
  const user = customersPhones.users?.find(user => user.cellphone === option?.value || user.phone === option?.value)
104
128
  if (user) {
105
129
  setCustomerState({ ...customerState, result: user })
106
- setOpenModal({ ...openModal, customer: true })
130
+ setOpenModal({ signup: false, customer: true })
131
+ } else {
132
+ setCustomerState({ ...customerState, result: { error: false } })
133
+ setOpenModal({ customer: false, signup: true })
107
134
  }
108
135
  }
109
136
 
@@ -119,11 +146,17 @@ const PhoneAutocompleteUI = (props) => {
119
146
  }
120
147
 
121
148
  const handleCloseAddressList = () => {
122
- setOpenModal({ openModal, customer: false })
149
+ setOpenModal({ ...openModal, customer: false })
123
150
  setCustomerState({ ...customerState, result: { error: false } })
124
151
  deleteUserCustomer(true)
125
152
  }
126
153
 
154
+ const handleChangeToPickup = () => {
155
+ const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
156
+ handleChangeType(firstEnabledPickupType)
157
+ setIsPickupSelected(true)
158
+ }
159
+
127
160
  const optionsToSelect = customersPhones.users.map(user => {
128
161
  const obj = {}
129
162
  obj.value = user.cellphone || user.phone
@@ -131,53 +164,140 @@ const PhoneAutocompleteUI = (props) => {
131
164
  return obj
132
165
  }) || []
133
166
 
167
+ useEffect(() => {
168
+ if (!urlPhone) return
169
+ onInputChange(urlPhone, { action: 'url' })
170
+ onChange({ value: urlPhone, label: urlPhone })
171
+ }, [urlPhone, customersPhones?.users?.length])
172
+
173
+ useEffect(() => {
174
+ if (pickupTypes.includes(orderState?.options?.type)) {
175
+ setIsPickupSelected(true)
176
+ }
177
+ }, [orderState?.options?.type])
178
+
179
+ const OrderTypesComponent = () => {
180
+ return (
181
+ <>
182
+ {orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && type.value !== 1) : orderTypes).map((item, i) => (
183
+ <Button
184
+ key={item.value}
185
+ onClick={() => handleChangeType(item.value)}
186
+ color={orderState?.options?.type === item?.value ? 'primary' : 'secondary'}
187
+ disabled={orderState?.loading}
188
+ className={orderState?.options?.type !== item?.value ? 'activated' : ''}
189
+ >
190
+ {item.text}
191
+ </Button>
192
+ ))}
193
+ </>
194
+ )
195
+ }
196
+
134
197
  return (
135
198
  <>
136
- <PhoneContainer bgimage={theme.images?.general?.homeHero}>
199
+ <PhoneContainer>
137
200
  <ContentWrapper>
138
201
  <Title>{t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')}</Title>
139
- <Slogan>{t('SUBTITLE_HOME_CALLCENTER', 'Start First by adding the customers\' phone number')}</Slogan>
140
- {!userCustomer && (
141
- <SelectContainer>
142
- <MdcCellphoneAndroid size={26} />
143
- <Select
144
- isSearchable
145
- isClearable
146
- className='basic-single'
147
- classNamePrefix='select'
148
- placeholder={t('PHONE_NUMBER', 'Phone number')}
149
- value={optSelected}
150
- noOptionsMessage={() => inputValue?.length > 6 ? t('NO_OPTIONS', 'No options') : t('TYPE_AT_LEAST_NUMBER_SUGGEST', 'Type at least 7 numbers for suggesstions')}
151
- inputValue={!optSelected ? inputValue : ''}
152
- onChange={onChange}
153
- onInputChange={onInputChange}
154
- isLoading={customersPhones?.loading}
155
- options={optionsToSelect}
156
- />
157
- </SelectContainer>
202
+ <Slogan>{t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')}</Slogan>
203
+ {!(userCustomer && orderState?.options?.address?.address) && (
204
+ <TypesContainer>
205
+ {configTypes.includes(1) && (
206
+ <TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={!isPickupSelected}>
207
+ <IconTypeButton activated={!isPickupSelected}>
208
+ <img
209
+ src={theme?.images?.general?.deliveryIco}
210
+ width={20}
211
+ height={20}
212
+ />
213
+ </IconTypeButton>
214
+ <p>{t('DELIVERY', 'Delivery')}</p>
215
+ </TypeButton>
216
+ )}
217
+ {configTypes.some(type => pickupTypes.includes(type)) && (
218
+ <TypeButton
219
+ disabled={orderState?.loading}
220
+ activated={isPickupSelected}
221
+ onClick={() => handleChangeToPickup()}
222
+ >
223
+ <IconTypeButton activated={isPickupSelected}>
224
+ <img
225
+ src={theme?.images?.general?.pickupIco}
226
+ width={22}
227
+ height={22}
228
+ />
229
+ </IconTypeButton>
230
+ <p>{t('PICKUP', 'Pickup')}</p>
231
+ </TypeButton>
232
+ )}
233
+ </TypesContainer>
234
+ )}
235
+ {isPickupSelected && (
236
+ <>
237
+ <p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
238
+ <AdditionalTypesContainer>
239
+ <OrderTypesComponent />
240
+ </AdditionalTypesContainer>
241
+ </>
242
+ )}
243
+ {configTypes.includes(orderState?.options?.type) && (
244
+ <>
245
+ {!userCustomer && (
246
+ <PhoneAutocompleteContainer>
247
+ <h2>
248
+ {t('ADDING_CUSTOMERS_PHONE_NUMBER', 'Adding the customers’ phone number')}
249
+ </h2>
250
+ <WrappBtn>
251
+ <Button
252
+ color={(inputValue || (userCustomer && orderState?.options?.address?.address)) ? 'primary' : 'secundary'}
253
+ onMouseDown={() => !(userCustomer && orderState?.options?.address?.address) ? createNewUser() : handleFindClick()}
254
+ disabled={(!inputValue && !(userCustomer && orderState?.options?.address?.address))}
255
+ >
256
+ {
257
+ !(userCustomer && orderState?.options?.address?.address)
258
+ ? t('CREATE_CUSTOMER', 'Create new customer')
259
+ : `${t('CONTINUE_WITH', 'Continue with')} ${userName}`
260
+ }
261
+ </Button>
262
+ </WrappBtn>
263
+ <SelectContainer>
264
+ <MdcCellphoneAndroid size={18} color={theme?.colors?.primary} />
265
+ <Select
266
+ isSearchable
267
+ isClearable
268
+ className='basic-single'
269
+ classNamePrefix='select'
270
+ placeholder={t('PHONE_NUMBER', 'Phone number')}
271
+ value={optSelected}
272
+ noOptionsMessage={() => inputValue?.length > 6 ? t('NO_OPTIONS', 'No options') : t('TYPE_AT_LEAST_NUMBER_SUGGEST', 'Type at least 7 numbers for suggesstions')}
273
+ inputValue={!optSelected ? inputValue : ''}
274
+ onChange={onChange}
275
+ onInputChange={onInputChange}
276
+ isLoading={customersPhones?.loading}
277
+ options={optionsToSelect}
278
+ />
279
+ {optSelected && (
280
+ <ContinueButton>
281
+ <Button onClick={() => onChange(optSelected)} color='primary'>
282
+ {t('CONTINUE', 'Continue')}
283
+ </Button>
284
+ </ContinueButton>
285
+ )}
286
+ </SelectContainer>
287
+ </PhoneAutocompleteContainer>
288
+ )}
289
+ </>
158
290
  )}
159
- <WrappBtn>
160
- <Button
161
- color={inputValue || (userCustomer && orderState?.options?.address?.address) ? 'primary' : 'secundary'}
162
- onMouseDown={() => !(userCustomer && orderState?.options?.address?.address) ? createNewUser() : handleFindClick()}
163
- disabled={!inputValue && !(userCustomer && orderState?.options?.address?.address)}
164
- >
165
- {
166
- !(userCustomer && orderState?.options?.address?.address)
167
- ? t('CREATE_CUSTOMER', 'Create new customer')
168
- : `${t('CONTINUE_WITH', 'Continue with')} ${userName}`
169
- }
170
- </Button>
171
- </WrappBtn>
172
291
  </ContentWrapper>
292
+ <ImageWrapper bgimage={theme?.images?.general?.phoneHero} />
173
293
  </PhoneContainer>
174
294
  <Modal
175
295
  open={openModal.signup}
176
296
  width='80%'
177
- onClose={() => setOpenModal({ openModal, signup: false })}
297
+ onClose={() => setOpenModal({ ...openModal, signup: false })}
178
298
  >
179
299
  <SignUpForm
180
- externalPhoneNumber={`${countryCallingCode} ${optSelected?.value || phone}`}
300
+ externalPhoneNumber={`${localPhoneCode || countryCallingCode} ${optSelected?.value || phone}`}
181
301
  saveCustomerUser={saveCustomerUser}
182
302
  fieldsNotValid={props.fieldsNotValid}
183
303
  useChekoutFileds
@@ -210,7 +330,8 @@ const PhoneAutocompleteUI = (props) => {
210
330
  changeOrderAddressWithDefault
211
331
  userCustomerSetup={{
212
332
  ...customerState?.result,
213
- phone
333
+ phone,
334
+ urlPhone
214
335
  }}
215
336
  isEnableContinueButton
216
337
  isCustomerMode
@@ -234,9 +355,37 @@ const PhoneAutocompleteUI = (props) => {
234
355
  }
235
356
 
236
357
  export const PhoneAutocomplete = (props) => {
358
+ const [, t] = useLanguage()
237
359
  const phoneProps = {
238
360
  UIComponent: PhoneAutocompleteUI,
239
- ...props
361
+ ...props,
362
+ orderTypes: props.orderTypes || [
363
+ {
364
+ value: 1,
365
+ text: t('DELIVERY', 'Delivery'),
366
+ description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description'),
367
+ },
368
+ {
369
+ value: 2,
370
+ text: t('PICKUP', 'Pickup'),
371
+ description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
372
+ },
373
+ {
374
+ value: 3,
375
+ text: t('EAT_IN', 'Eat in'),
376
+ description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
377
+ },
378
+ {
379
+ value: 4,
380
+ text: t('CURBSIDE', 'Curbside'),
381
+ description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
382
+ },
383
+ {
384
+ value: 5,
385
+ text: t('DRIVE_THRU', 'Drive thru'),
386
+ description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
387
+ }
388
+ ]
240
389
  }
241
390
 
242
391
  return <PhoneAutocompleteController {...phoneProps} />
@@ -1,9 +1,10 @@
1
+ import React from 'react'
1
2
  import styled, { css } from 'styled-components'
2
3
 
3
4
  export const PhoneContainer = styled.div`
4
5
  width: 100%;
5
6
  height: calc(100vh - 97px);
6
-
7
+ display: flex;
7
8
  ${({ bgimage }) => bgimage && css`
8
9
  background-repeat: no-repeat, repeat;
9
10
  background-size: cover;
@@ -78,10 +79,7 @@ export const ContentWrapper = styled.div`
78
79
  justify-content: center;
79
80
  height: 100%;
80
81
  padding: 0px 20px 0px;
81
-
82
- .basic-single {
83
- margin-bottom: 15px;
84
- }
82
+ width: 70%;
85
83
 
86
84
  .select__control {
87
85
  border-radius: 30px;
@@ -126,11 +124,14 @@ export const ContentWrapper = styled.div`
126
124
  padding: 0px 40px 0px;
127
125
  `}
128
126
  }
127
+ @media (min-width: 1400px){
128
+ width: 60%;
129
+ }
129
130
  `
130
131
 
131
132
  export const WrappBtn = styled.div`
132
133
  width: 50%;
133
-
134
+ margin-top: 20px;
134
135
  button {
135
136
  min-width: 130px;
136
137
  max-width: 400px;
@@ -145,7 +146,6 @@ export const Title = styled.h1`
145
146
  text-align: left;
146
147
  font: normal normal normal 80px ${props => props.theme.fonts.special?.name || 'Georgia'};
147
148
  letter-spacing: 0px;
148
- color: #ffffff;
149
149
  text-shadow: 0px 3px 6px #00000029;
150
150
  opacity: 1;
151
151
  font-size: 35px;
@@ -160,7 +160,6 @@ export const Slogan = styled.p`
160
160
  text-align: left;
161
161
  font-size: 18px;
162
162
  letter-spacing: 0px;
163
- color: #fff;
164
163
  opacity: 1;
165
164
  margin-bottom: 15px;
166
165
 
@@ -256,7 +255,7 @@ export const SelectContainer = styled.div`
256
255
  svg{
257
256
  position: absolute;
258
257
  top: 0;
259
- left: 0;
258
+ left: 20px;
260
259
  transform: translate(50%, 70%);
261
260
  z-index: 10;
262
261
  }
@@ -264,7 +263,8 @@ export const SelectContainer = styled.div`
264
263
  width: 100%;
265
264
  .select__placeholder, .select__single-value, input {
266
265
  margin-left: 40px;
267
- z-index: 100
266
+ z-index: 100;
267
+ bottom: -10px;
268
268
  }
269
269
  .select__menu {
270
270
  position: relative;
@@ -279,6 +279,18 @@ export const SelectContainer = styled.div`
279
279
  height: 30px;
280
280
  }
281
281
  }
282
+ .select__control {
283
+ height: 45px;
284
+ padding-left: 10px;
285
+ }
286
+ .select__indicator {
287
+ bottom: 8px;
288
+ position: relative;
289
+ }
290
+ input {
291
+ position: relative;
292
+ top: -5px;
293
+ }
282
294
  }
283
295
  `
284
296
 
@@ -287,3 +299,87 @@ export const SearchContainer = styled.div`
287
299
  top: 0;
288
300
  width: 90%;
289
301
  `
302
+
303
+ const ImageWrapperStyled = styled.div`
304
+ width: 30%;
305
+ ${({ bgimage }) => bgimage && css`
306
+ background-repeat: no-repeat, repeat;
307
+ background-size: cover;
308
+ object-fit: cover;
309
+ background-position: center;
310
+ `}
311
+ @media (min-width: 1400px){
312
+ width: 40%;
313
+ }
314
+ `
315
+
316
+ export const ImageWrapper = (props) => {
317
+ const style = {}
318
+ style.backgroundImage = `url(${props.bgimage})`
319
+
320
+ return (
321
+ <ImageWrapperStyled {...props} style={style}>
322
+ {props.children}
323
+ </ImageWrapperStyled>
324
+ )
325
+ }
326
+
327
+ export const TypeButton = styled.div`
328
+ display: flex;
329
+ align-items: center;
330
+ width: 215px;
331
+ height: 75px;
332
+ border-radius: 7.6px;
333
+ padding: 16px;
334
+ box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);
335
+ margin-right: 32px;
336
+ margin-bottom: 32px;
337
+ cursor: pointer;
338
+ background: ${({ activated, theme }) => activated ? theme?.colors?.primary : theme?.colors?.white};
339
+ p{
340
+ margin: 0;
341
+ margin-left: 33px;
342
+ ${({ activated, theme }) => activated && css`
343
+ color: ${theme?.colors?.white};
344
+ `}
345
+ }
346
+ `
347
+
348
+ export const IconTypeButton = styled.div`
349
+ display: flex;
350
+ justify-content: center;
351
+ align-items: center;
352
+ width: 44px;
353
+ height: 44px;
354
+ background: ${({ activated, theme }) => activated ? theme?.colors?.white : '#F3F9FF'};
355
+ border-radius: 44px;
356
+ `
357
+
358
+ export const TypesContainer = styled.div`
359
+ display: flex;
360
+ `
361
+
362
+ export const AdditionalTypesContainer = styled.div`
363
+ width: 60%;
364
+ display: flex;
365
+ margin-bottom: 20px;
366
+ button {
367
+ padding: 4px 10px;
368
+ border-radius: 50px;
369
+ font-size: 10px;
370
+ line-height: 0;
371
+ height: 25px;
372
+ margin-right: 20px;
373
+ }
374
+ .activated {
375
+ color: ${({ theme }) => theme?.colors?.darkTextColor}
376
+ }
377
+ `
378
+
379
+ export const PhoneAutocompleteContainer = styled.div`
380
+
381
+ h2 {
382
+ font-size: 20px;
383
+ margin-bottom: 20px;
384
+ }
385
+ `
@@ -416,6 +416,7 @@ const ProductOptionsUI = (props) => {
416
416
  observer
417
417
  observeParents
418
418
  parallax
419
+ slidesPerView={1}
419
420
  thumbs={{ swiper: thumbsSwiper }} className='mySwiper2'
420
421
  onSlideChange={() => handleSlideChange()}
421
422
  >
@@ -337,6 +337,7 @@ export const RenderProductsLayout = (props) => {
337
337
  handleUpdateProducts={handleUpdateProducts}
338
338
  professionalSelected={professionalSelected}
339
339
  handleChangeProfessionalSelected={handleChangeProfessionalSelected}
340
+ previouslyProducts={businessState?.business?.previously_products}
340
341
  />
341
342
  </WrapContent>
342
343
  </BusinessCategoryProductWrapper>
@@ -237,7 +237,7 @@ export const QuantityContainer = styled.div`
237
237
  color: ${({ theme }) => theme.colors.primaryContrast};
238
238
  position: absolute;
239
239
  left: 100%;
240
- bottom: 100%;
240
+ bottom: 98%;
241
241
  width: 25px;
242
242
  height: 25px;
243
243
  text-align: center;