ordering-ui-external 10.9.0 → 10.9.2
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.ac159b0ec9eb4a80c944.js → 0.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{1.ordering-ui.ac159b0ec9eb4a80c944.js → 1.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{2.ordering-ui.ac159b0ec9eb4a80c944.js → 2.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{4.ordering-ui.ac159b0ec9eb4a80c944.js → 4.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{5.ordering-ui.ac159b0ec9eb4a80c944.js → 5.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{6.ordering-ui.ac159b0ec9eb4a80c944.js → 6.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{7.ordering-ui.ac159b0ec9eb4a80c944.js → 7.ordering-ui.c4b4f29a4f0c8eaad874.js} +2 -2
- package/_bundles/{8.ordering-ui.ac159b0ec9eb4a80c944.js → 8.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/{9.ordering-ui.ac159b0ec9eb4a80c944.js → 9.ordering-ui.c4b4f29a4f0c8eaad874.js} +1 -1
- package/_bundles/ordering-ui.c4b4f29a4f0c8eaad874.js +2 -0
- package/_modules/components/AddressForm/index.js +5 -8
- package/_modules/components/BusinessProductsListing/index.js +5 -8
- package/_modules/components/Checkout/index.js +5 -8
- package/_modules/components/Footer/index.js +5 -7
- package/_modules/components/HelpStaticPage/index.js +5 -7
- package/_modules/components/LoginForm/index.js +5 -8
- package/_modules/components/OrdersOption/index.js +5 -8
- package/_modules/components/PagesList/index.js +5 -7
- package/_modules/components/StripeMethodForm/index.js +5 -8
- package/_modules/hooks/useIntersectionObserver.js +5 -7
- package/_modules/themes/callcenterOriginal/src/components/AddressDetails/index.js +11 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +22 -14
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +5 -4
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +10 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +7 -6
- package/_modules/themes/callcenterOriginal/src/components/Checkout/index.js +7 -9
- package/_modules/themes/callcenterOriginal/src/components/Footer/index.js +5 -7
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +8 -6
- package/_modules/themes/callcenterOriginal/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/callcenterOriginal/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/callcenterOriginal/src/components/Orders/AddressForm/index.js +6 -9
- package/_modules/themes/callcenterOriginal/src/components/Orders/CreateCustomOrder/Checkout/index.js +5 -8
- package/_modules/themes/callcenterOriginal/src/components/Orders/CreateCustomOrder/StripeMethodForm/index.js +5 -8
- package/_modules/themes/callcenterOriginal/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +40 -25
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +9 -7
- package/_modules/themes/callcenterOriginal/src/components/Shared/ImageCrop/index.js +5 -7
- package/_modules/themes/eight/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/eight/src/components/Checkout/index.js +5 -8
- package/_modules/themes/eight/src/components/Footer/index.js +5 -7
- package/_modules/themes/eight/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/five/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/five/src/components/AddressList/index.js +5 -8
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +9 -15
- package/_modules/themes/five/src/components/Checkout/index.js +5 -8
- package/_modules/themes/five/src/components/Footer/index.js +5 -8
- package/_modules/themes/five/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/five/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/five/src/components/LogoutPopup/index.js +9 -15
- package/_modules/themes/five/src/components/NotNetworkConnectivity/index.js +5 -8
- package/_modules/themes/five/src/components/OrderDetails/index.js +10 -16
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +5 -8
- package/_modules/themes/five/src/components/SignUpForm/index.js +5 -8
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +5 -8
- package/_modules/themes/four/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/four/src/components/BusinessProductsListing/index.js +5 -8
- package/_modules/themes/four/src/components/Checkout/index.js +5 -8
- package/_modules/themes/four/src/components/Footer/index.js +5 -7
- package/_modules/themes/four/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/four/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/four/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/franchise/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/franchise/src/components/Checkout/index.js +5 -8
- package/_modules/themes/franchise/src/components/Footer/index.js +5 -7
- package/_modules/themes/franchise/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/franchise/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/franchise/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/orderAndPay/src/components/Checkout/index.js +20 -31
- package/_modules/themes/orderAndPay/src/components/Footer/index.js +5 -7
- package/_modules/themes/orderAndPay/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/orderAndPay/src/components/OrderTypeSelectorContent/index.js +9 -15
- package/_modules/themes/orderAndPay/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/pwa/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/pwa/src/components/Checkout/index.js +5 -8
- package/_modules/themes/pwa/src/components/Footer/index.js +5 -7
- package/_modules/themes/pwa/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/pwa/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/pwa/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/seven/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/seven/src/components/Checkout/index.js +5 -8
- package/_modules/themes/seven/src/components/Footer/index.js +5 -7
- package/_modules/themes/seven/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/seven/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/seven/src/components/ProductForm/productForm.js +9 -15
- package/_modules/themes/six/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/six/src/components/Checkout/index.js +5 -8
- package/_modules/themes/six/src/components/Footer/index.js +5 -7
- package/_modules/themes/six/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/three/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/three/src/components/Checkout/index.js +5 -8
- package/_modules/themes/three/src/components/Footer/index.js +5 -7
- package/_modules/themes/three/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/three/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/three/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/two/src/components/Checkout/index.js +5 -8
- package/_modules/themes/two/src/components/HelpStaticPage/index.js +5 -7
- package/_modules/themes/two/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/two/src/components/OrdersOption/index.js +5 -8
- package/_modules/themes/wow/src/components/AddressForm/index.js +5 -8
- package/_modules/themes/wow/src/components/Checkout/index.js +5 -8
- package/_modules/themes/wow/src/components/LoginForm/index.js +5 -8
- package/_modules/themes/wow/src/components/OrdersOption/index.js +5 -8
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/AddressDetails/index.js +10 -3
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +15 -4
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +3 -1
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +14 -4
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +5 -5
- package/src/themes/callcenterOriginal/src/components/Checkout/index.js +1 -0
- package/src/themes/callcenterOriginal/src/components/Header/index.js +6 -5
- package/src/themes/callcenterOriginal/src/components/Orders/AddressForm/index.js +1 -1
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +39 -11
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +9 -4
- package/_bundles/ordering-ui.ac159b0ec9eb4a80c944.js +0 -2
- /package/_bundles/{7.ordering-ui.ac159b0ec9eb4a80c944.js.LICENSE.txt → 7.ordering-ui.c4b4f29a4f0c8eaad874.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.ac159b0ec9eb4a80c944.js.LICENSE.txt → ordering-ui.c4b4f29a4f0c8eaad874.js.LICENSE.txt} +0 -0
|
@@ -20,14 +20,14 @@ const AddressDetailsUI = (props) => {
|
|
|
20
20
|
googleMapsUrl,
|
|
21
21
|
isCustomerMode,
|
|
22
22
|
apiKey,
|
|
23
|
-
isFromCheckout
|
|
23
|
+
isFromCheckout,
|
|
24
|
+
notUseCustomerInfo
|
|
24
25
|
} = props
|
|
25
26
|
|
|
26
27
|
const [orderState] = useOrder()
|
|
27
28
|
const [, t] = useLanguage()
|
|
28
29
|
const [openModal, setOpenModal] = useState(false)
|
|
29
30
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
30
|
-
const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
|
|
31
31
|
const [{ user }] = useCustomer()
|
|
32
32
|
|
|
33
33
|
const handleFindBusinesses = () => {
|
|
@@ -42,6 +42,12 @@ const AddressDetailsUI = (props) => {
|
|
|
42
42
|
return () => setOpenModal(false)
|
|
43
43
|
}, [])
|
|
44
44
|
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (isCustomerMode) {
|
|
47
|
+
setOpenModal(false)
|
|
48
|
+
}
|
|
49
|
+
}, [JSON.stringify(orderState?.options?.address?.address)])
|
|
50
|
+
|
|
45
51
|
return (
|
|
46
52
|
<>
|
|
47
53
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -75,7 +81,8 @@ const AddressDetailsUI = (props) => {
|
|
|
75
81
|
<AddressList
|
|
76
82
|
isModal
|
|
77
83
|
changeOrderAddressWithDefault
|
|
78
|
-
|
|
84
|
+
notUseCustomerInfo={notUseCustomerInfo}
|
|
85
|
+
userId={user?.id}
|
|
79
86
|
onCancel={() => setOpenModal(false)}
|
|
80
87
|
onAccept={() => handleFindBusinesses()}
|
|
81
88
|
userCustomerSetup={isCustomerMode && user}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
House,
|
|
9
9
|
GeoAlt
|
|
10
10
|
} from 'react-bootstrap-icons'
|
|
11
|
+
import { useTheme } from 'styled-components'
|
|
11
12
|
import { useForm } from 'react-hook-form'
|
|
12
13
|
import {
|
|
13
14
|
AddressForm as AddressFormController,
|
|
@@ -49,7 +50,9 @@ const AddressFormUI = (props) => {
|
|
|
49
50
|
userCustomerSetup,
|
|
50
51
|
businessesList,
|
|
51
52
|
getBusinessDeliveryZones,
|
|
52
|
-
isEnableContinueButton
|
|
53
|
+
isEnableContinueButton,
|
|
54
|
+
address,
|
|
55
|
+
notUseCustomerInfo
|
|
53
56
|
} = props
|
|
54
57
|
|
|
55
58
|
const [configState] = useConfig()
|
|
@@ -57,6 +60,7 @@ const AddressFormUI = (props) => {
|
|
|
57
60
|
const [, t] = useLanguage()
|
|
58
61
|
const formMethods = useForm()
|
|
59
62
|
const [{ auth }] = useSession()
|
|
63
|
+
const theme = useTheme()
|
|
60
64
|
|
|
61
65
|
const [state, setState] = useState({ selectedFromAutocomplete: true })
|
|
62
66
|
const [addressTag, setAddressTag] = useState(addressState?.address?.tag)
|
|
@@ -345,6 +349,12 @@ const AddressFormUI = (props) => {
|
|
|
345
349
|
})
|
|
346
350
|
}, [formMethods])
|
|
347
351
|
|
|
352
|
+
useEffect(() => {
|
|
353
|
+
if (address?.location) {
|
|
354
|
+
getBusinessDeliveryZones(address?.location)
|
|
355
|
+
}
|
|
356
|
+
}, [address])
|
|
357
|
+
|
|
348
358
|
return (
|
|
349
359
|
<div className='address-form'>
|
|
350
360
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -412,9 +422,9 @@ const AddressFormUI = (props) => {
|
|
|
412
422
|
</AddressWrap>
|
|
413
423
|
|
|
414
424
|
{locationChange && (addressState?.address?.location || formState?.changes?.location) && (
|
|
415
|
-
<WrapperMap isEnableContinueButton={isEnableContinueButton}>
|
|
425
|
+
<WrapperMap isEnableContinueButton={isEnableContinueButton} notUseCustomerInfo={notUseCustomerInfo}>
|
|
416
426
|
<GoogleMapsMap
|
|
417
|
-
|
|
427
|
+
useMapWithBusinessZones
|
|
418
428
|
deactiveAlerts
|
|
419
429
|
apiKey={googleMapsApiKey}
|
|
420
430
|
location={locationChange}
|
|
@@ -423,8 +433,9 @@ const AddressFormUI = (props) => {
|
|
|
423
433
|
mapControls={googleMapsControls}
|
|
424
434
|
handleChangeAddressMap={handleChangeAddress}
|
|
425
435
|
setErrors={setMapErrors}
|
|
426
|
-
maxLimitLocation={maxLimitLocation}
|
|
436
|
+
maxLimitLocation={parseInt(maxLimitLocation, 10)}
|
|
427
437
|
businessZones={businessesList?.businesses?.map(business => business?.zones)}
|
|
438
|
+
fallbackIcon={theme.images?.dummies?.businessLogo}
|
|
428
439
|
/>
|
|
429
440
|
</WrapperMap>
|
|
430
441
|
)}
|
|
@@ -201,8 +201,10 @@ export const WrapperMap = styled.div`
|
|
|
201
201
|
bottom: 2%;
|
|
202
202
|
right: 0;
|
|
203
203
|
padding-right: 20px;
|
|
204
|
-
${({ isEnableContinueButton }) => isEnableContinueButton ? css`
|
|
204
|
+
${({ isEnableContinueButton, notUseCustomerInfo }) => isEnableContinueButton ? css`
|
|
205
205
|
height: 460px;
|
|
206
|
+
` : notUseCustomerInfo ? css`
|
|
207
|
+
height: 370px;
|
|
206
208
|
` : css`
|
|
207
209
|
height: 480px;
|
|
208
210
|
`}
|
|
@@ -65,7 +65,9 @@ const AddressListUI = (props) => {
|
|
|
65
65
|
isFromCheckout,
|
|
66
66
|
isOpenUserData,
|
|
67
67
|
setIsAddressFormOpen,
|
|
68
|
-
isHeader
|
|
68
|
+
isHeader,
|
|
69
|
+
notUseCustomerInfo,
|
|
70
|
+
franchiseId
|
|
69
71
|
} = props
|
|
70
72
|
|
|
71
73
|
const [, t] = useLanguage()
|
|
@@ -199,7 +201,13 @@ const AddressListUI = (props) => {
|
|
|
199
201
|
<BeforeComponent key={i} {...props} />))}
|
|
200
202
|
<AddressListContainer id='address_control' isLoading={actionStatus?.loading || orderState?.loading}>
|
|
201
203
|
<AddressHalfContainer>
|
|
202
|
-
<List
|
|
204
|
+
<List
|
|
205
|
+
halfWidth={addressOpen}
|
|
206
|
+
isOpenUserData={isOpenUserData}
|
|
207
|
+
isHeader={isHeader}
|
|
208
|
+
isEnableContinueButton={isEnableContinueButton}
|
|
209
|
+
notUseCustomerInfo={notUseCustomerInfo}
|
|
210
|
+
>
|
|
203
211
|
{
|
|
204
212
|
(!isPopover || !addressOpen) && !isOpenUserData && (
|
|
205
213
|
<Button
|
|
@@ -310,11 +318,13 @@ const AddressListUI = (props) => {
|
|
|
310
318
|
onSaveAddress={handleSaveAddress}
|
|
311
319
|
userCustomerSetup={userCustomerSetup}
|
|
312
320
|
isEnableContinueButton={isEnableContinueButton}
|
|
321
|
+
notUseCustomerInfo={notUseCustomerInfo}
|
|
322
|
+
franchiseId={franchiseId}
|
|
313
323
|
/>
|
|
314
324
|
</AddressFormContainer>
|
|
315
325
|
)}
|
|
316
326
|
</List>
|
|
317
|
-
{addressOpen && (
|
|
327
|
+
{addressOpen && !notUseCustomerInfo && (
|
|
318
328
|
<AddressFormContainer width='50%' isEnableContinueButton={isEnableContinueButton}>
|
|
319
329
|
<TitleFormContainer>
|
|
320
330
|
<CloseIcon>
|
|
@@ -332,7 +342,7 @@ const AddressListUI = (props) => {
|
|
|
332
342
|
</AddressListUl>
|
|
333
343
|
)}
|
|
334
344
|
|
|
335
|
-
{onCancel && onAccept && typeof orderState.options?.address === 'object' && (
|
|
345
|
+
{onCancel && onAccept && typeof orderState.options?.address === 'object' && !notUseCustomerInfo && (
|
|
336
346
|
<FormActions>
|
|
337
347
|
<Button
|
|
338
348
|
outline
|
|
@@ -101,7 +101,7 @@ export const AddressItemActions = styled.div`
|
|
|
101
101
|
cursor: pointer;
|
|
102
102
|
margin: 0px 5px;
|
|
103
103
|
font-size: 20px;
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
svg {
|
|
106
106
|
color: #B1BCCC;
|
|
107
107
|
}
|
|
@@ -171,7 +171,7 @@ export const ContinueButton = styled.div`
|
|
|
171
171
|
width: 100%;
|
|
172
172
|
position: sticky;
|
|
173
173
|
bottom: 1px;
|
|
174
|
-
|
|
174
|
+
|
|
175
175
|
button {
|
|
176
176
|
width: 100%;
|
|
177
177
|
white-space: nowrap;
|
|
@@ -196,11 +196,11 @@ export const AddressHalfContainer = styled.div`
|
|
|
196
196
|
export const List = styled.div`
|
|
197
197
|
width: ${({ halfWidth }) => halfWidth ? '50%' : '100%'};
|
|
198
198
|
padding-right: 10px;
|
|
199
|
-
${({ isEnableContinueButton, isOpenUserData }) => isEnableContinueButton || isOpenUserData ? css`
|
|
199
|
+
${({ isEnableContinueButton, isOpenUserData, notUseCustomerInfo }) => isEnableContinueButton || isOpenUserData || notUseCustomerInfo ? css`
|
|
200
200
|
margin-top: 0px;
|
|
201
201
|
` : css`
|
|
202
202
|
margin-top: 222px;
|
|
203
|
-
`}
|
|
203
|
+
`}
|
|
204
204
|
button {
|
|
205
205
|
width: 100%;
|
|
206
206
|
}
|
|
@@ -228,7 +228,7 @@ export const CloseIcon = styled.div`
|
|
|
228
228
|
`
|
|
229
229
|
|
|
230
230
|
export const TitleFormContainer = styled.div`
|
|
231
|
-
display: flex;
|
|
231
|
+
display: flex;
|
|
232
232
|
align-items: center;
|
|
233
233
|
margin-top: 7px;
|
|
234
234
|
h1 {
|
|
@@ -34,10 +34,8 @@ import { OrderTypeSelectorHeader } from '../OrderTypeSelectorHeader'
|
|
|
34
34
|
import { CartContent } from '../CartContent'
|
|
35
35
|
import { Modal } from '../Modal'
|
|
36
36
|
import { MomentContent } from '../MomentContent'
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import { AddressList } from '../../../../five/src/components/AddressList'
|
|
40
|
-
import { AddressForm } from '../../../../five/src/components/AddressForm'
|
|
37
|
+
import { AddressList } from '../AddressList'
|
|
38
|
+
import { AddressForm } from '../AddressForm'
|
|
41
39
|
import { HeaderOption } from '../HeaderOption'
|
|
42
40
|
import { SidebarMenu } from '../SidebarMenu'
|
|
43
41
|
import { UserDetails } from '../UserDetails'
|
|
@@ -53,7 +51,8 @@ export const Header = (props) => {
|
|
|
53
51
|
isShowOrderOptions,
|
|
54
52
|
isHideSignup,
|
|
55
53
|
isCustomerMode,
|
|
56
|
-
isShowRedirectButton
|
|
54
|
+
isShowRedirectButton,
|
|
55
|
+
franchiseId
|
|
57
56
|
} = props
|
|
58
57
|
|
|
59
58
|
const { pathname } = useLocation()
|
|
@@ -397,6 +396,7 @@ export const Header = (props) => {
|
|
|
397
396
|
isModal
|
|
398
397
|
setIsOpenUserData={setIsOpenUserData}
|
|
399
398
|
onClose={() => setCustomerModalOpen(false)}
|
|
399
|
+
franchiseId={franchiseId}
|
|
400
400
|
/>
|
|
401
401
|
<AddressList
|
|
402
402
|
isModal
|
|
@@ -407,6 +407,7 @@ export const Header = (props) => {
|
|
|
407
407
|
setCustomerModalOpen={setCustomerModalOpen}
|
|
408
408
|
setIsOpenUserData={setIsOpenUserData}
|
|
409
409
|
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
410
|
+
franchiseId={franchiseId}
|
|
410
411
|
isHeader
|
|
411
412
|
/>
|
|
412
413
|
</>
|
|
@@ -403,7 +403,7 @@ const AddressFormUI = (props) => {
|
|
|
403
403
|
mapControls={googleMapsControls}
|
|
404
404
|
handleChangeAddressMap={handleChangeAddress}
|
|
405
405
|
setErrors={setMapErrors}
|
|
406
|
-
maxLimitLocation={maxLimitLocation}
|
|
406
|
+
maxLimitLocation={parseInt(maxLimitLocation, 10)}
|
|
407
407
|
/>
|
|
408
408
|
</WrapperMap>
|
|
409
409
|
)}
|
|
@@ -8,8 +8,10 @@ import {
|
|
|
8
8
|
useConfig
|
|
9
9
|
} from 'ordering-components-external'
|
|
10
10
|
import { useTheme } from 'styled-components'
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { Modal } from '../Modal'
|
|
12
|
+
import { SignUpForm } from '../SignUpForm'
|
|
13
|
+
import { Button } from '../../styles/Buttons'
|
|
14
|
+
import { Alert } from '../Confirm'
|
|
13
15
|
import { AddressList } from '../AddressList'
|
|
14
16
|
import { UserDetails } from '../UserDetails'
|
|
15
17
|
|
|
@@ -27,7 +29,8 @@ import {
|
|
|
27
29
|
AdditionalTypesContainer,
|
|
28
30
|
PhoneAutocompleteContainer,
|
|
29
31
|
ImageWrapper,
|
|
30
|
-
ContinueButton
|
|
32
|
+
ContinueButton,
|
|
33
|
+
NotFoundUser
|
|
31
34
|
} from './styles'
|
|
32
35
|
|
|
33
36
|
import MdcCellphoneAndroid from '@meronex/icons/mdc/MdcCellphoneAndroid'
|
|
@@ -47,7 +50,10 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
47
50
|
onRedirectPage,
|
|
48
51
|
urlPhone,
|
|
49
52
|
orderTypes,
|
|
50
|
-
localPhoneCode
|
|
53
|
+
localPhoneCode,
|
|
54
|
+
isFromUrlPhone,
|
|
55
|
+
onRedirectPhoneUrlPage
|
|
56
|
+
|
|
51
57
|
} = props
|
|
52
58
|
const allOrderTypes = [1, 2, 3, 4, 5]
|
|
53
59
|
const pickupTypes = [2, 3, 4, 5]
|
|
@@ -76,7 +82,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
76
82
|
const saveCustomerUser = (user) => {
|
|
77
83
|
setCustomersPhones({ ...customersPhones, users: [...customersPhones.users, user] })
|
|
78
84
|
setCustomerState({ ...customerState, result: user })
|
|
79
|
-
setOpenModal({ customer: true, signup: false })
|
|
85
|
+
setOpenModal({ ...openModal, customer: true, signup: false })
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
const handleFindClick = () => {
|
|
@@ -120,14 +126,19 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
120
126
|
const onChange = (option) => {
|
|
121
127
|
setOptSelected(option)
|
|
122
128
|
setInputValue(option ? option?.value : '')
|
|
123
|
-
if (!option) {
|
|
129
|
+
if (!option) {
|
|
130
|
+
onChangeNumber('')
|
|
131
|
+
if (isFromUrlPhone) {
|
|
132
|
+
onRedirectPhoneUrlPage && onRedirectPhoneUrlPage('home')
|
|
133
|
+
}
|
|
134
|
+
return
|
|
135
|
+
}
|
|
124
136
|
const user = customersPhones.users?.find(user => user.cellphone === option?.value || user.phone === option?.value)
|
|
125
137
|
if (user) {
|
|
126
138
|
setCustomerState({ ...customerState, result: user })
|
|
127
|
-
setOpenModal({ signup: false, customer: true })
|
|
139
|
+
setOpenModal({ ...openModal, signup: false, customer: true })
|
|
128
140
|
} else {
|
|
129
|
-
|
|
130
|
-
setOpenModal({ customer: false, signup: true })
|
|
141
|
+
setOpenModal({ ...openModal, error: true })
|
|
131
142
|
}
|
|
132
143
|
}
|
|
133
144
|
|
|
@@ -146,6 +157,9 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
146
157
|
setOpenModal({ ...openModal, customer: false })
|
|
147
158
|
setCustomerState({ ...customerState, result: { error: false } })
|
|
148
159
|
deleteUserCustomer(true)
|
|
160
|
+
if (isFromUrlPhone) {
|
|
161
|
+
onRedirectPhoneUrlPage && onRedirectPhoneUrlPage('home')
|
|
162
|
+
}
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
const handleChangeToPickup = () => {
|
|
@@ -162,10 +176,14 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
162
176
|
}) || []
|
|
163
177
|
|
|
164
178
|
useEffect(() => {
|
|
179
|
+
if (customersPhones?.loading) return
|
|
180
|
+
if (!urlPhone && isFromUrlPhone) {
|
|
181
|
+
onRedirectPhoneUrlPage && onRedirectPhoneUrlPage('home')
|
|
182
|
+
}
|
|
165
183
|
if (!urlPhone) return
|
|
166
184
|
onInputChange(urlPhone, { action: 'url' })
|
|
167
185
|
onChange({ value: urlPhone, label: urlPhone })
|
|
168
|
-
}, [urlPhone, customersPhones?.
|
|
186
|
+
}, [urlPhone, customersPhones?.loading])
|
|
169
187
|
|
|
170
188
|
useEffect(() => {
|
|
171
189
|
if (pickupTypes.includes(orderState?.options?.type)) {
|
|
@@ -310,7 +328,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
310
328
|
padding='20px'
|
|
311
329
|
>
|
|
312
330
|
<UserEdit>
|
|
313
|
-
{!customerState?.loading && (
|
|
331
|
+
{!customerState?.loading && !customersPhones?.loading && (
|
|
314
332
|
<>
|
|
315
333
|
<UserDetails
|
|
316
334
|
isAddressFormOpen={isAddressFormOpen}
|
|
@@ -340,6 +358,16 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
340
358
|
)}
|
|
341
359
|
</UserEdit>
|
|
342
360
|
</Modal>
|
|
361
|
+
<Modal
|
|
362
|
+
open={openModal.error}
|
|
363
|
+
width='50%'
|
|
364
|
+
onClose={() => handleCloseAddressList()}
|
|
365
|
+
padding='20px'
|
|
366
|
+
>
|
|
367
|
+
<NotFoundUser>
|
|
368
|
+
<h2>{t('NO_USER_FOUND', 'No user found')}</h2>
|
|
369
|
+
</NotFoundUser>
|
|
370
|
+
</Modal>
|
|
343
371
|
<Alert
|
|
344
372
|
title={t('ERROR', 'Error')}
|
|
345
373
|
open={alertState.open}
|
|
@@ -201,7 +201,7 @@ export const WrapInput = styled.div`
|
|
|
201
201
|
width: calc(50% - 20px);
|
|
202
202
|
}
|
|
203
203
|
`}
|
|
204
|
-
|
|
204
|
+
|
|
205
205
|
div{
|
|
206
206
|
color: #FFF;
|
|
207
207
|
position: relative;
|
|
@@ -234,7 +234,7 @@ export const WrapInput = styled.div`
|
|
|
234
234
|
`
|
|
235
235
|
|
|
236
236
|
export const AutoComplete = styled.div`
|
|
237
|
-
width: 45%;
|
|
237
|
+
width: 45%;
|
|
238
238
|
button {
|
|
239
239
|
position: absolute;
|
|
240
240
|
left: 100%;
|
|
@@ -244,7 +244,7 @@ export const AutoComplete = styled.div`
|
|
|
244
244
|
|
|
245
245
|
export const UserEdit = styled.div`
|
|
246
246
|
> :first-child{
|
|
247
|
-
margin-bottom: 20px;
|
|
247
|
+
margin-bottom: 20px;
|
|
248
248
|
}
|
|
249
249
|
`
|
|
250
250
|
|
|
@@ -394,8 +394,13 @@ export const ContinueButton = styled.span`
|
|
|
394
394
|
position: absolute;
|
|
395
395
|
right: 35px;
|
|
396
396
|
bottom: 5px;
|
|
397
|
-
width:
|
|
397
|
+
width:
|
|
398
398
|
button {
|
|
399
399
|
cursor: pointer;
|
|
400
400
|
}
|
|
401
401
|
`
|
|
402
|
+
|
|
403
|
+
export const NotFoundUser = styled.div`
|
|
404
|
+
margin: 70px 0px;
|
|
405
|
+
text-align: center;
|
|
406
|
+
`
|