ordering-ui-external 14.1.49 → 14.1.52
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/{7.ordering-ui.697d19ddfcc29dfbeb52.js → 7.ordering-ui.746cebc54de638e8e528.js} +1 -1
- package/_bundles/ordering-ui.746cebc54de638e8e528.js +2 -0
- package/_modules/components/GoogleGpsButton/index.js +11 -3
- package/_modules/components/VerticalOrdersLayout/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/index.js +7 -0
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +22 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +10 -7
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +59 -19
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +10 -4
- package/_modules/themes/callcenterOriginal/src/components/ConfirmAddressForm/index.js +638 -0
- package/_modules/themes/callcenterOriginal/src/components/ConfirmAddressForm/styles.js +50 -0
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +33 -4
- package/_modules/themes/callcenterOriginal/src/components/InputPhoneNumber/index.js +17 -10
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +58 -106
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +6 -29
- package/_modules/themes/callcenterOriginal/src/components/SearchBar/index.js +2 -2
- package/_modules/themes/callcenterOriginal/src/components/SignUpForm/index.js +21 -1
- package/_modules/themes/callcenterOriginal/src/components/UserDetails/index.js +49 -8
- package/_modules/themes/callcenterOriginal/src/components/UserDetails/styles.js +12 -9
- package/_modules/themes/callcenterOriginal/src/components/UserFormDetails/index.js +30 -12
- package/_modules/themes/callcenterOriginal/src/components/UserFormDetails/styles.js +11 -5
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessController/franchises/OloBusinessController/index.js +192 -0
- package/_modules/themes/five/src/components/BusinessController/franchises/OloBusinessController/styles.js +114 -0
- package/_modules/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/index.js +572 -0
- package/_modules/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/styles.js +89 -0
- package/_modules/themes/five/src/components/BusinessesListing/index.js +6 -2
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +31 -118
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/OrderDetail.js +1 -3
- package/_modules/themes/five/src/components/Checkout/index.js +22 -4
- package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +8 -7
- package/_modules/themes/five/src/components/Header/styles.js +28 -25
- package/_modules/themes/five/src/components/HighestRated/franchises/OloHighestRated/index.js +116 -0
- package/_modules/themes/five/src/components/HighestRated/franchises/OloHighestRated/styles.js +22 -0
- package/_modules/themes/five/src/components/HomeHero/franchises/OloHomeHero/index.js +136 -0
- package/_modules/themes/five/src/components/HomeHero/franchises/OloHomeHero/styles.js +46 -0
- package/_modules/themes/five/src/components/HomeHero/index.js +5 -2
- package/_modules/themes/five/src/components/InputPhoneNumber/index.js +19 -12
- package/_modules/themes/five/src/components/LogoutPopup/index.js +2 -1
- package/_modules/themes/five/src/components/Modal/index.js +6 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +2 -2
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +2 -1
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderTypesSquares/index.js +160 -0
- package/_modules/themes/five/src/components/OrderTypesSquares/styles.js +39 -0
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +4 -4
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/SearchBar/index.js +2 -2
- package/_modules/themes/five/src/components/SignUpForm/index.js +11 -8
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/index.js +5 -2
- package/_modules/themes/five/src/styles/Buttons/index.js +1 -1
- package/index-template.js +9 -1
- package/package.json +2 -2
- package/src/components/GoogleGpsButton/index.js +10 -2
- package/src/components/VerticalOrdersLayout/styles.js +2 -2
- package/src/themes/callcenterOriginal/index.js +2 -0
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +44 -23
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +8 -0
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +67 -22
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +16 -1
- package/src/themes/callcenterOriginal/src/components/ConfirmAddressForm/index.js +579 -0
- package/src/themes/callcenterOriginal/src/components/ConfirmAddressForm/styles.js +275 -0
- package/src/themes/callcenterOriginal/src/components/Header/index.js +22 -0
- package/src/themes/callcenterOriginal/src/components/InputPhoneNumber/index.js +13 -8
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +34 -100
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +0 -52
- package/src/themes/callcenterOriginal/src/components/SearchBar/index.js +2 -2
- package/src/themes/callcenterOriginal/src/components/SignUpForm/index.js +19 -1
- package/src/themes/callcenterOriginal/src/components/UserDetails/index.js +45 -11
- package/src/themes/callcenterOriginal/src/components/UserDetails/styles.js +3 -1
- package/src/themes/callcenterOriginal/src/components/UserFormDetails/index.js +40 -14
- package/src/themes/callcenterOriginal/src/components/UserFormDetails/styles.js +19 -1
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
- package/src/themes/five/src/components/BusinessController/franchises/OloBusinessController/index.js +237 -0
- package/src/themes/five/src/components/BusinessController/franchises/OloBusinessController/styles.js +367 -0
- package/src/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/index.js +582 -0
- package/src/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/styles.js +307 -0
- package/src/themes/five/src/components/BusinessesListing/index.js +19 -4
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +7 -104
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -2
- package/src/themes/five/src/components/Checkout/OrderDetail.js +1 -5
- package/src/themes/five/src/components/Checkout/index.js +20 -2
- package/src/themes/five/src/components/DriverTips/styles.js +1 -0
- package/src/themes/five/src/components/Header/index.js +17 -12
- package/src/themes/five/src/components/Header/styles.js +51 -4
- package/src/themes/five/src/components/HighestRated/franchises/OloHighestRated/index.js +114 -0
- package/src/themes/five/src/components/HighestRated/franchises/OloHighestRated/styles.js +57 -0
- package/src/themes/five/src/components/HomeHero/franchises/OloHomeHero/index.js +122 -0
- package/src/themes/five/src/components/HomeHero/franchises/OloHomeHero/styles.js +125 -0
- package/src/themes/five/src/components/HomeHero/index.js +16 -3
- package/src/themes/five/src/components/InputPhoneNumber/index.js +14 -9
- package/src/themes/five/src/components/LogoutPopup/index.js +3 -1
- package/src/themes/five/src/components/Modal/index.js +6 -3
- package/src/themes/five/src/components/MultiOrdersDetails/styles.js +3 -3
- package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +3 -1
- package/src/themes/five/src/components/OrderItAgain/styles.js +2 -0
- package/src/themes/five/src/components/OrderTypesSquares/index.js +157 -0
- package/src/themes/five/src/components/OrderTypesSquares/styles.js +62 -0
- package/src/themes/five/src/components/ProductItemAccordion/index.js +2 -2
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +2 -0
- package/src/themes/five/src/components/SearchBar/index.js +2 -2
- package/src/themes/five/src/components/SignUpForm/index.js +5 -3
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
- package/src/themes/five/src/components/UserDetails/index.js +3 -1
- package/src/themes/five/src/styles/Buttons/index.js +2 -2
- package/template/app.js +14 -11
- package/template/assets/images/catering.svg +13 -0
- package/template/assets/images/curbside.svg +19 -0
- package/template/assets/images/drivethru.svg +19 -0
- package/template/assets/images/eatin.svg +17 -0
- package/template/components/SubdomainComponent/index.js +4 -8
- package/template/pages/BusinessesList/index.js +1 -1
- package/_bundles/ordering-ui.697d19ddfcc29dfbeb52.js +0 -2
- /package/_bundles/{0.ordering-ui.697d19ddfcc29dfbeb52.js → 0.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{1.ordering-ui.697d19ddfcc29dfbeb52.js → 1.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{2.ordering-ui.697d19ddfcc29dfbeb52.js → 2.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{4.ordering-ui.697d19ddfcc29dfbeb52.js → 4.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{5.ordering-ui.697d19ddfcc29dfbeb52.js → 5.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{6.ordering-ui.697d19ddfcc29dfbeb52.js → 6.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{7.ordering-ui.697d19ddfcc29dfbeb52.js.LICENSE.txt → 7.ordering-ui.746cebc54de638e8e528.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.697d19ddfcc29dfbeb52.js → 8.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{9.ordering-ui.697d19ddfcc29dfbeb52.js → 9.ordering-ui.746cebc54de638e8e528.js} +0 -0
- /package/_bundles/{ordering-ui.697d19ddfcc29dfbeb52.js.LICENSE.txt → ordering-ui.746cebc54de638e8e528.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.52",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"lodash": "^4.17.19",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"nanoid": "^4.0.0",
|
|
91
|
-
"ordering-components-external": "13.0.
|
|
91
|
+
"ordering-components-external": "13.0.43",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
2
|
import { GoogleGpsButton as GpsButton } from 'ordering-components-external'
|
|
3
3
|
import { GpsButtonStyle } from './styles'
|
|
4
4
|
|
|
@@ -9,9 +9,17 @@ const GoogleGpsButtonUI = (props) => {
|
|
|
9
9
|
googleReady,
|
|
10
10
|
isLoading,
|
|
11
11
|
IconButton,
|
|
12
|
-
IconLoadingButton
|
|
12
|
+
IconLoadingButton,
|
|
13
|
+
geolocationState,
|
|
14
|
+
enableAutoGeolocation,
|
|
15
|
+
location
|
|
13
16
|
} = props
|
|
14
17
|
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (geolocationState?.result === 'OK' || location || !enableAutoGeolocation) return
|
|
20
|
+
handleGPS()
|
|
21
|
+
}, [geolocationState?.result, isGoogleButton, googleReady, location])
|
|
22
|
+
|
|
15
23
|
return (
|
|
16
24
|
<GpsButtonStyle
|
|
17
25
|
className={props.className || ''}
|
|
@@ -23,6 +23,7 @@ import { CardForm } from './src/components/CardForm'
|
|
|
23
23
|
import { Cart } from './src/components/Cart'
|
|
24
24
|
import { CartContent } from './src/components/CartContent'
|
|
25
25
|
import { CartPopover } from './src/components/CartPopover'
|
|
26
|
+
import { ConfirmAddressForm } from './src/components/ConfirmAddressForm'
|
|
26
27
|
import { Checkout } from './src/components/Checkout'
|
|
27
28
|
import { DriverTips } from './src/components/DriverTips'
|
|
28
29
|
import { Footer } from './src/components/Footer'
|
|
@@ -103,6 +104,7 @@ export {
|
|
|
103
104
|
CartContent,
|
|
104
105
|
CartPopover,
|
|
105
106
|
Checkout,
|
|
107
|
+
ConfirmAddressForm,
|
|
106
108
|
DriverTips,
|
|
107
109
|
Footer,
|
|
108
110
|
ForgotPasswordForm,
|
|
@@ -293,6 +293,11 @@ const AddressFormUI = (props) => {
|
|
|
293
293
|
window.open(url, '_blank')
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
const handleSendSmsToCustomer = () => {
|
|
297
|
+
setUserConfirmPhone({ ...userConfirmPhone, open: true })
|
|
298
|
+
onCancel()
|
|
299
|
+
}
|
|
300
|
+
|
|
296
301
|
useEffect(() => {
|
|
297
302
|
if (!auth) {
|
|
298
303
|
setLocationChange(formState?.changes?.location ?? orderState?.options?.address?.location ?? '')
|
|
@@ -466,9 +471,9 @@ const AddressFormUI = (props) => {
|
|
|
466
471
|
googleInputRef.current = ref
|
|
467
472
|
}}
|
|
468
473
|
defaultValue={
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
474
|
+
formState?.result?.result
|
|
475
|
+
? formState?.result?.result?.address
|
|
476
|
+
: formState?.changes?.address ?? addressValue
|
|
472
477
|
}
|
|
473
478
|
autoComplete='new-field'
|
|
474
479
|
countryCode={configState?.configs?.country_autocomplete?.value || '*'}
|
|
@@ -476,6 +481,21 @@ const AddressFormUI = (props) => {
|
|
|
476
481
|
</WrapAddressInput>
|
|
477
482
|
</AddressWrap>
|
|
478
483
|
)}
|
|
484
|
+
{!(addressState?.address?.location || formState?.changes?.location) && (
|
|
485
|
+
<WrapperMap showTabs={showTabs}>
|
|
486
|
+
<SmsClient>
|
|
487
|
+
<p>
|
|
488
|
+
{t('CAN_NOT_FIND_ADDRESS', 'Can\'t find address?')}{' '}
|
|
489
|
+
</p>
|
|
490
|
+
<a
|
|
491
|
+
style={{ textDecoration: 'underline', color: theme?.colors?.primary, cursor: 'pointer' }}
|
|
492
|
+
onClick={() => handleSendSmsToCustomer()}
|
|
493
|
+
>
|
|
494
|
+
{t('SEND_SMS_TO_CUSTOMER', 'Send SMS to customer')}
|
|
495
|
+
</a>
|
|
496
|
+
</SmsClient>
|
|
497
|
+
</WrapperMap>
|
|
498
|
+
)}
|
|
479
499
|
{(addressState?.address?.location || formState?.changes?.location) && (
|
|
480
500
|
<WrapperMap
|
|
481
501
|
showMap={showMap || !showSpreadForm}
|
|
@@ -483,6 +503,7 @@ const AddressFormUI = (props) => {
|
|
|
483
503
|
addFormRestrictions={addFormRestrictions}
|
|
484
504
|
showTabs={showTabs}
|
|
485
505
|
>
|
|
506
|
+
|
|
486
507
|
{!showMap && (
|
|
487
508
|
<section>
|
|
488
509
|
<GeoAlt style={{ fontSize: 25, marginRight: 5 }} />
|
|
@@ -619,26 +640,26 @@ const AddressFormUI = (props) => {
|
|
|
619
640
|
address?.address &&
|
|
620
641
|
(!address?.location?.lat || !address?.location?.lng)) &&
|
|
621
642
|
Object.keys(formState?.changes).length > 0 &&
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
643
|
+
(
|
|
644
|
+
<Button
|
|
645
|
+
id='submit-btn'
|
|
646
|
+
type='submit'
|
|
647
|
+
disabled={formState.loading}
|
|
648
|
+
color='primary'
|
|
649
|
+
>
|
|
650
|
+
{!formState.loading ? (
|
|
651
|
+
<>
|
|
652
|
+
{
|
|
653
|
+
isEditing || (!auth && orderState.options?.address?.address)
|
|
654
|
+
? t('SAVE_AND_CONTINUE', 'Save and continue')
|
|
655
|
+
: t('ADD_ADDRESS', 'Add address')
|
|
656
|
+
}
|
|
657
|
+
</>
|
|
658
|
+
) : (
|
|
659
|
+
t('LOADING', 'Loading')
|
|
660
|
+
)}
|
|
661
|
+
</Button>
|
|
662
|
+
)}
|
|
642
663
|
</FormActions>
|
|
643
664
|
{isAllowUnaddressOrderType && (
|
|
644
665
|
<WithoutAddressContainer>
|
|
@@ -245,6 +245,14 @@ export const AddressMarkContainer = styled.div`
|
|
|
245
245
|
color: #664D03;
|
|
246
246
|
font-size: 12px;
|
|
247
247
|
}
|
|
248
|
+
|
|
249
|
+
${({ blue }) => blue && css`
|
|
250
|
+
background-color: #CFF4FC;
|
|
251
|
+
border: 1px solid #9EEAF9;
|
|
252
|
+
p {
|
|
253
|
+
color: #055160;
|
|
254
|
+
}
|
|
255
|
+
`}
|
|
248
256
|
`
|
|
249
257
|
|
|
250
258
|
export const StreetViewText = styled.span`
|
|
@@ -39,7 +39,9 @@ import {
|
|
|
39
39
|
AddressBookMark,
|
|
40
40
|
AddressBookMarkContainer,
|
|
41
41
|
AddressTitleContainer,
|
|
42
|
-
WithoutAddressText
|
|
42
|
+
WithoutAddressText,
|
|
43
|
+
WrapperSMS,
|
|
44
|
+
ButtonsContainer
|
|
43
45
|
} from './styles'
|
|
44
46
|
|
|
45
47
|
import { NotFoundSource } from '../NotFoundSource'
|
|
@@ -92,7 +94,10 @@ const AddressListUI = (props) => {
|
|
|
92
94
|
notUseCustomerInfo,
|
|
93
95
|
franchiseId,
|
|
94
96
|
setIsSavedAddress,
|
|
95
|
-
isFromPhoneAutocomplete
|
|
97
|
+
isFromPhoneAutocomplete,
|
|
98
|
+
setUserConfirmPhone,
|
|
99
|
+
userConfirmPhone,
|
|
100
|
+
disabledSms
|
|
96
101
|
} = props
|
|
97
102
|
|
|
98
103
|
const [, t] = useLanguage()
|
|
@@ -101,7 +106,7 @@ const AddressListUI = (props) => {
|
|
|
101
106
|
const [{ configs }] = useConfig()
|
|
102
107
|
const [curAddress, setCurAddress] = useState(false)
|
|
103
108
|
const [addressOpen, setAddressOpen] = useState(false)
|
|
104
|
-
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
109
|
+
const [confirm, setConfirm] = useState({ open: false, title: null, content: null, handleOnAccept: null, handleOnCancel: null })
|
|
105
110
|
const theme = useTheme()
|
|
106
111
|
const [{ user }] = useCustomer()
|
|
107
112
|
const [addressSpreadForm, setAddressSpreadForm] = useState(null)
|
|
@@ -156,7 +161,7 @@ const AddressListUI = (props) => {
|
|
|
156
161
|
handleCloseAddressForm()
|
|
157
162
|
}
|
|
158
163
|
|
|
159
|
-
const handleSetAddress = (address) => {
|
|
164
|
+
const handleSetAddress = (address, options) => {
|
|
160
165
|
if (
|
|
161
166
|
checkAddress(address) &&
|
|
162
167
|
isCustomerMode &&
|
|
@@ -179,7 +184,7 @@ const AddressListUI = (props) => {
|
|
|
179
184
|
openAddress(address)
|
|
180
185
|
return
|
|
181
186
|
}
|
|
182
|
-
setIsSavedAddress && setIsSavedAddress(true)
|
|
187
|
+
(!options?.avoidRedirect && setIsSavedAddress) && setIsSavedAddress(true)
|
|
183
188
|
handleCloseAddressForm()
|
|
184
189
|
handleSetDefault(address, userCustomerSetup)
|
|
185
190
|
}
|
|
@@ -222,6 +227,10 @@ const AddressListUI = (props) => {
|
|
|
222
227
|
setEditSpreadAddress(false)
|
|
223
228
|
}
|
|
224
229
|
|
|
230
|
+
const handleOnCancel = () => {
|
|
231
|
+
setConfirm({ ...confirm, open: false })
|
|
232
|
+
}
|
|
233
|
+
|
|
225
234
|
/**
|
|
226
235
|
* Close modals and alerts
|
|
227
236
|
*/
|
|
@@ -250,6 +259,18 @@ const AddressListUI = (props) => {
|
|
|
250
259
|
}
|
|
251
260
|
}, [userCustomerSetup?.imported_address_text, addressList.addresses, addressList?.loading, addressList?.error, isOpenUserData])
|
|
252
261
|
|
|
262
|
+
useEffect(() => {
|
|
263
|
+
if (!addressList?.addedBySocket) return
|
|
264
|
+
setConfirm({
|
|
265
|
+
open: true,
|
|
266
|
+
title: t('NEW_ADDRESS_REGISTERED', 'New address registered'),
|
|
267
|
+
content: t('NEW_ADDRESS_REGISTERED_CONTENT', 'The user has sent the address'),
|
|
268
|
+
handleOnAccept: () => setConfirm({ ...confirm, open: false }),
|
|
269
|
+
handleOnCancel: ''
|
|
270
|
+
})
|
|
271
|
+
handleSetAddress(addressList?.addresses[addressList?.addresses?.length - 1], { avoidRedirect: true })
|
|
272
|
+
}, [addressList?.addedBySocket])
|
|
273
|
+
|
|
253
274
|
return (
|
|
254
275
|
<AddressListContainer id='address_control' isLoading={actionStatus?.loading || orderState?.loading}>
|
|
255
276
|
<AddressHalfContainer>
|
|
@@ -260,20 +281,37 @@ const AddressListUI = (props) => {
|
|
|
260
281
|
notUseCustomerInfo={notUseCustomerInfo}
|
|
261
282
|
addFormRestrictions={addFormRestrictions}
|
|
262
283
|
>
|
|
263
|
-
{
|
|
264
|
-
|
|
265
|
-
<
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
284
|
+
{!addFormRestrictions && !addressOpen && !isOpenUserData && (
|
|
285
|
+
<>
|
|
286
|
+
<ButtonsContainer>
|
|
287
|
+
<Button
|
|
288
|
+
className='add'
|
|
289
|
+
outline
|
|
290
|
+
color={addressList?.addresses?.length > 0 ? 'secondary' : 'primary'}
|
|
291
|
+
onClick={() => openAddress({})}
|
|
292
|
+
disabled={orderState?.loading || actionStatus.loading}
|
|
293
|
+
hoverColor='#CCC'
|
|
294
|
+
>
|
|
295
|
+
{(orderState?.loading || actionStatus.loading) ? t('LOADING', 'Loading') : t('ADD_NEW_ADDRESS', 'Add New Address')}
|
|
296
|
+
</Button>
|
|
297
|
+
<Button
|
|
298
|
+
className='add sms'
|
|
299
|
+
color={disabledSms ? 'secondary' : 'primary'}
|
|
300
|
+
onClick={() => setUserConfirmPhone({ open: true, result: null })}
|
|
301
|
+
disabled={orderState?.loading || actionStatus.loading || disabledSms}
|
|
302
|
+
>
|
|
303
|
+
{t('SEND_SMS_TO_CLIENT', 'Send SMS to client')}
|
|
304
|
+
</Button>
|
|
305
|
+
</ButtonsContainer>
|
|
306
|
+
{(userConfirmPhone?.result) && (
|
|
307
|
+
<WrapperSMS>
|
|
308
|
+
<p>
|
|
309
|
+
{userConfirmPhone?.result}
|
|
310
|
+
</p>
|
|
311
|
+
</WrapperSMS>
|
|
312
|
+
)}
|
|
313
|
+
</>
|
|
314
|
+
)}
|
|
277
315
|
{
|
|
278
316
|
isPopover && addressOpen && (
|
|
279
317
|
<AddressForm
|
|
@@ -291,6 +329,8 @@ const AddressListUI = (props) => {
|
|
|
291
329
|
onSaveAddress={handleSaveAddress}
|
|
292
330
|
userCustomerSetup={userCustomerSetup}
|
|
293
331
|
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
332
|
+
userConfirmPhone={userConfirmPhone}
|
|
333
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
294
334
|
/>
|
|
295
335
|
)
|
|
296
336
|
}
|
|
@@ -308,9 +348,10 @@ const AddressListUI = (props) => {
|
|
|
308
348
|
<AddressListUl id='list'>
|
|
309
349
|
<AddressTitleContainer style={{ display: 'flex' }}>
|
|
310
350
|
<AddressTitle>{t('SELECT_ONE_OF_SAVED_PLACES', 'Select one of your saved places')}</AddressTitle>
|
|
351
|
+
|
|
311
352
|
{isAllowUnaddressOrderType && (
|
|
312
353
|
<>
|
|
313
|
-
<
|
|
354
|
+
<span>{' '}{t('OR', 'or')}{' '}</span>
|
|
314
355
|
<WithoutAddressText onClick={() => events.emit('go_to_page', { page: 'search' })}>{t('CONTINUE_WITHOUT_ADDRESS', 'Continue without address')}</WithoutAddressText>
|
|
315
356
|
</>
|
|
316
357
|
)}
|
|
@@ -399,6 +440,8 @@ const AddressListUI = (props) => {
|
|
|
399
440
|
franchiseId={franchiseId}
|
|
400
441
|
addFormRestrictions={addFormRestrictions}
|
|
401
442
|
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
443
|
+
userConfirmPhone={userConfirmPhone}
|
|
444
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
402
445
|
/>
|
|
403
446
|
</AddressFormContainer>
|
|
404
447
|
)}
|
|
@@ -480,17 +523,19 @@ const AddressListUI = (props) => {
|
|
|
480
523
|
onSaveAddress={handleSaveAddress}
|
|
481
524
|
userCustomerSetup={userCustomerSetup}
|
|
482
525
|
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
526
|
+
userConfirmPhone={userConfirmPhone}
|
|
527
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
483
528
|
/>
|
|
484
529
|
</Modal>
|
|
485
530
|
)
|
|
486
531
|
}
|
|
487
532
|
<Confirm
|
|
488
|
-
title={t('SEARCH', 'Search')}
|
|
533
|
+
title={confirm.title || t('SEARCH', 'Search')}
|
|
489
534
|
content={confirm.content}
|
|
490
535
|
acceptText={t('ACCEPT', 'Accept')}
|
|
491
536
|
open={confirm.open}
|
|
492
537
|
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
493
|
-
onCancel={
|
|
538
|
+
onCancel={confirm.handleOnCancel ?? handleOnCancel}
|
|
494
539
|
onAccept={confirm.handleOnAccept}
|
|
495
540
|
closeOnBackdrop={false}
|
|
496
541
|
/>
|
|
@@ -291,8 +291,23 @@ export const AddressTitleContainer = styled.div`
|
|
|
291
291
|
white-space: break-spaces;
|
|
292
292
|
`
|
|
293
293
|
|
|
294
|
-
export const WithoutAddressText = styled.
|
|
294
|
+
export const WithoutAddressText = styled.span`
|
|
295
295
|
text-decoration: underline;
|
|
296
296
|
color: ${({ theme }) => theme?.colors?.primary};
|
|
297
297
|
cursor: pointer;
|
|
298
298
|
`
|
|
299
|
+
|
|
300
|
+
export const WrapperSMS = styled.div`
|
|
301
|
+
margin-top: 20px;
|
|
302
|
+
p {
|
|
303
|
+
color: ${({ theme }) => theme?.colors?.primary}
|
|
304
|
+
}
|
|
305
|
+
`
|
|
306
|
+
|
|
307
|
+
export const ButtonsContainer = styled.div`
|
|
308
|
+
display: flex;
|
|
309
|
+
justify-content: space-between;
|
|
310
|
+
.sms{
|
|
311
|
+
margin-left: 20px;
|
|
312
|
+
}
|
|
313
|
+
`
|