ordering-ui-external 10.6.2 → 10.7.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.
- package/_bundles/{0.ordering-ui.fd929d6879c63ef1ff62.js → 0.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/{4.ordering-ui.fd929d6879c63ef1ff62.js → 4.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/{7.ordering-ui.fd929d6879c63ef1ff62.js → 7.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/ordering-ui.69ebaa12d869719caa38.js +2 -0
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +31 -17
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +8 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +21 -11
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +15 -5
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +183 -59
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +55 -9
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +25 -3
- package/_modules/themes/five/src/components/MyOrders/index.js +11 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +4 -2
- package/_modules/themes/five/src/components/OrdersOption/index.js +21 -18
- package/_modules/themes/five/src/components/PageBanner/index.js +23 -9
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +1 -1
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +5 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +5 -2
- package/_modules/themes/five/src/components/UserDetails/styles.js +2 -2
- package/_modules/themes/five/src/components/WebsocketStatus/index.js +6 -3
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +22 -13
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +20 -7
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +26 -14
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +13 -5
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +210 -68
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +127 -11
- package/src/themes/five/src/components/BusinessProductsListing/index.js +21 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- package/src/themes/five/src/components/MyOrders/index.js +5 -1
- package/src/themes/five/src/components/OrderDetails/index.js +2 -0
- package/src/themes/five/src/components/OrdersOption/index.js +5 -3
- package/src/themes/five/src/components/PageBanner/index.js +14 -4
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -2
- package/src/themes/five/src/components/ProductItemAccordion/index.js +4 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +4 -1
- package/src/themes/five/src/components/UserDetails/styles.js +2 -2
- package/src/themes/five/src/components/WebsocketStatus/index.js +4 -4
- package/_bundles/ordering-ui.fd929d6879c63ef1ff62.js +0 -2
- /package/_bundles/{1.ordering-ui.fd929d6879c63ef1ff62.js → 1.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{2.ordering-ui.fd929d6879c63ef1ff62.js → 2.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{5.ordering-ui.fd929d6879c63ef1ff62.js → 5.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{6.ordering-ui.fd929d6879c63ef1ff62.js → 6.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{7.ordering-ui.fd929d6879c63ef1ff62.js.LICENSE.txt → 7.ordering-ui.69ebaa12d869719caa38.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.fd929d6879c63ef1ff62.js → 8.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{9.ordering-ui.fd929d6879c63ef1ff62.js → 9.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{ordering-ui.fd929d6879c63ef1ff62.js.LICENSE.txt → ordering-ui.69ebaa12d869719caa38.js.LICENSE.txt} +0 -0
|
@@ -4,16 +4,14 @@ 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
|
-
import { Modal } from '
|
|
12
|
-
import { SignUpForm } from '../SignUpForm'
|
|
13
|
-
import { Button } from '../../styles/Buttons'
|
|
14
|
-
import { Alert } from '../Confirm'
|
|
15
|
-
import { UserDetails } from '../UserDetails'
|
|
11
|
+
import { Alert } from '../../../../five/src/components/Confirm'
|
|
12
|
+
import { Button, SignUpForm, Modal } from '../../../../five'
|
|
16
13
|
import { AddressList } from '../AddressList'
|
|
14
|
+
import { UserDetails } from '../UserDetails'
|
|
17
15
|
|
|
18
16
|
import {
|
|
19
17
|
PhoneContainer,
|
|
@@ -22,7 +20,14 @@ import {
|
|
|
22
20
|
Slogan,
|
|
23
21
|
UserEdit,
|
|
24
22
|
WrappBtn,
|
|
25
|
-
SelectContainer
|
|
23
|
+
SelectContainer,
|
|
24
|
+
TypesContainer,
|
|
25
|
+
TypeButton,
|
|
26
|
+
IconTypeButton,
|
|
27
|
+
AdditionalTypesContainer,
|
|
28
|
+
PhoneAutocompleteContainer,
|
|
29
|
+
ImageWrapper,
|
|
30
|
+
ContinueButton
|
|
26
31
|
} from './styles'
|
|
27
32
|
|
|
28
33
|
import MdcCellphoneAndroid from '@meronex/icons/mdc/MdcCellphoneAndroid'
|
|
@@ -34,23 +39,31 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
34
39
|
customersPhones,
|
|
35
40
|
setCustomersPhones,
|
|
36
41
|
openModal,
|
|
42
|
+
limitPhoneLength,
|
|
37
43
|
setOpenModal,
|
|
38
44
|
onChangeNumber,
|
|
39
45
|
setCustomerState,
|
|
40
46
|
countryCallingCode,
|
|
41
|
-
onRedirectPage
|
|
47
|
+
onRedirectPage,
|
|
48
|
+
urlPhone,
|
|
49
|
+
orderTypes,
|
|
50
|
+
localPhoneCode
|
|
42
51
|
} = props
|
|
43
|
-
const
|
|
52
|
+
const allOrderTypes = [1, 2, 3, 4, 5]
|
|
53
|
+
const pickupTypes = [2, 3, 4, 5]
|
|
54
|
+
const [orderState, { changeType }] = useOrder()
|
|
44
55
|
const [, t] = useLanguage()
|
|
45
56
|
const theme = useTheme()
|
|
46
57
|
const [, { deleteUserCustomer }] = useCustomer()
|
|
58
|
+
const [configState] = useConfig()
|
|
47
59
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
48
|
-
const [inputValue, setInputValue] = useState('')
|
|
60
|
+
const [inputValue, setInputValue] = useState(urlPhone ?? '')
|
|
49
61
|
const [optSelected, setOptSelected] = useState(null)
|
|
50
62
|
const [isOpenUserData, setIsOpenUserData] = useState(false)
|
|
51
63
|
const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
|
|
64
|
+
const [isPickupSelected, setIsPickupSelected] = useState(pickupTypes.includes(orderState?.options?.type))
|
|
52
65
|
const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
|
|
53
|
-
|
|
66
|
+
const configTypes = configState?.configs?.order_types_allowed?.value.split('|').filter(value => (allOrderTypes.includes(Number(value)))).map(value => Number(value)) || []
|
|
54
67
|
const userName = userCustomer?.lastname
|
|
55
68
|
? `${userCustomer?.name} ${userCustomer?.lastname}`
|
|
56
69
|
: userCustomer?.name
|
|
@@ -74,6 +87,15 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
74
87
|
}
|
|
75
88
|
}
|
|
76
89
|
|
|
90
|
+
const handleChangeType = (value) => {
|
|
91
|
+
if (!orderState?.loading) {
|
|
92
|
+
changeType(value)
|
|
93
|
+
if (value === 1) {
|
|
94
|
+
setIsPickupSelected(false)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
77
99
|
useEffect(() => {
|
|
78
100
|
if (customersPhones?.error) {
|
|
79
101
|
setAlertState({ open: true, content: [customersPhones?.error] })
|
|
@@ -81,13 +103,14 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
81
103
|
}, [customersPhones?.error])
|
|
82
104
|
|
|
83
105
|
const onInputChange = (inputValue, { action }) => {
|
|
84
|
-
if (action === 'menu-close' || action === 'input-blur' || action === 'set-value') {
|
|
106
|
+
if (action === 'menu-close' || action === 'input-blur' || action === 'set-value' || inputValue.charAt(0) === '0') {
|
|
85
107
|
return
|
|
86
108
|
}
|
|
87
109
|
if (!inputValue) {
|
|
88
110
|
setInputValue(inputValue)
|
|
111
|
+
onChangeNumber(inputValue)
|
|
89
112
|
}
|
|
90
|
-
if ((inputValue && inputValue.length >
|
|
113
|
+
if ((inputValue && inputValue.length > limitPhoneLength) || !(/^[0-9]+$/.test(inputValue))) {
|
|
91
114
|
return
|
|
92
115
|
}
|
|
93
116
|
setInputValue(inputValue)
|
|
@@ -97,30 +120,40 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
97
120
|
const onChange = (option) => {
|
|
98
121
|
setOptSelected(option)
|
|
99
122
|
setInputValue(option ? option?.value : '')
|
|
123
|
+
if (!option) { onChangeNumber(''); return }
|
|
100
124
|
const user = customersPhones.users?.find(user => user.cellphone === option?.value || user.phone === option?.value)
|
|
101
125
|
if (user) {
|
|
102
126
|
setCustomerState({ ...customerState, result: user })
|
|
103
|
-
setOpenModal({
|
|
127
|
+
setOpenModal({ signup: false, customer: true })
|
|
128
|
+
} else {
|
|
129
|
+
setCustomerState({ ...customerState, result: { error: false } })
|
|
130
|
+
setOpenModal({ customer: false, signup: true })
|
|
104
131
|
}
|
|
105
132
|
}
|
|
106
133
|
|
|
107
134
|
const createNewUser = () => {
|
|
108
|
-
if ((optSelected && optSelected?.value?.length ===
|
|
135
|
+
if ((optSelected && optSelected?.value?.length === limitPhoneLength) || (!optSelected && phone.length === limitPhoneLength)) {
|
|
109
136
|
setOpenModal({ ...openModal, signup: true })
|
|
110
137
|
} else {
|
|
111
138
|
setAlertState({
|
|
112
139
|
open: true,
|
|
113
|
-
content: t('ERROR_MIN_CHARACTERS_PHONE', 'The Phone / Mobile must be
|
|
140
|
+
content: t('ERROR_MIN_CHARACTERS_PHONE', 'The Phone / Mobile must be :length: characters').replace(':length:', limitPhoneLength)
|
|
114
141
|
})
|
|
115
142
|
}
|
|
116
143
|
}
|
|
117
144
|
|
|
118
145
|
const handleCloseAddressList = () => {
|
|
119
|
-
setOpenModal({ openModal, customer: false })
|
|
146
|
+
setOpenModal({ ...openModal, customer: false })
|
|
120
147
|
setCustomerState({ ...customerState, result: { error: false } })
|
|
121
148
|
deleteUserCustomer(true)
|
|
122
149
|
}
|
|
123
150
|
|
|
151
|
+
const handleChangeToPickup = () => {
|
|
152
|
+
const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
|
|
153
|
+
handleChangeType(firstEnabledPickupType)
|
|
154
|
+
setIsPickupSelected(true)
|
|
155
|
+
}
|
|
156
|
+
|
|
124
157
|
const optionsToSelect = customersPhones.users.map(user => {
|
|
125
158
|
const obj = {}
|
|
126
159
|
obj.value = user.cellphone || user.phone
|
|
@@ -128,63 +161,145 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
128
161
|
return obj
|
|
129
162
|
}) || []
|
|
130
163
|
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (!urlPhone) return
|
|
166
|
+
onInputChange(urlPhone, { action: 'url' })
|
|
167
|
+
onChange({ value: urlPhone, label: urlPhone })
|
|
168
|
+
}, [urlPhone, customersPhones?.users?.length])
|
|
169
|
+
|
|
170
|
+
useEffect(() => {
|
|
171
|
+
if (pickupTypes.includes(orderState?.options?.type)) {
|
|
172
|
+
setIsPickupSelected(true)
|
|
173
|
+
}
|
|
174
|
+
}, [orderState?.options?.type])
|
|
175
|
+
|
|
176
|
+
const OrderTypesComponent = () => {
|
|
177
|
+
return (
|
|
178
|
+
<>
|
|
179
|
+
{orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && type.value !== 1) : orderTypes).map((item, i) => (
|
|
180
|
+
<Button
|
|
181
|
+
key={item.value}
|
|
182
|
+
onClick={() => handleChangeType(item.value)}
|
|
183
|
+
color={orderState?.options?.type === item?.value ? 'primary' : 'secondary'}
|
|
184
|
+
disabled={orderState?.loading}
|
|
185
|
+
className={orderState?.options?.type !== item?.value ? 'activated' : ''}
|
|
186
|
+
>
|
|
187
|
+
{item.text}
|
|
188
|
+
</Button>
|
|
189
|
+
))}
|
|
190
|
+
</>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
131
194
|
return (
|
|
132
195
|
<>
|
|
133
|
-
|
|
134
|
-
<React.Fragment key={i}>
|
|
135
|
-
{BeforeElement}
|
|
136
|
-
</React.Fragment>))}
|
|
137
|
-
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
138
|
-
<BeforeComponent key={i} {...props} />))}
|
|
139
|
-
<PhoneContainer bgimage={theme.images?.general?.homeHero}>
|
|
196
|
+
<PhoneContainer>
|
|
140
197
|
<ContentWrapper>
|
|
141
198
|
<Title>{t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')}</Title>
|
|
142
|
-
<Slogan>{t('SUBTITLE_HOME_CALLCENTER', 'Start
|
|
143
|
-
{!userCustomer && (
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
199
|
+
<Slogan>{t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')}</Slogan>
|
|
200
|
+
{!(userCustomer && orderState?.options?.address?.address) && (
|
|
201
|
+
<TypesContainer>
|
|
202
|
+
{configTypes.includes(1) && (
|
|
203
|
+
<TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={!isPickupSelected}>
|
|
204
|
+
<IconTypeButton activated={!isPickupSelected}>
|
|
205
|
+
<img
|
|
206
|
+
src={theme?.images?.general?.deliveryIco}
|
|
207
|
+
width={20}
|
|
208
|
+
height={20}
|
|
209
|
+
/>
|
|
210
|
+
</IconTypeButton>
|
|
211
|
+
<p>{t('DELIVERY', 'Delivery')}</p>
|
|
212
|
+
</TypeButton>
|
|
213
|
+
)}
|
|
214
|
+
{configTypes.some(type => pickupTypes.includes(type)) && (
|
|
215
|
+
<TypeButton
|
|
216
|
+
disabled={orderState?.loading}
|
|
217
|
+
activated={isPickupSelected}
|
|
218
|
+
onClick={() => handleChangeToPickup()}
|
|
219
|
+
>
|
|
220
|
+
<IconTypeButton activated={isPickupSelected}>
|
|
221
|
+
<img
|
|
222
|
+
src={theme?.images?.general?.pickupIco}
|
|
223
|
+
width={22}
|
|
224
|
+
height={22}
|
|
225
|
+
/>
|
|
226
|
+
</IconTypeButton>
|
|
227
|
+
<p>{t('PICKUP', 'Pickup')}</p>
|
|
228
|
+
</TypeButton>
|
|
229
|
+
)}
|
|
230
|
+
</TypesContainer>
|
|
231
|
+
)}
|
|
232
|
+
{isPickupSelected && (
|
|
233
|
+
<>
|
|
234
|
+
<p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
|
|
235
|
+
<AdditionalTypesContainer>
|
|
236
|
+
<OrderTypesComponent />
|
|
237
|
+
</AdditionalTypesContainer>
|
|
238
|
+
</>
|
|
239
|
+
)}
|
|
240
|
+
{configTypes.includes(orderState?.options?.type) && (
|
|
241
|
+
<>
|
|
242
|
+
{!userCustomer && (
|
|
243
|
+
<PhoneAutocompleteContainer>
|
|
244
|
+
<h2>
|
|
245
|
+
{t('ADDING_CUSTOMERS_PHONE_NUMBER', 'Adding the customers’ phone number')}
|
|
246
|
+
</h2>
|
|
247
|
+
<WrappBtn>
|
|
248
|
+
<Button
|
|
249
|
+
color={(inputValue || (userCustomer && orderState?.options?.address?.address)) ? 'primary' : 'secundary'}
|
|
250
|
+
onMouseDown={() => !(userCustomer && orderState?.options?.address?.address) ? createNewUser() : handleFindClick()}
|
|
251
|
+
disabled={(!inputValue && !(userCustomer && orderState?.options?.address?.address))}
|
|
252
|
+
>
|
|
253
|
+
{
|
|
254
|
+
!(userCustomer && orderState?.options?.address?.address)
|
|
255
|
+
? t('CREATE_CUSTOMER', 'Create new customer')
|
|
256
|
+
: `${t('CONTINUE_WITH', 'Continue with')} ${userName}`
|
|
257
|
+
}
|
|
258
|
+
</Button>
|
|
259
|
+
</WrappBtn>
|
|
260
|
+
<SelectContainer>
|
|
261
|
+
<MdcCellphoneAndroid size={18} color={theme?.colors?.primary} />
|
|
262
|
+
<Select
|
|
263
|
+
isSearchable
|
|
264
|
+
isClearable
|
|
265
|
+
className='basic-single'
|
|
266
|
+
classNamePrefix='select'
|
|
267
|
+
placeholder={t('PHONE_NUMBER', 'Phone number')}
|
|
268
|
+
value={optSelected}
|
|
269
|
+
noOptionsMessage={() => inputValue?.length > 6 ? t('NO_OPTIONS', 'No options') : t('TYPE_AT_LEAST_NUMBER_SUGGEST', 'Type at least 7 numbers for suggesstions')}
|
|
270
|
+
inputValue={!optSelected ? inputValue : ''}
|
|
271
|
+
onChange={onChange}
|
|
272
|
+
onInputChange={onInputChange}
|
|
273
|
+
isLoading={customersPhones?.loading}
|
|
274
|
+
options={optionsToSelect}
|
|
275
|
+
/>
|
|
276
|
+
{optSelected && (
|
|
277
|
+
<ContinueButton>
|
|
278
|
+
<Button onClick={() => onChange(optSelected)} color='primary'>
|
|
279
|
+
{t('CONTINUE', 'Continue')}
|
|
280
|
+
</Button>
|
|
281
|
+
</ContinueButton>
|
|
282
|
+
)}
|
|
283
|
+
</SelectContainer>
|
|
284
|
+
</PhoneAutocompleteContainer>
|
|
285
|
+
)}
|
|
286
|
+
</>
|
|
161
287
|
)}
|
|
162
|
-
<WrappBtn>
|
|
163
|
-
<Button
|
|
164
|
-
color={inputValue || (userCustomer && orderState?.options?.address?.address) ? 'primary' : 'secundary'}
|
|
165
|
-
onMouseDown={() => !(userCustomer && orderState?.options?.address?.address) ? createNewUser() : handleFindClick()}
|
|
166
|
-
disabled={!inputValue && !(userCustomer && orderState?.options?.address?.address)}
|
|
167
|
-
>
|
|
168
|
-
{
|
|
169
|
-
!(userCustomer && orderState?.options?.address?.address)
|
|
170
|
-
? t('CREATE_CUSTOMER', 'Create new customer')
|
|
171
|
-
: `${t('CONTINUE_WITH', 'Continue with')} ${userName}`
|
|
172
|
-
}
|
|
173
|
-
</Button>
|
|
174
|
-
</WrappBtn>
|
|
175
288
|
</ContentWrapper>
|
|
289
|
+
<ImageWrapper bgimage={theme?.images?.general?.phoneHero} />
|
|
176
290
|
</PhoneContainer>
|
|
177
291
|
<Modal
|
|
178
292
|
open={openModal.signup}
|
|
179
293
|
width='80%'
|
|
180
|
-
onClose={() => setOpenModal({ openModal, signup: false })}
|
|
294
|
+
onClose={() => setOpenModal({ ...openModal, signup: false })}
|
|
181
295
|
>
|
|
182
296
|
<SignUpForm
|
|
183
|
-
externalPhoneNumber={`${countryCallingCode} ${optSelected?.value || phone}`}
|
|
297
|
+
externalPhoneNumber={`${localPhoneCode || countryCallingCode} ${optSelected?.value || phone}`}
|
|
184
298
|
saveCustomerUser={saveCustomerUser}
|
|
185
299
|
fieldsNotValid={props.fieldsNotValid}
|
|
186
300
|
useChekoutFileds
|
|
187
|
-
isCustomerMode
|
|
301
|
+
isCustomerMode
|
|
302
|
+
isPopup
|
|
188
303
|
/>
|
|
189
304
|
</Modal>
|
|
190
305
|
<Modal
|
|
@@ -212,7 +327,8 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
212
327
|
changeOrderAddressWithDefault
|
|
213
328
|
userCustomerSetup={{
|
|
214
329
|
...customerState?.result,
|
|
215
|
-
phone
|
|
330
|
+
phone,
|
|
331
|
+
urlPhone
|
|
216
332
|
}}
|
|
217
333
|
isEnableContinueButton
|
|
218
334
|
isCustomerMode
|
|
@@ -231,21 +347,47 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
231
347
|
onClose={handleCloseAlert}
|
|
232
348
|
onAccept={handleCloseAlert}
|
|
233
349
|
/>
|
|
234
|
-
{props.afterComponents?.map((AfterComponent, i) => (
|
|
235
|
-
<AfterComponent key={i} {...props} />))}
|
|
236
|
-
{props.afterElements?.map((AfterElement, i) => (
|
|
237
|
-
<React.Fragment key={i}>
|
|
238
|
-
{AfterElement}
|
|
239
|
-
</React.Fragment>))}
|
|
240
350
|
</>
|
|
241
351
|
)
|
|
242
352
|
}
|
|
243
353
|
|
|
244
354
|
export const PhoneAutocomplete = (props) => {
|
|
355
|
+
const [, t] = useLanguage()
|
|
245
356
|
const phoneProps = {
|
|
246
357
|
UIComponent: PhoneAutocompleteUI,
|
|
247
|
-
...props
|
|
358
|
+
...props,
|
|
359
|
+
orderTypes: props.orderTypes || [
|
|
360
|
+
{
|
|
361
|
+
value: 1,
|
|
362
|
+
text: t('DELIVERY', 'Delivery'),
|
|
363
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
value: 2,
|
|
367
|
+
text: t('PICKUP', 'Pickup'),
|
|
368
|
+
description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
value: 3,
|
|
372
|
+
text: t('EAT_IN', 'Eat in'),
|
|
373
|
+
description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
value: 4,
|
|
377
|
+
text: t('CURBSIDE', 'Curbside'),
|
|
378
|
+
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
value: 5,
|
|
382
|
+
text: t('DRIVE_THRU', 'Drive thru'),
|
|
383
|
+
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
|
|
384
|
+
}
|
|
385
|
+
]
|
|
248
386
|
}
|
|
249
387
|
|
|
250
388
|
return <PhoneAutocompleteController {...phoneProps} />
|
|
251
389
|
}
|
|
390
|
+
|
|
391
|
+
PhoneAutocompleteUI.defaultProps = {
|
|
392
|
+
limitPhoneLength: 10
|
|
393
|
+
}
|
|
@@ -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,11 +79,8 @@ export const ContentWrapper = styled.div`
|
|
|
78
79
|
justify-content: center;
|
|
79
80
|
height: 100%;
|
|
80
81
|
padding: 0px 20px 0px;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
margin-bottom: 15px;
|
|
84
|
-
}
|
|
85
|
-
|
|
82
|
+
width: 70%;
|
|
83
|
+
position: relative;
|
|
86
84
|
.select__control {
|
|
87
85
|
border-radius: 30px;
|
|
88
86
|
}
|
|
@@ -126,13 +124,23 @@ 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
|
+
position: relative;
|
|
134
135
|
button {
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 55px;
|
|
135
138
|
min-width: 130px;
|
|
139
|
+
max-width: 400px;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
text-overflow: ellipsis;
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
z-index: 100;
|
|
136
144
|
}
|
|
137
145
|
`
|
|
138
146
|
|
|
@@ -141,7 +149,6 @@ export const Title = styled.h1`
|
|
|
141
149
|
text-align: left;
|
|
142
150
|
font: normal normal normal 80px ${props => props.theme.fonts.special?.name || 'Georgia'};
|
|
143
151
|
letter-spacing: 0px;
|
|
144
|
-
color: #ffffff;
|
|
145
152
|
text-shadow: 0px 3px 6px #00000029;
|
|
146
153
|
opacity: 1;
|
|
147
154
|
font-size: 35px;
|
|
@@ -156,7 +163,6 @@ export const Slogan = styled.p`
|
|
|
156
163
|
text-align: left;
|
|
157
164
|
font-size: 18px;
|
|
158
165
|
letter-spacing: 0px;
|
|
159
|
-
color: #fff;
|
|
160
166
|
opacity: 1;
|
|
161
167
|
margin-bottom: 15px;
|
|
162
168
|
|
|
@@ -252,7 +258,7 @@ export const SelectContainer = styled.div`
|
|
|
252
258
|
svg{
|
|
253
259
|
position: absolute;
|
|
254
260
|
top: 0;
|
|
255
|
-
left:
|
|
261
|
+
left: 20px;
|
|
256
262
|
transform: translate(50%, 70%);
|
|
257
263
|
z-index: 10;
|
|
258
264
|
}
|
|
@@ -260,7 +266,8 @@ export const SelectContainer = styled.div`
|
|
|
260
266
|
width: 100%;
|
|
261
267
|
.select__placeholder, .select__single-value, input {
|
|
262
268
|
margin-left: 40px;
|
|
263
|
-
z-index: 100
|
|
269
|
+
z-index: 100;
|
|
270
|
+
bottom: -10px;
|
|
264
271
|
}
|
|
265
272
|
.select__menu {
|
|
266
273
|
position: relative;
|
|
@@ -275,6 +282,21 @@ export const SelectContainer = styled.div`
|
|
|
275
282
|
height: 30px;
|
|
276
283
|
}
|
|
277
284
|
}
|
|
285
|
+
.select__control {
|
|
286
|
+
height: 45px;
|
|
287
|
+
padding-left: 10px;
|
|
288
|
+
}
|
|
289
|
+
.select__indicator {
|
|
290
|
+
bottom: 8px;
|
|
291
|
+
position: relative;
|
|
292
|
+
}
|
|
293
|
+
.select__menu{
|
|
294
|
+
top: 45px;
|
|
295
|
+
}
|
|
296
|
+
input {
|
|
297
|
+
position: relative;
|
|
298
|
+
top: -5px;
|
|
299
|
+
}
|
|
278
300
|
}
|
|
279
301
|
`
|
|
280
302
|
|
|
@@ -283,3 +305,97 @@ export const SearchContainer = styled.div`
|
|
|
283
305
|
top: 0;
|
|
284
306
|
width: 90%;
|
|
285
307
|
`
|
|
308
|
+
|
|
309
|
+
const ImageWrapperStyled = styled.div`
|
|
310
|
+
width: 30%;
|
|
311
|
+
${({ bgimage }) => bgimage && css`
|
|
312
|
+
background-repeat: no-repeat, repeat;
|
|
313
|
+
background-size: cover;
|
|
314
|
+
object-fit: cover;
|
|
315
|
+
background-position: center;
|
|
316
|
+
`}
|
|
317
|
+
@media (min-width: 1400px){
|
|
318
|
+
width: 40%;
|
|
319
|
+
}
|
|
320
|
+
`
|
|
321
|
+
|
|
322
|
+
export const ImageWrapper = (props) => {
|
|
323
|
+
const style = {}
|
|
324
|
+
style.backgroundImage = `url(${props.bgimage})`
|
|
325
|
+
|
|
326
|
+
return (
|
|
327
|
+
<ImageWrapperStyled {...props} style={style}>
|
|
328
|
+
{props.children}
|
|
329
|
+
</ImageWrapperStyled>
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export const TypeButton = styled.div`
|
|
334
|
+
display: flex;
|
|
335
|
+
align-items: center;
|
|
336
|
+
width: 215px;
|
|
337
|
+
height: 75px;
|
|
338
|
+
border-radius: 7.6px;
|
|
339
|
+
padding: 16px;
|
|
340
|
+
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);
|
|
341
|
+
margin-right: 32px;
|
|
342
|
+
margin-bottom: 32px;
|
|
343
|
+
cursor: pointer;
|
|
344
|
+
background: ${({ activated, theme }) => activated ? theme?.colors?.primary : theme?.colors?.white};
|
|
345
|
+
p{
|
|
346
|
+
margin: 0;
|
|
347
|
+
margin-left: 33px;
|
|
348
|
+
${({ activated, theme }) => activated && css`
|
|
349
|
+
color: ${theme?.colors?.white};
|
|
350
|
+
`}
|
|
351
|
+
}
|
|
352
|
+
`
|
|
353
|
+
|
|
354
|
+
export const IconTypeButton = styled.div`
|
|
355
|
+
display: flex;
|
|
356
|
+
justify-content: center;
|
|
357
|
+
align-items: center;
|
|
358
|
+
width: 44px;
|
|
359
|
+
height: 44px;
|
|
360
|
+
background: ${({ activated, theme }) => activated ? theme?.colors?.white : '#F3F9FF'};
|
|
361
|
+
border-radius: 44px;
|
|
362
|
+
`
|
|
363
|
+
|
|
364
|
+
export const TypesContainer = styled.div`
|
|
365
|
+
display: flex;
|
|
366
|
+
`
|
|
367
|
+
|
|
368
|
+
export const AdditionalTypesContainer = styled.div`
|
|
369
|
+
width: 60%;
|
|
370
|
+
display: flex;
|
|
371
|
+
margin-bottom: 20px;
|
|
372
|
+
button {
|
|
373
|
+
padding: 4px 10px;
|
|
374
|
+
border-radius: 50px;
|
|
375
|
+
font-size: 10px;
|
|
376
|
+
line-height: 0;
|
|
377
|
+
height: 25px;
|
|
378
|
+
margin-right: 20px;
|
|
379
|
+
}
|
|
380
|
+
.activated {
|
|
381
|
+
color: ${({ theme }) => theme?.colors?.darkTextColor}
|
|
382
|
+
}
|
|
383
|
+
`
|
|
384
|
+
|
|
385
|
+
export const PhoneAutocompleteContainer = styled.div`
|
|
386
|
+
position: relative;
|
|
387
|
+
h2 {
|
|
388
|
+
font-size: 20px;
|
|
389
|
+
margin-bottom: 20px;
|
|
390
|
+
}
|
|
391
|
+
`
|
|
392
|
+
|
|
393
|
+
export const ContinueButton = styled.span`
|
|
394
|
+
position: absolute;
|
|
395
|
+
right: 35px;
|
|
396
|
+
bottom: 5px;
|
|
397
|
+
width:
|
|
398
|
+
button {
|
|
399
|
+
cursor: pointer;
|
|
400
|
+
}
|
|
401
|
+
`
|
|
@@ -185,6 +185,26 @@ const BusinessProductsListingUI = (props) => {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
const handleCustomProductBannerClick = (product) => {
|
|
189
|
+
if (!((product?.type === 'service') && business?.professionals?.length > 0)) {
|
|
190
|
+
if (site?.product_url_template) {
|
|
191
|
+
onProductRedirect({
|
|
192
|
+
slug: business?.slug,
|
|
193
|
+
product: site.product_url_template.includes('product_slug') ? product?.slug : product.id,
|
|
194
|
+
category: site.product_url_template.includes('category_slug') ? product?.category?.slug : product.category_id
|
|
195
|
+
})
|
|
196
|
+
} else {
|
|
197
|
+
onProductRedirect({
|
|
198
|
+
slug: business?.slug,
|
|
199
|
+
product: product.id,
|
|
200
|
+
category: product.category_id
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
setCurProduct(product)
|
|
205
|
+
setModalIsOpen(true)
|
|
206
|
+
}
|
|
207
|
+
|
|
188
208
|
const handlerProductAction = (product) => {
|
|
189
209
|
if (Object.keys(product).length) {
|
|
190
210
|
setModalIsOpen(false)
|
|
@@ -411,6 +431,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
411
431
|
productToIdLoading={productToIdLoading}
|
|
412
432
|
handleUpdateProfessionals={handleUpdateProfessionals}
|
|
413
433
|
isCustomerMode={isCustomerMode}
|
|
434
|
+
handleCustomProductBannerClick={handleCustomProductBannerClick}
|
|
414
435
|
/>
|
|
415
436
|
|
|
416
437
|
{
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -593,7 +593,7 @@ export const OriginalBusinessesListing = (props) => {
|
|
|
593
593
|
{
|
|
594
594
|
value: 1,
|
|
595
595
|
text: t('DELIVERY', 'Delivery'),
|
|
596
|
-
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
596
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
597
597
|
},
|
|
598
598
|
{
|
|
599
599
|
value: 2,
|
|
@@ -21,7 +21,8 @@ export const MyOrders = (props) => {
|
|
|
21
21
|
hideOrders,
|
|
22
22
|
isFromBusinessListingSearch,
|
|
23
23
|
businessesSearchList,
|
|
24
|
-
onProductRedirect
|
|
24
|
+
onProductRedirect,
|
|
25
|
+
onRedirectPage
|
|
25
26
|
} = props
|
|
26
27
|
|
|
27
28
|
const [, t] = useLanguage()
|
|
@@ -121,6 +122,9 @@ export const MyOrders = (props) => {
|
|
|
121
122
|
{...props}
|
|
122
123
|
pastOrders
|
|
123
124
|
setIsEmptyPast={setIsEmptyPast}
|
|
125
|
+
handleRedirectToCheckout={uuid => {
|
|
126
|
+
onRedirectPage && onRedirectPage({ page: 'checkout', params: { cartUuid: uuid } })
|
|
127
|
+
}}
|
|
124
128
|
/>
|
|
125
129
|
{!isEmptyPast && <Divider />}
|
|
126
130
|
</>
|
|
@@ -290,6 +290,7 @@ const OrderDetailsUI = (props) => {
|
|
|
290
290
|
<ProductItemAccordion
|
|
291
291
|
key={product.id}
|
|
292
292
|
product={product}
|
|
293
|
+
showArrowIcon
|
|
293
294
|
/>
|
|
294
295
|
))}
|
|
295
296
|
</ProfessionalBlock>
|
|
@@ -298,6 +299,7 @@ const OrderDetailsUI = (props) => {
|
|
|
298
299
|
<ProductItemAccordion
|
|
299
300
|
key={product.id}
|
|
300
301
|
product={product}
|
|
302
|
+
showArrowIcon
|
|
301
303
|
/>
|
|
302
304
|
))}
|
|
303
305
|
</>
|