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,125 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styled, { css } from 'styled-components'
|
|
3
|
+
|
|
4
|
+
export const HeroContainerStyled = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: fit-content;
|
|
7
|
+
position: relative;
|
|
8
|
+
${({ mb }) => mb && css`
|
|
9
|
+
margin-bottom: ${mb};
|
|
10
|
+
`}
|
|
11
|
+
padding: 40px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
@media (min-width: 375px) {
|
|
14
|
+
height: 374px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (min-width: 567px) {
|
|
18
|
+
height: 660px;
|
|
19
|
+
margin-bottom: 0;
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
|
|
23
|
+
export const HeroContainer = (props) => {
|
|
24
|
+
return (
|
|
25
|
+
<HeroContainerStyled {...props}>
|
|
26
|
+
{props.children}
|
|
27
|
+
</HeroContainerStyled>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const ContentWrapper = styled.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
|
|
34
|
+
height: 100%;
|
|
35
|
+
padding: 0px 10vw 0px;
|
|
36
|
+
|
|
37
|
+
input {
|
|
38
|
+
width: 90%;
|
|
39
|
+
margin-bottom: 15px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (min-width: 576px) {
|
|
43
|
+
justify-content: center;
|
|
44
|
+
padding: 0px 40px 0px;
|
|
45
|
+
input {
|
|
46
|
+
width: 97%;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (min-width: 768px) {
|
|
51
|
+
${props => props.theme?.rtl && css`
|
|
52
|
+
padding: 0px 40px 0px;
|
|
53
|
+
`}
|
|
54
|
+
}
|
|
55
|
+
`
|
|
56
|
+
|
|
57
|
+
export const Title = styled.h1`
|
|
58
|
+
margin: 0px;
|
|
59
|
+
text-align: left;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
font-size: 40px;
|
|
62
|
+
line-height: 36px;
|
|
63
|
+
letter-spacing: 0px;
|
|
64
|
+
color: #000;
|
|
65
|
+
opacity: 1;
|
|
66
|
+
|
|
67
|
+
${props => props.theme?.rtl && css`
|
|
68
|
+
text-align: right;
|
|
69
|
+
`}
|
|
70
|
+
`
|
|
71
|
+
|
|
72
|
+
export const Slogan = styled.p`
|
|
73
|
+
margin: 0px;
|
|
74
|
+
text-align: left;
|
|
75
|
+
font-size: 18px;
|
|
76
|
+
font-size: 400;
|
|
77
|
+
color: #000;
|
|
78
|
+
opacity: 1;
|
|
79
|
+
margin-bottom: 30px;
|
|
80
|
+
|
|
81
|
+
${props => props.theme?.rtl && css`
|
|
82
|
+
text-align: right;
|
|
83
|
+
`}
|
|
84
|
+
`
|
|
85
|
+
|
|
86
|
+
export const HeroContent = styled.div`
|
|
87
|
+
width: 35%;
|
|
88
|
+
padding: 25px;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.12);
|
|
91
|
+
`
|
|
92
|
+
|
|
93
|
+
export const HomeImage = styled.div`
|
|
94
|
+
width: 65%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
background-image: ${({ bgimage }) => `url(${bgimage})`};
|
|
97
|
+
`
|
|
98
|
+
|
|
99
|
+
export const OrderTypeListItemContainer = styled.div`
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 75px;
|
|
102
|
+
border-radius: 7.6px;
|
|
103
|
+
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);
|
|
104
|
+
padding: 16px;
|
|
105
|
+
display: flex;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
margin-bottom: 15px;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
`
|
|
110
|
+
|
|
111
|
+
export const OrderTypeTitle = styled.p`
|
|
112
|
+
font-size: 16px;
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
`
|
|
115
|
+
|
|
116
|
+
export const IconTypeButton = styled.div`
|
|
117
|
+
display: flex;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
align-items: center;
|
|
120
|
+
width: 44px;
|
|
121
|
+
height: 44px;
|
|
122
|
+
background: ${({ activated, theme }) => activated ? theme?.colors?.white : '#F3F9FF'};
|
|
123
|
+
border-radius: 44px;
|
|
124
|
+
margin-right: 30px;
|
|
125
|
+
`
|
|
@@ -3,9 +3,11 @@ import { useTheme } from 'styled-components'
|
|
|
3
3
|
import { OriginalHomeHero } from './layouts/OriginalHomeHero'
|
|
4
4
|
import { RedHomeHero } from './layouts/RedHomeHero'
|
|
5
5
|
import { StarbucksHomeHero } from './layouts/StarbucksHomeHero'
|
|
6
|
+
import { OloHomeHero } from './franchises/OloHomeHero'
|
|
6
7
|
|
|
7
8
|
export const HomeHero = (props) => {
|
|
8
9
|
const theme = useTheme()
|
|
10
|
+
const websiteTheme = theme?.my_products?.components?.website_theme?.components?.type
|
|
9
11
|
const HomeLayoutConfig = {
|
|
10
12
|
homepage_settings: {
|
|
11
13
|
layout: theme?.homepage_view?.components?.layout?.type || 'original', // 'original', 'starbucks', 'red'
|
|
@@ -15,6 +17,8 @@ export const HomeHero = (props) => {
|
|
|
15
17
|
const layout = HomeLayoutConfig?.homepage_settings?.layout !== undefined
|
|
16
18
|
? HomeLayoutConfig?.homepage_settings?.layout : 'original'
|
|
17
19
|
|
|
20
|
+
const franchiseLayout = theme?.my_products?.components?.website_theme?.components?.franchise_slug
|
|
21
|
+
|
|
18
22
|
const homeLayoutProps = {
|
|
19
23
|
...props,
|
|
20
24
|
layout: layout,
|
|
@@ -24,9 +28,18 @@ export const HomeHero = (props) => {
|
|
|
24
28
|
|
|
25
29
|
return (
|
|
26
30
|
<>
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
{websiteTheme === 'franchise' ? (
|
|
32
|
+
<>
|
|
33
|
+
{franchiseLayout === 'franchise_1' && <OloHomeHero {...homeLayoutProps} />}
|
|
34
|
+
{!franchiseLayout && <OriginalHomeHero {...homeLayoutProps} />}
|
|
35
|
+
</>
|
|
36
|
+
) : (
|
|
37
|
+
<>
|
|
38
|
+
{(layout === 'original') && <OriginalHomeHero {...homeLayoutProps} />}
|
|
39
|
+
{(layout === 'starbucks') && <StarbucksHomeHero {...homeLayoutProps} />}
|
|
40
|
+
{(layout === 'red') && <RedHomeHero {...homeLayoutProps} />}
|
|
41
|
+
</>
|
|
42
|
+
)}
|
|
30
43
|
</>
|
|
31
44
|
)
|
|
32
45
|
}
|
|
@@ -22,7 +22,7 @@ export const InputPhoneNumber = (props) => {
|
|
|
22
22
|
const [{ configs }] = useConfig()
|
|
23
23
|
|
|
24
24
|
const phoneRef = useRef(null)
|
|
25
|
-
const
|
|
25
|
+
const UKCodes = ['44']
|
|
26
26
|
|
|
27
27
|
const isValidPhoneNumber = (number) => {
|
|
28
28
|
if (!number) return
|
|
@@ -31,9 +31,9 @@ export const InputPhoneNumber = (props) => {
|
|
|
31
31
|
}
|
|
32
32
|
const numberParser = parsePhoneNumber(number)
|
|
33
33
|
let enableIspossibly = false
|
|
34
|
-
if (
|
|
34
|
+
if (UKCodes.includes(numberParser?.countryCallingCode)) {
|
|
35
35
|
const inputNumber = returnRawNumber(number)
|
|
36
|
-
const validationsForUK = ['01', '02', '07', '0800', '0808', '0845', '0870', '0871']
|
|
36
|
+
const validationsForUK = ['01', '02', '07', '0800', '0808', '0845', '0870', '0871', '16']
|
|
37
37
|
const result = validationsForUK.some(areaCode => inputNumber?.number?.startsWith(areaCode))
|
|
38
38
|
enableIspossibly = result
|
|
39
39
|
}
|
|
@@ -48,13 +48,18 @@ export const InputPhoneNumber = (props) => {
|
|
|
48
48
|
}
|
|
49
49
|
const numberParser = parsePhoneNumber(number)
|
|
50
50
|
const validations = ['0', '+']
|
|
51
|
-
|
|
51
|
+
const startsWithValidations = ['16']
|
|
52
|
+
const hasStartValidation = startsWithValidations.some(validation => phoneRef?.current?.value?.startsWith?.(validation))
|
|
53
|
+
if ((hasStartValidation || validations.includes(phoneRef?.current?.value[0])) && UKCodes.includes(numberParser?.countryCallingCode)) {
|
|
52
54
|
const numberInput = phoneRef?.current?.value.replace('-', '')
|
|
53
55
|
let numberRaw = ''
|
|
54
|
-
numberInput
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
numberInput && numberInput
|
|
57
|
+
.split(' ')
|
|
58
|
+
.filter((_splited, i) => i > 0 || (i === 0 && (_splited[0] === '0' || startsWithValidations.some(validation => _splited.startsWith(validation)))))
|
|
59
|
+
.map(splited => {
|
|
60
|
+
numberRaw = `${numberRaw}${splited}`
|
|
61
|
+
return numberRaw
|
|
62
|
+
})
|
|
58
63
|
|
|
59
64
|
return {
|
|
60
65
|
number: numberRaw,
|
|
@@ -92,7 +97,7 @@ export const InputPhoneNumber = (props) => {
|
|
|
92
97
|
/>
|
|
93
98
|
{value && !isValidPhoneNumber(value) && !disabled && (
|
|
94
99
|
<>
|
|
95
|
-
{((auth && user?.country_phone_code) || !auth || value.includes('+')) && (
|
|
100
|
+
{(((auth && user?.country_phone_code) || !auth || value.includes('+')) && phoneRef?.current?.value) && (
|
|
96
101
|
<ErrorMsg>{t('INVALID_ERROR_PHONE_NUMBER', 'The Phone Number field is invalid')}</ErrorMsg>
|
|
97
102
|
)}
|
|
98
103
|
|
|
@@ -53,7 +53,9 @@ const LogoutUI = (props) => {
|
|
|
53
53
|
setLogoutState({ ...logoutState, loading: true })
|
|
54
54
|
const response = await fetch(`${ordering.root}/users/check_password`, {
|
|
55
55
|
method: 'POST',
|
|
56
|
-
headers: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Content-Type': 'application/json', Authorization: `Bearer ${token}`, 'X-App-X': ordering.appId
|
|
58
|
+
},
|
|
57
59
|
body: JSON.stringify(body)
|
|
58
60
|
})
|
|
59
61
|
const { error, result } = await response.json()
|
|
@@ -29,7 +29,8 @@ const ModalUI = (props) => {
|
|
|
29
29
|
onRemove,
|
|
30
30
|
isSlideBar,
|
|
31
31
|
slideBarPosition,
|
|
32
|
-
disableOverflowX
|
|
32
|
+
disableOverflowX,
|
|
33
|
+
titleStyle
|
|
33
34
|
} = props
|
|
34
35
|
const [, t] = useLanguage()
|
|
35
36
|
|
|
@@ -44,8 +45,8 @@ const ModalUI = (props) => {
|
|
|
44
45
|
const scrollbarWidth = window.innerWidth - document.body.clientWidth
|
|
45
46
|
const bodyPaddingRight = window.document.body.style.paddingRight
|
|
46
47
|
document.body.style.paddingRight = props.open ? `${bodyPaddingRight + scrollbarWidth}px` : `${bodyPaddingRight}px`
|
|
48
|
+
document.body.style.overflow = props.open ? 'hidden' : 'auto'
|
|
47
49
|
}
|
|
48
|
-
document.body.style.overflow = props.open ? 'hidden' : 'auto'
|
|
49
50
|
if (props.open) {
|
|
50
51
|
window.addEventListener('keydown', handleKeyDown)
|
|
51
52
|
return () => window.removeEventListener('keydown', handleKeyDown)
|
|
@@ -79,7 +80,9 @@ const ModalUI = (props) => {
|
|
|
79
80
|
)}
|
|
80
81
|
<ModalHeader>
|
|
81
82
|
{title && (
|
|
82
|
-
<ModalTitle
|
|
83
|
+
<ModalTitle
|
|
84
|
+
style={titleStyle}
|
|
85
|
+
>
|
|
83
86
|
{title}
|
|
84
87
|
</ModalTitle>
|
|
85
88
|
)}
|
|
@@ -11,14 +11,14 @@ export const Container = styled.div`
|
|
|
11
11
|
@media (min-width: 769px) {
|
|
12
12
|
width: 70%;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
h2 {
|
|
16
16
|
margin: 0;
|
|
17
17
|
font-weight: 600;
|
|
18
18
|
font-size: 20px;
|
|
19
19
|
line-height: 30px;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
h3 {
|
|
23
23
|
margin: 0;
|
|
24
24
|
font-weight: 600;
|
|
@@ -179,7 +179,7 @@ export const SingleOrderHeader = styled.div`
|
|
|
179
179
|
> div {
|
|
180
180
|
display: flex;
|
|
181
181
|
flex-direction: column;
|
|
182
|
-
align-items: center;
|
|
182
|
+
align-items: center;
|
|
183
183
|
@media (min-width: 769px) {
|
|
184
184
|
flex-direction: row;
|
|
185
185
|
}
|
|
@@ -157,7 +157,9 @@ const OrderDetailsUI = (props) => {
|
|
|
157
157
|
try {
|
|
158
158
|
const response = await fetch(`${ordering.root}/orders/${order.id}/receipt`, {
|
|
159
159
|
method: 'POST',
|
|
160
|
-
headers: {
|
|
160
|
+
headers: {
|
|
161
|
+
'Content-Type': 'application/json', Authorization: `Bearer ${token}`, 'X-App-X': ordering.appId
|
|
162
|
+
},
|
|
161
163
|
body: JSON.stringify(body)
|
|
162
164
|
})
|
|
163
165
|
const { error, result } = await response.json()
|
|
@@ -55,9 +55,11 @@ export const ProductList = styled.div`
|
|
|
55
55
|
flex-direction: row;
|
|
56
56
|
box-sizing: border-box;
|
|
57
57
|
align-items: center;
|
|
58
|
+
|
|
58
59
|
button {
|
|
59
60
|
padding: 0px;
|
|
60
61
|
}
|
|
62
|
+
|
|
61
63
|
#orderItAgain > div {
|
|
62
64
|
width: 350px;
|
|
63
65
|
${({ theme }) => theme?.business_view?.components?.products?.components?.layout?.type === 'starbucks' && css`
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { AdditionalTypesContainer, IconTypeButton, Title, TypeButton, TypesContainer } from './styles'
|
|
3
|
+
import { useTheme } from 'styled-components'
|
|
4
|
+
import { useConfig, useLanguage, useOrder } from 'ordering-components-external'
|
|
5
|
+
import Button from '../../styles/Buttons'
|
|
6
|
+
|
|
7
|
+
export const OrderTypesSquaresController = (props) => {
|
|
8
|
+
const {
|
|
9
|
+
orderTypes,
|
|
10
|
+
hideTitle
|
|
11
|
+
} = props
|
|
12
|
+
|
|
13
|
+
const theme = useTheme()
|
|
14
|
+
const [orderState, { changeType }] = useOrder()
|
|
15
|
+
const [{ configs }] = useConfig()
|
|
16
|
+
const [, t] = useLanguage()
|
|
17
|
+
|
|
18
|
+
const [orderTypeSelected, setOrderTypeSelected] = useState(orderState?.options?.type)
|
|
19
|
+
|
|
20
|
+
const allOrderTypes = [1, 2, 3, 4, 5]
|
|
21
|
+
const pickupTypes = [2, 4, 5]
|
|
22
|
+
const eatInType = 3
|
|
23
|
+
const configTypes = configs?.order_types_allowed?.value.split('|').filter(value => (allOrderTypes.includes(Number(value)))).map(value => Number(value)) || []
|
|
24
|
+
|
|
25
|
+
const handleChangeType = (value) => {
|
|
26
|
+
if (!orderState?.loading) {
|
|
27
|
+
changeType(value)
|
|
28
|
+
setOrderTypeSelected(value)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const handleChangeToPickup = () => {
|
|
33
|
+
const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
|
|
34
|
+
handleChangeType(firstEnabledPickupType)
|
|
35
|
+
setOrderTypeSelected(firstEnabledPickupType)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
setOrderTypeSelected(orderState?.options?.type)
|
|
40
|
+
}, [orderState?.options?.type])
|
|
41
|
+
|
|
42
|
+
const OrderTypesComponent = () => {
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
{orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && pickupTypes.includes(type?.value)) : orderTypes).map((item, i) => (
|
|
46
|
+
<Button
|
|
47
|
+
key={item.value}
|
|
48
|
+
onClick={() => handleChangeType(item.value)}
|
|
49
|
+
color={orderState?.options?.type === item?.value ? 'primary' : 'secondary'}
|
|
50
|
+
disabled={orderState?.loading}
|
|
51
|
+
className={orderState?.options?.type !== item?.value ? 'activated' : ''}
|
|
52
|
+
>
|
|
53
|
+
{item.text}
|
|
54
|
+
</Button>
|
|
55
|
+
))}
|
|
56
|
+
</>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
{!hideTitle && (configTypes.includes(1) || configTypes.some(type => pickupTypes.includes(type))) && (
|
|
63
|
+
<Title>{t('DELIVERY_TYPE', 'Delivery Type')}</Title>
|
|
64
|
+
)}
|
|
65
|
+
<TypesContainer>
|
|
66
|
+
{configTypes.includes(1) && (
|
|
67
|
+
<TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={orderTypeSelected === 1}>
|
|
68
|
+
<IconTypeButton activated={orderTypeSelected === 1}>
|
|
69
|
+
<img
|
|
70
|
+
src={theme?.images?.general?.deliveryIco}
|
|
71
|
+
width={20}
|
|
72
|
+
height={20}
|
|
73
|
+
/>
|
|
74
|
+
</IconTypeButton>
|
|
75
|
+
<p>{t('DELIVERY', 'Delivery')}</p>
|
|
76
|
+
</TypeButton>
|
|
77
|
+
)}
|
|
78
|
+
{configTypes.some(type => pickupTypes.includes(type)) && (
|
|
79
|
+
<TypeButton
|
|
80
|
+
disabled={orderState?.loading}
|
|
81
|
+
activated={pickupTypes.includes(orderTypeSelected)}
|
|
82
|
+
onClick={() => handleChangeToPickup()}
|
|
83
|
+
>
|
|
84
|
+
<IconTypeButton activated={pickupTypes.includes(orderTypeSelected)}>
|
|
85
|
+
<img
|
|
86
|
+
src={theme?.images?.general?.pickupIco}
|
|
87
|
+
width={22}
|
|
88
|
+
height={22}
|
|
89
|
+
/>
|
|
90
|
+
</IconTypeButton>
|
|
91
|
+
<p>{t('PICKUP', 'Pickup')}</p>
|
|
92
|
+
</TypeButton>
|
|
93
|
+
)}
|
|
94
|
+
{configTypes.some(type => eatInType === type) && (
|
|
95
|
+
<TypeButton
|
|
96
|
+
disabled={orderState?.loading}
|
|
97
|
+
activated={orderTypeSelected === 3}
|
|
98
|
+
onClick={() => handleChangeType(3)}
|
|
99
|
+
>
|
|
100
|
+
<IconTypeButton activated={orderTypeSelected === 3}>
|
|
101
|
+
<img
|
|
102
|
+
src={theme?.images?.general?.eatinIco}
|
|
103
|
+
width={22}
|
|
104
|
+
height={22}
|
|
105
|
+
/>
|
|
106
|
+
</IconTypeButton>
|
|
107
|
+
<p>{t('EAT_IN', 'Eat in')}</p>
|
|
108
|
+
</TypeButton>
|
|
109
|
+
)}
|
|
110
|
+
</TypesContainer>
|
|
111
|
+
{pickupTypes.includes(orderTypeSelected) && (
|
|
112
|
+
<>
|
|
113
|
+
<p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
|
|
114
|
+
<AdditionalTypesContainer>
|
|
115
|
+
<OrderTypesComponent />
|
|
116
|
+
</AdditionalTypesContainer>
|
|
117
|
+
</>
|
|
118
|
+
)}
|
|
119
|
+
</>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const OrderTypesSquares = (props) => {
|
|
124
|
+
const [, t] = useLanguage()
|
|
125
|
+
|
|
126
|
+
const OrderTypesSquaresProps = {
|
|
127
|
+
...props,
|
|
128
|
+
orderTypes: props.orderTypes || [
|
|
129
|
+
{
|
|
130
|
+
value: 1,
|
|
131
|
+
text: t('DELIVERY', 'Delivery'),
|
|
132
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: 2,
|
|
136
|
+
text: t('PICKUP', 'Pickup'),
|
|
137
|
+
description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
value: 3,
|
|
141
|
+
text: t('EAT_IN', 'Eat in'),
|
|
142
|
+
description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
value: 4,
|
|
146
|
+
text: t('CURBSIDE', 'Curbside'),
|
|
147
|
+
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
value: 5,
|
|
151
|
+
text: t('DRIVE_THRU', 'Drive thru'),
|
|
152
|
+
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
return <OrderTypesSquaresController {...OrderTypesSquaresProps} />
|
|
157
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const IconTypeButton = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 44px;
|
|
8
|
+
height: 44px;
|
|
9
|
+
background: ${({ activated, theme }) => activated ? theme?.colors?.white : '#F3F9FF'};
|
|
10
|
+
border-radius: 44px;
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const TypesContainer = styled.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
margin: 42px 20px 0px 20px;
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const AdditionalTypesContainer = styled.div`
|
|
19
|
+
width: 60%;
|
|
20
|
+
display: flex;
|
|
21
|
+
margin-bottom: 20px;
|
|
22
|
+
margin-left: 20px;
|
|
23
|
+
button {
|
|
24
|
+
padding: 4px 10px;
|
|
25
|
+
border-radius: 50px;
|
|
26
|
+
font-size: 10px;
|
|
27
|
+
line-height: 0;
|
|
28
|
+
height: 25px;
|
|
29
|
+
margin-right: 20px;
|
|
30
|
+
}
|
|
31
|
+
.activated {
|
|
32
|
+
color: ${({ theme }) => theme?.colors?.darkTextColor}
|
|
33
|
+
}
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export const TypeButton = styled.div`
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
width: 215px;
|
|
40
|
+
height: 75px;
|
|
41
|
+
border-radius: 7.6px;
|
|
42
|
+
padding: 16px;
|
|
43
|
+
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);
|
|
44
|
+
margin-right: 32px;
|
|
45
|
+
margin-bottom: 32px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
background: ${({ activated, theme }) => activated ? theme?.colors?.primary : theme?.colors?.white};
|
|
48
|
+
p{
|
|
49
|
+
margin: 0;
|
|
50
|
+
margin-left: 33px;
|
|
51
|
+
${({ activated, theme }) => activated && css`
|
|
52
|
+
color: ${theme?.colors?.white};
|
|
53
|
+
`}
|
|
54
|
+
}
|
|
55
|
+
`
|
|
56
|
+
|
|
57
|
+
export const Title = styled.h2`
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
font-size: 24px;
|
|
60
|
+
color: ${props => props.theme?.colors.headingColor};
|
|
61
|
+
margin: 20px 20px 5px 20px;
|
|
62
|
+
`
|
|
@@ -300,11 +300,11 @@ const ProductItemAccordionUI = (props) => {
|
|
|
300
300
|
)}
|
|
301
301
|
{productInfo.options.length > 0 && (
|
|
302
302
|
<ProductOptionsList>
|
|
303
|
-
{productInfo.options.
|
|
303
|
+
{productInfo.options.map(option => (
|
|
304
304
|
<li key={option.id}>
|
|
305
305
|
<p>{option.name}</p>
|
|
306
306
|
<ProductOptionsList className='suboption'>
|
|
307
|
-
{option.suboptions.map(suboption => (
|
|
307
|
+
{option.suboptions.sort((a, b) => a.rank - b.rank).map(suboption => (
|
|
308
308
|
<li key={suboption.id}>
|
|
309
309
|
<span>
|
|
310
310
|
{getFormattedSubOptionName({
|
|
@@ -13,9 +13,11 @@ export const WrappLayout = styled.div``
|
|
|
13
13
|
export const WrapContent = styled.div`
|
|
14
14
|
padding: 5px;
|
|
15
15
|
background: ${props => props.theme.colors.backgroundPage};
|
|
16
|
+
|
|
16
17
|
${({ isGroceries }) => !isGroceries && css`
|
|
17
18
|
margin-top: 70px;
|
|
18
19
|
`}
|
|
20
|
+
|
|
19
21
|
@media (min-width: 576px) {
|
|
20
22
|
padding: 0px;
|
|
21
23
|
}
|
|
@@ -33,14 +33,14 @@ export const SearchBar = (props) => {
|
|
|
33
33
|
|
|
34
34
|
if (previousSearch !== e.target.value) {
|
|
35
35
|
if (!lazyLoad) {
|
|
36
|
-
onSearch(e.target.value)
|
|
36
|
+
onSearch && onSearch(e.target.value)
|
|
37
37
|
if (el.current) {
|
|
38
38
|
el.current.value = e.target.value
|
|
39
39
|
}
|
|
40
40
|
} else {
|
|
41
41
|
clearTimeout(timeout)
|
|
42
42
|
timeout = setTimeout(function () {
|
|
43
|
-
onSearch(e.target.value)
|
|
43
|
+
onSearch && onSearch(e.target.value)
|
|
44
44
|
if (el.current) {
|
|
45
45
|
el.current.value = e.target.value
|
|
46
46
|
}
|
|
@@ -300,9 +300,11 @@ const SignUpFormUI = (props) => {
|
|
|
300
300
|
useEffect(() => {
|
|
301
301
|
if (useChekoutFileds && validationFields?.loading) return
|
|
302
302
|
let fieldnum = 0
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
if (validationFields?.fields?.checkout) {
|
|
304
|
+
sortInputFields({ values: validationFields?.fields?.checkout }).forEach(field => {
|
|
305
|
+
if (showField && showField(field.code) && field.code !== 'email') fieldnum += 1
|
|
306
|
+
})
|
|
307
|
+
}
|
|
306
308
|
setFieldNumber(fieldnum)
|
|
307
309
|
}, [validationFields])
|
|
308
310
|
|
|
@@ -21,6 +21,7 @@ import { useCountdownTimer } from '../../../../../hooks/useCountdownTimer'
|
|
|
21
21
|
import { parsePhoneNumber } from 'libphonenumber-js'
|
|
22
22
|
import {
|
|
23
23
|
UserFormDetails as UserFormController,
|
|
24
|
+
useConfig,
|
|
24
25
|
useLanguage,
|
|
25
26
|
useSession
|
|
26
27
|
} from 'ordering-components-external'
|
|
@@ -53,6 +54,7 @@ const UserDetailsUI = (props) => {
|
|
|
53
54
|
|
|
54
55
|
const [, t] = useLanguage()
|
|
55
56
|
const [{ user, loading }] = useSession()
|
|
57
|
+
const [{ configs }] = useConfig()
|
|
56
58
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
57
59
|
const [skeletonsLength] = useState(requiredFields)
|
|
58
60
|
const userData = userState.result?.result || props.userData || formState.result?.result || user
|
|
@@ -197,7 +199,7 @@ const UserDetailsUI = (props) => {
|
|
|
197
199
|
<CountryFlag>
|
|
198
200
|
{
|
|
199
201
|
userData?.country_phone_code && (userData?.cellphone ?? userData?.guest_cellphone) && (
|
|
200
|
-
<PhoneInput onChange={() => { }} defaultCountry={parsePhoneNumber(`+${(userData?.country_phone_code?.replace('+', ''))} ${userData?.[userData?.guest_id ? 'guest_cellphone' : 'cellphone']?.replace(`+${userData?.country_phone_code}`, '')}`)?.country} />
|
|
202
|
+
<PhoneInput onChange={() => { }} defaultCountry={parsePhoneNumber(`+${(userData?.country_phone_code?.replace('+', ''))} ${userData?.[userData?.guest_id ? 'guest_cellphone' : 'cellphone']?.replace(`+${userData?.country_phone_code}`, '')}`)?.country || configs?.default_country_code?.value} />
|
|
201
203
|
)
|
|
202
204
|
}
|
|
203
205
|
</CountryFlag>
|
|
@@ -66,9 +66,9 @@ export const IconButton = styled.button`
|
|
|
66
66
|
`
|
|
67
67
|
|
|
68
68
|
export const Button = styled.button`
|
|
69
|
-
background: #
|
|
69
|
+
background: #E9ECEF;
|
|
70
70
|
color: #FFF;
|
|
71
|
-
border: 1px solid #
|
|
71
|
+
border: 1px solid #E9ECEF;
|
|
72
72
|
border-radius: 7.6px;
|
|
73
73
|
line-height: 30px;
|
|
74
74
|
padding-left: 15px;
|