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
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
import { darken } from 'polished'
|
|
3
|
+
|
|
4
|
+
export const FormActions = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
width: 100%;
|
|
8
|
+
button {
|
|
9
|
+
height: 44px;
|
|
10
|
+
width: 100%;
|
|
11
|
+
text-transform: lowercase;
|
|
12
|
+
&:first-letter {
|
|
13
|
+
text-transform: uppercase;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const FormControl = styled.form`
|
|
19
|
+
padding: 0px;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
|
|
24
|
+
input {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
margin: 10px 0px;
|
|
27
|
+
height: 50px;
|
|
28
|
+
width: 100%;
|
|
29
|
+
&.internal_number,
|
|
30
|
+
&.zipcode {
|
|
31
|
+
flex: auto;
|
|
32
|
+
}
|
|
33
|
+
&::placeholder{
|
|
34
|
+
color: #CBCBCB
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
textarea {
|
|
39
|
+
width: 100%;
|
|
40
|
+
margin: 10px 0;
|
|
41
|
+
border-radius: 7.6px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.input-autocomplete {
|
|
45
|
+
width: 100%;
|
|
46
|
+
background: #FFF;
|
|
47
|
+
border: 1px solid #BBB;
|
|
48
|
+
border-radius: 30px;
|
|
49
|
+
font-size: 16px;
|
|
50
|
+
padding: 7px 15px !important;
|
|
51
|
+
height: 50px;
|
|
52
|
+
outline: none;
|
|
53
|
+
::placeholder {
|
|
54
|
+
color: #DBDCDB;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:-ms-input-placeholder {
|
|
58
|
+
color: #DBDCDB;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&::-ms-input-placeholder { /* Microsoft Edge */
|
|
62
|
+
color: #DBDCDB;
|
|
63
|
+
}
|
|
64
|
+
&:focus {
|
|
65
|
+
border-color: ${() => darken(0.07, '#CCC')};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.google-control {
|
|
70
|
+
.gps-button {
|
|
71
|
+
border-radius: 7.6px;
|
|
72
|
+
width: auto;
|
|
73
|
+
min-width: 30px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
input {
|
|
77
|
+
border-radius: 7.6px;
|
|
78
|
+
border: 1px solid ${props => props.theme.colors.primary};
|
|
79
|
+
|
|
80
|
+
&:focus {
|
|
81
|
+
border: 1px solid ${props => props.theme.colors.primary};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.internal_number {
|
|
87
|
+
width: 45%;
|
|
88
|
+
${props => props.theme?.rtl ? css`
|
|
89
|
+
margin-left: 15px;
|
|
90
|
+
` : css`
|
|
91
|
+
margin-right: 15px;
|
|
92
|
+
`}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.zipcode {
|
|
96
|
+
width: 45%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (min-width: 481px) {
|
|
100
|
+
padding: 10px;
|
|
101
|
+
}
|
|
102
|
+
`
|
|
103
|
+
|
|
104
|
+
export const AddressWrap = styled.div`
|
|
105
|
+
width: 100%;
|
|
106
|
+
display: flex;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
align-items: center;
|
|
109
|
+
position: relative;
|
|
110
|
+
margin-top: -11px;
|
|
111
|
+
|
|
112
|
+
button {
|
|
113
|
+
height: 41px;
|
|
114
|
+
right: 1px;
|
|
115
|
+
border: none;
|
|
116
|
+
|
|
117
|
+
${props => props.theme?.rtl && css`
|
|
118
|
+
left: 1px;
|
|
119
|
+
right: initial;
|
|
120
|
+
`}
|
|
121
|
+
|
|
122
|
+
svg {
|
|
123
|
+
font-size: 18px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`
|
|
127
|
+
|
|
128
|
+
export const WrapAddressInput = styled.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
width: 100%;
|
|
132
|
+
i {
|
|
133
|
+
padding: 0px 10px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
svg {
|
|
137
|
+
position: absolute;
|
|
138
|
+
color: ${props => props.theme.colors.primary};
|
|
139
|
+
top: 21px;
|
|
140
|
+
left: 10px;
|
|
141
|
+
font-size: 20px;
|
|
142
|
+
${props => props.theme?.rtl && css`
|
|
143
|
+
right: 10px;
|
|
144
|
+
left: initial;
|
|
145
|
+
`}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
input {
|
|
149
|
+
background-position: left 10px center !important;
|
|
150
|
+
background-repeat: no-repeat !important;
|
|
151
|
+
background-size: 13px !important;
|
|
152
|
+
padding: 7px 30px 7px 15px !important;
|
|
153
|
+
${props => props.theme?.rtl && css`
|
|
154
|
+
padding: 7px 15px 7px 30px !important;
|
|
155
|
+
`}
|
|
156
|
+
}
|
|
157
|
+
`
|
|
158
|
+
|
|
159
|
+
export const AddressTagSection = styled.div`
|
|
160
|
+
width: 100%;
|
|
161
|
+
margin: 10px 0px;
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: space-between;
|
|
164
|
+
|
|
165
|
+
button {
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
align-items: center;
|
|
169
|
+
width: 46px;
|
|
170
|
+
height: 46px;
|
|
171
|
+
border: none;
|
|
172
|
+
color: #B1BCCC;
|
|
173
|
+
|
|
174
|
+
img {
|
|
175
|
+
width: 25px;
|
|
176
|
+
height: 25px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
span {
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
align-items: center;
|
|
183
|
+
|
|
184
|
+
svg {
|
|
185
|
+
font-size: 30px;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
button.active {
|
|
191
|
+
color: ${props => props.theme.colors.primary};
|
|
192
|
+
}
|
|
193
|
+
`
|
|
194
|
+
|
|
195
|
+
export const WrapperMap = styled.div`
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: ${({ height }) => `${height}px` || '170px'};
|
|
198
|
+
> div {
|
|
199
|
+
position: relative !important;
|
|
200
|
+
width: 100% !important;
|
|
201
|
+
height: 100% !important;
|
|
202
|
+
border-radius: 15px;
|
|
203
|
+
}
|
|
204
|
+
span {
|
|
205
|
+
border-radius: 15px;
|
|
206
|
+
}
|
|
207
|
+
`
|
|
208
|
+
|
|
209
|
+
export const WrapperSkeleton = styled.div`
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
padding: 9px 10px;
|
|
213
|
+
|
|
214
|
+
span {
|
|
215
|
+
width: 100%;
|
|
216
|
+
}
|
|
217
|
+
`
|
|
218
|
+
|
|
219
|
+
export const AddressFormContainer = styled.div`
|
|
220
|
+
text-align: center;
|
|
221
|
+
padding: 20px;
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-direction: column;
|
|
224
|
+
justify-content: flex-start;
|
|
225
|
+
|
|
226
|
+
h1{
|
|
227
|
+
font-size: 24px;
|
|
228
|
+
text-align: center;
|
|
229
|
+
padding-bottom: 15px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
> div{
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
align-items: center;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
button{
|
|
239
|
+
width: 100%;
|
|
240
|
+
align-self: center;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (min-width: 768px){
|
|
244
|
+
ul{
|
|
245
|
+
width: 100%;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
`
|
|
250
|
+
|
|
251
|
+
export const AddressMarkContainer = styled.div`
|
|
252
|
+
background: #FFE69C;
|
|
253
|
+
border: 1px solid #FFF3CD;
|
|
254
|
+
display: flex;
|
|
255
|
+
padding: 8px;
|
|
256
|
+
justify-content: center;
|
|
257
|
+
align-items: center;
|
|
258
|
+
border-radius: 4px;
|
|
259
|
+
position: absolute;
|
|
260
|
+
top: 50px;
|
|
261
|
+
width: 75%;
|
|
262
|
+
p {
|
|
263
|
+
margin: 0;
|
|
264
|
+
color: #664D03;
|
|
265
|
+
font-size: 12px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
${({ error }) => error && css`
|
|
269
|
+
background-color: #F8D7DA;
|
|
270
|
+
border: 1px solid #F1AEB5;
|
|
271
|
+
p {
|
|
272
|
+
color: #842029;
|
|
273
|
+
}
|
|
274
|
+
`}
|
|
275
|
+
`
|
|
@@ -71,6 +71,8 @@ export const Header = (props) => {
|
|
|
71
71
|
const [isOpenUserData, setIsOpenUserData] = useState(false)
|
|
72
72
|
const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
|
|
73
73
|
const [preorderBusiness, setPreorderBusiness] = useState(null)
|
|
74
|
+
const [userConfirmPhone, setUserConfirmPhone] = useState({ open: false, result: null })
|
|
75
|
+
const [disabledSms, setDisableSms] = useState(false)
|
|
74
76
|
|
|
75
77
|
const cartsWithProducts = (orderState?.carts && Object.values(orderState?.carts).filter(cart => cart.products && cart.products?.length > 0)) || null
|
|
76
78
|
|
|
@@ -148,6 +150,19 @@ export const Header = (props) => {
|
|
|
148
150
|
}
|
|
149
151
|
}, [JSON.stringify(orderState?.options?.address?.address)])
|
|
150
152
|
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
let timeout = null
|
|
155
|
+
if (userConfirmPhone?.result) {
|
|
156
|
+
setDisableSms(true)
|
|
157
|
+
timeout = setTimeout(() => {
|
|
158
|
+
setDisableSms(false)
|
|
159
|
+
}, 30000)
|
|
160
|
+
}
|
|
161
|
+
return () => {
|
|
162
|
+
clearTimeout(timeout)
|
|
163
|
+
}
|
|
164
|
+
}, [userConfirmPhone?.result])
|
|
165
|
+
|
|
151
166
|
return (
|
|
152
167
|
<HeaderContainer>
|
|
153
168
|
<InnerHeader>
|
|
@@ -408,6 +423,8 @@ export const Header = (props) => {
|
|
|
408
423
|
setIsOpenUserData={setIsOpenUserData}
|
|
409
424
|
onClose={() => setCustomerModalOpen(false)}
|
|
410
425
|
franchiseId={franchiseId}
|
|
426
|
+
userConfirmPhone={userConfirmPhone}
|
|
427
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
411
428
|
/>
|
|
412
429
|
<AddressList
|
|
413
430
|
isModal
|
|
@@ -420,6 +437,9 @@ export const Header = (props) => {
|
|
|
420
437
|
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
421
438
|
franchiseId={franchiseId}
|
|
422
439
|
isHeader
|
|
440
|
+
userConfirmPhone={userConfirmPhone}
|
|
441
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
442
|
+
disabledSms={disabledSms}
|
|
423
443
|
/>
|
|
424
444
|
</>
|
|
425
445
|
</UserEdit>
|
|
@@ -453,3 +473,5 @@ export const Header = (props) => {
|
|
|
453
473
|
Header.defaultProps = {
|
|
454
474
|
isShowOrderOptions: true
|
|
455
475
|
}
|
|
476
|
+
|
|
477
|
+
export default Header
|
|
@@ -21,7 +21,7 @@ export const InputPhoneNumber = (props) => {
|
|
|
21
21
|
const [{ configs }] = useConfig()
|
|
22
22
|
|
|
23
23
|
const phoneRef = useRef(null)
|
|
24
|
-
const
|
|
24
|
+
const UKCodes = ['44']
|
|
25
25
|
|
|
26
26
|
const isValidPhoneNumber = (number) => {
|
|
27
27
|
if (!number) return
|
|
@@ -30,9 +30,9 @@ export const InputPhoneNumber = (props) => {
|
|
|
30
30
|
}
|
|
31
31
|
const numberParser = parsePhoneNumber(number)
|
|
32
32
|
let enableIspossibly = false
|
|
33
|
-
if (
|
|
33
|
+
if (UKCodes.includes(numberParser?.countryCallingCode)) {
|
|
34
34
|
const inputNumber = returnRawNumber(number)
|
|
35
|
-
const validationsForUK = ['01', '02', '07', '0800', '0808', '0845', '0870', '0871']
|
|
35
|
+
const validationsForUK = ['01', '02', '07', '0800', '0808', '0845', '0870', '0871', '16']
|
|
36
36
|
const result = validationsForUK.some(areaCode => inputNumber?.number?.startsWith(areaCode))
|
|
37
37
|
enableIspossibly = result
|
|
38
38
|
}
|
|
@@ -47,13 +47,18 @@ export const InputPhoneNumber = (props) => {
|
|
|
47
47
|
}
|
|
48
48
|
const numberParser = parsePhoneNumber(number)
|
|
49
49
|
const validations = ['0', '+']
|
|
50
|
-
|
|
50
|
+
const startsWithValidations = ['16']
|
|
51
|
+
const hasStartValidation = startsWithValidations.some(validation => phoneRef?.current?.value?.startsWith?.(validation))
|
|
52
|
+
if ((hasStartValidation || validations.includes(phoneRef?.current?.value[0])) && UKCodes.includes(numberParser?.countryCallingCode)) {
|
|
51
53
|
const numberInput = phoneRef?.current?.value.replace('-', '')
|
|
52
54
|
let numberRaw = ''
|
|
53
|
-
numberInput
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
numberInput && numberInput.split(' ')
|
|
56
|
+
.filter((_splited, i) => i > 0 || (i === 0 && (
|
|
57
|
+
_splited[0] === '0' || startsWithValidations.some(validation => _splited.startsWith(validation))
|
|
58
|
+
))).map(splited => {
|
|
59
|
+
numberRaw = `${numberRaw}${splited}`
|
|
60
|
+
return numberRaw
|
|
61
|
+
})
|
|
57
62
|
|
|
58
63
|
return {
|
|
59
64
|
number: numberRaw,
|
|
@@ -24,10 +24,6 @@ import {
|
|
|
24
24
|
UserEdit,
|
|
25
25
|
WrappBtn,
|
|
26
26
|
SelectContainer,
|
|
27
|
-
TypesContainer,
|
|
28
|
-
TypeButton,
|
|
29
|
-
IconTypeButton,
|
|
30
|
-
AdditionalTypesContainer,
|
|
31
27
|
PhoneAutocompleteContainer,
|
|
32
28
|
ImageWrapper,
|
|
33
29
|
NotFoundUser,
|
|
@@ -35,6 +31,9 @@ import {
|
|
|
35
31
|
} from './styles'
|
|
36
32
|
|
|
37
33
|
import MdcCellphoneAndroid from '@meronex/icons/mdc/MdcCellphoneAndroid'
|
|
34
|
+
import { OrderTypesSquares } from '../../../../five/src/components/OrderTypesSquares'
|
|
35
|
+
|
|
36
|
+
const countriesElevenPhoneLength = ['GB']
|
|
38
37
|
|
|
39
38
|
const PhoneAutocompleteUI = (props) => {
|
|
40
39
|
const {
|
|
@@ -57,10 +56,8 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
57
56
|
franchiseId,
|
|
58
57
|
getUsers
|
|
59
58
|
} = props
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const eatInType = 3
|
|
63
|
-
const [orderState, { changeType }] = useOrder()
|
|
59
|
+
|
|
60
|
+
const [orderState] = useOrder()
|
|
64
61
|
const [, t] = useLanguage()
|
|
65
62
|
const theme = useTheme()
|
|
66
63
|
const [configState] = useConfig()
|
|
@@ -68,11 +65,14 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
68
65
|
const [, { deleteUserCustomer }] = useCustomer()
|
|
69
66
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
70
67
|
const [isOpenUserData, setIsOpenUserData] = useState(false)
|
|
68
|
+
const [userConfirmPhone, setUserConfirmPhone] = useState({ open: false, result: null })
|
|
71
69
|
const [isAddressFormOpen, setIsAddressFormOpen] = useState(false)
|
|
72
|
-
const [orderTypeSelected, setOrderTypeSelected] = useState(orderState?.options?.type)
|
|
73
70
|
const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
|
|
74
71
|
const [inputValue, setInputValue] = useState(urlPhone ?? userCustomer?.cellphone ?? '')
|
|
75
72
|
const [isSavedAddress, setIsSavedAddress] = useState(false)
|
|
73
|
+
const [disabledSms, setDisableSms] = useState(false)
|
|
74
|
+
const allOrderTypes = [1, 2, 3, 4, 5]
|
|
75
|
+
|
|
76
76
|
const countryPhoneCode = userCustomer?.country_phone_code ?? userCustomer?.country_code
|
|
77
77
|
|
|
78
78
|
const [optSelected, setOptSelected] = useState(userCustomer ? {
|
|
@@ -105,13 +105,6 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const handleChangeType = (value) => {
|
|
109
|
-
if (!orderState?.loading) {
|
|
110
|
-
changeType(value)
|
|
111
|
-
setOrderTypeSelected(value)
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
108
|
useEffect(() => {
|
|
116
109
|
if (customersPhones?.error) {
|
|
117
110
|
setAlertState({ open: true, content: [customersPhones?.error] })
|
|
@@ -170,7 +163,9 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
170
163
|
}
|
|
171
164
|
|
|
172
165
|
const createNewUser = () => {
|
|
173
|
-
|
|
166
|
+
const lengthIntervals = countriesElevenPhoneLength.includes(configState?.configs?.default_country_code?.value) ? [10, limitPhoneLength] : [limitPhoneLength]
|
|
167
|
+
if ((optSelected && lengthIntervals.includes(optSelected?.value?.length)) ||
|
|
168
|
+
(!optSelected && lengthIntervals.includes(phone.length))) {
|
|
174
169
|
setOpenModal({ ...openModal, signup: true })
|
|
175
170
|
} else {
|
|
176
171
|
setAlertState({
|
|
@@ -188,12 +183,6 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
188
183
|
}
|
|
189
184
|
}
|
|
190
185
|
|
|
191
|
-
const handleChangeToPickup = () => {
|
|
192
|
-
const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
|
|
193
|
-
handleChangeType(firstEnabledPickupType)
|
|
194
|
-
setOrderTypeSelected(firstEnabledPickupType)
|
|
195
|
-
}
|
|
196
|
-
|
|
197
186
|
const handleDeleteUser = () => {
|
|
198
187
|
deleteUserCustomer(true)
|
|
199
188
|
}
|
|
@@ -270,10 +259,6 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
270
259
|
onChange({ value: urlPhone, label: urlPhone })
|
|
271
260
|
}, [urlPhone, customersPhones?.loading])
|
|
272
261
|
|
|
273
|
-
useEffect(() => {
|
|
274
|
-
setOrderTypeSelected(orderState?.options?.type)
|
|
275
|
-
}, [orderState?.options?.type])
|
|
276
|
-
|
|
277
262
|
useEffect(() => {
|
|
278
263
|
if (isSavedAddress &&
|
|
279
264
|
userCustomer?.id === orderState?.options?.user_id &&
|
|
@@ -289,23 +274,18 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
289
274
|
}
|
|
290
275
|
}, [userCustomer?.id, orderState?.loading])
|
|
291
276
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
</Button>
|
|
305
|
-
))}
|
|
306
|
-
</>
|
|
307
|
-
)
|
|
308
|
-
}
|
|
277
|
+
useEffect(() => {
|
|
278
|
+
let timeout = null
|
|
279
|
+
if (userConfirmPhone?.result) {
|
|
280
|
+
setDisableSms(true)
|
|
281
|
+
timeout = setTimeout(() => {
|
|
282
|
+
setDisableSms(false)
|
|
283
|
+
}, 30000)
|
|
284
|
+
}
|
|
285
|
+
return () => {
|
|
286
|
+
clearTimeout(timeout)
|
|
287
|
+
}
|
|
288
|
+
}, [userConfirmPhone?.result])
|
|
309
289
|
|
|
310
290
|
return (
|
|
311
291
|
<>
|
|
@@ -313,60 +293,10 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
313
293
|
<ContentWrapper>
|
|
314
294
|
<Title>{t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')}</Title>
|
|
315
295
|
<Slogan>{t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')}</Slogan>
|
|
316
|
-
<
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
<img
|
|
321
|
-
src={theme?.images?.general?.deliveryIco}
|
|
322
|
-
width={20}
|
|
323
|
-
height={20}
|
|
324
|
-
/>
|
|
325
|
-
</IconTypeButton>
|
|
326
|
-
<p>{t('DELIVERY', 'Delivery')}</p>
|
|
327
|
-
</TypeButton>
|
|
328
|
-
)}
|
|
329
|
-
{configTypes.some(type => pickupTypes.includes(type)) && (
|
|
330
|
-
<TypeButton
|
|
331
|
-
disabled={orderState?.loading}
|
|
332
|
-
activated={pickupTypes.includes(orderTypeSelected)}
|
|
333
|
-
onClick={() => handleChangeToPickup()}
|
|
334
|
-
>
|
|
335
|
-
<IconTypeButton activated={pickupTypes.includes(orderTypeSelected)}>
|
|
336
|
-
<img
|
|
337
|
-
src={theme?.images?.general?.pickupIco}
|
|
338
|
-
width={22}
|
|
339
|
-
height={22}
|
|
340
|
-
/>
|
|
341
|
-
</IconTypeButton>
|
|
342
|
-
<p>{t('PICKUP', 'Pickup')}</p>
|
|
343
|
-
</TypeButton>
|
|
344
|
-
)}
|
|
345
|
-
{configTypes.some(type => eatInType === type) && (
|
|
346
|
-
<TypeButton
|
|
347
|
-
disabled={orderState?.loading}
|
|
348
|
-
activated={orderTypeSelected === 3}
|
|
349
|
-
onClick={() => handleChangeType(3)}
|
|
350
|
-
>
|
|
351
|
-
<IconTypeButton activated={orderTypeSelected === 3}>
|
|
352
|
-
<img
|
|
353
|
-
src={theme?.images?.general?.eatinIco}
|
|
354
|
-
width={22}
|
|
355
|
-
height={22}
|
|
356
|
-
/>
|
|
357
|
-
</IconTypeButton>
|
|
358
|
-
<p>{t('EAT_IN', 'Eat in')}</p>
|
|
359
|
-
</TypeButton>
|
|
360
|
-
)}
|
|
361
|
-
</TypesContainer>
|
|
362
|
-
{pickupTypes.includes(orderTypeSelected) && (
|
|
363
|
-
<>
|
|
364
|
-
<p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
|
|
365
|
-
<AdditionalTypesContainer>
|
|
366
|
-
<OrderTypesComponent />
|
|
367
|
-
</AdditionalTypesContainer>
|
|
368
|
-
</>
|
|
369
|
-
)}
|
|
296
|
+
<OrderTypesSquares
|
|
297
|
+
hideTitle
|
|
298
|
+
orderTypes={orderTypes}
|
|
299
|
+
/>
|
|
370
300
|
{configTypes.includes(orderState?.options?.type) && (
|
|
371
301
|
<>
|
|
372
302
|
<PhoneAutocompleteContainer>
|
|
@@ -444,6 +374,8 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
444
374
|
setIsOpenUserData={setIsOpenUserData}
|
|
445
375
|
onClose={() => handleCloseAddressList()}
|
|
446
376
|
franchiseId={franchiseId}
|
|
377
|
+
userConfirmPhone={userConfirmPhone}
|
|
378
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
447
379
|
/>
|
|
448
380
|
<AddressList
|
|
449
381
|
isModal
|
|
@@ -459,7 +391,10 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
459
391
|
setIsOpenUserData={setIsOpenUserData}
|
|
460
392
|
setIsSavedAddress={setIsSavedAddress}
|
|
461
393
|
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
394
|
+
userConfirmPhone={userConfirmPhone}
|
|
395
|
+
setUserConfirmPhone={setUserConfirmPhone}
|
|
462
396
|
franchiseId={franchiseId}
|
|
397
|
+
disabledSms={disabledSms}
|
|
463
398
|
isHeader
|
|
464
399
|
/>
|
|
465
400
|
</>
|
|
@@ -490,11 +425,10 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
490
425
|
export const PhoneAutocomplete = (props) => {
|
|
491
426
|
const [, t] = useLanguage()
|
|
492
427
|
const [configState] = useConfig()
|
|
493
|
-
const countriesElevenPhoneLength = ['GB']
|
|
494
428
|
const phoneProps = {
|
|
495
429
|
UIComponent: PhoneAutocompleteUI,
|
|
496
430
|
...props,
|
|
497
|
-
limitPhoneLength: countriesElevenPhoneLength.includes(configState?.configs?.default_country_code?.value) ? 11 : props.limitPhoneLength,
|
|
431
|
+
limitPhoneLength: countriesElevenPhoneLength.includes(configState?.configs?.default_country_code?.value) ? 11 : props.limitPhoneLength || 10,
|
|
498
432
|
orderTypes: props.orderTypes || [
|
|
499
433
|
{
|
|
500
434
|
value: 1,
|
|
@@ -336,58 +336,6 @@ export const ImageWrapper = (props) => {
|
|
|
336
336
|
)
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
export const TypeButton = styled.div`
|
|
340
|
-
display: flex;
|
|
341
|
-
align-items: center;
|
|
342
|
-
width: 215px;
|
|
343
|
-
height: 75px;
|
|
344
|
-
border-radius: 7.6px;
|
|
345
|
-
padding: 16px;
|
|
346
|
-
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);
|
|
347
|
-
margin-right: 32px;
|
|
348
|
-
margin-bottom: 32px;
|
|
349
|
-
cursor: pointer;
|
|
350
|
-
background: ${({ activated, theme }) => activated ? theme?.colors?.primary : theme?.colors?.white};
|
|
351
|
-
p{
|
|
352
|
-
margin: 0;
|
|
353
|
-
margin-left: 33px;
|
|
354
|
-
${({ activated, theme }) => activated && css`
|
|
355
|
-
color: ${theme?.colors?.white};
|
|
356
|
-
`}
|
|
357
|
-
}
|
|
358
|
-
`
|
|
359
|
-
|
|
360
|
-
export const IconTypeButton = styled.div`
|
|
361
|
-
display: flex;
|
|
362
|
-
justify-content: center;
|
|
363
|
-
align-items: center;
|
|
364
|
-
width: 44px;
|
|
365
|
-
height: 44px;
|
|
366
|
-
background: ${({ activated, theme }) => activated ? theme?.colors?.white : '#F3F9FF'};
|
|
367
|
-
border-radius: 44px;
|
|
368
|
-
`
|
|
369
|
-
|
|
370
|
-
export const TypesContainer = styled.div`
|
|
371
|
-
display: flex;
|
|
372
|
-
`
|
|
373
|
-
|
|
374
|
-
export const AdditionalTypesContainer = styled.div`
|
|
375
|
-
width: 60%;
|
|
376
|
-
display: flex;
|
|
377
|
-
margin-bottom: 20px;
|
|
378
|
-
button {
|
|
379
|
-
padding: 4px 10px;
|
|
380
|
-
border-radius: 50px;
|
|
381
|
-
font-size: 10px;
|
|
382
|
-
line-height: 0;
|
|
383
|
-
height: 25px;
|
|
384
|
-
margin-right: 20px;
|
|
385
|
-
}
|
|
386
|
-
.activated {
|
|
387
|
-
color: ${({ theme }) => theme?.colors?.darkTextColor}
|
|
388
|
-
}
|
|
389
|
-
`
|
|
390
|
-
|
|
391
339
|
export const PhoneAutocompleteContainer = styled.div`
|
|
392
340
|
position: relative;
|
|
393
341
|
h2 {
|
|
@@ -27,11 +27,11 @@ export const SearchBar = (props) => {
|
|
|
27
27
|
|
|
28
28
|
if (previousSearch !== e.target.value) {
|
|
29
29
|
if (!lazyLoad) {
|
|
30
|
-
onSearch(e.target.value)
|
|
30
|
+
onSearch && onSearch(e.target.value)
|
|
31
31
|
} else {
|
|
32
32
|
clearTimeout(timeout)
|
|
33
33
|
timeout = setTimeout(function () {
|
|
34
|
-
onSearch(e.target.value)
|
|
34
|
+
onSearch && onSearch(e.target.value)
|
|
35
35
|
}, 750)
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -220,10 +220,28 @@ const SignUpFormUI = (props) => {
|
|
|
220
220
|
})
|
|
221
221
|
}, [signupData])
|
|
222
222
|
|
|
223
|
+
const returnRawNumber = (number) => {
|
|
224
|
+
const numberParser = parsePhoneNumber(externalPhoneNumber)
|
|
225
|
+
const validations = ['0', '+']
|
|
226
|
+
if (validations.includes(externalPhoneNumber[0]) && externalPhoneNumber.includes(numberParser?.countryCallingCode)) {
|
|
227
|
+
const numberInput = externalPhoneNumber.replace('-', '')
|
|
228
|
+
let numberRaw = ''
|
|
229
|
+
numberInput?.split(' ')?.filter((_splited, i) => i > 0 || (i === 0 && _splited[0] === '0'))?.map(splited => {
|
|
230
|
+
numberRaw = `${numberRaw}${splited}`
|
|
231
|
+
return numberRaw
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
number: numberRaw,
|
|
236
|
+
countryCallingCode: numberParser?.countryCallingCode ? `+${numberParser?.countryCallingCode}` : null
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return number
|
|
240
|
+
}
|
|
223
241
|
useEffect(() => {
|
|
224
242
|
if (externalPhoneNumber) {
|
|
225
243
|
setUserPhoneNumber(externalPhoneNumber)
|
|
226
|
-
handleChangePhoneNumber(externalPhoneNumber, true)
|
|
244
|
+
handleChangePhoneNumber(externalPhoneNumber, true, returnRawNumber(externalPhoneNumber))
|
|
227
245
|
}
|
|
228
246
|
}, [externalPhoneNumber])
|
|
229
247
|
|