ordering-ui-external 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{0.ordering-ui.a228aa8797d9d0fc5a6c.js → 0.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{1.ordering-ui.a228aa8797d9d0fc5a6c.js → 1.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{2.ordering-ui.a228aa8797d9d0fc5a6c.js → 2.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{4.ordering-ui.a228aa8797d9d0fc5a6c.js → 4.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{5.ordering-ui.a228aa8797d9d0fc5a6c.js → 5.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{6.ordering-ui.a228aa8797d9d0fc5a6c.js → 6.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{7.ordering-ui.a228aa8797d9d0fc5a6c.js → 7.ordering-ui.3861d1cf52cf041c74c5.js} +1 -1
- package/_bundles/{7.ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt → 7.ordering-ui.3861d1cf52cf041c74c5.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a228aa8797d9d0fc5a6c.js → 8.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{9.ordering-ui.a228aa8797d9d0fc5a6c.js → 9.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{ordering-ui.a228aa8797d9d0fc5a6c.js → ordering-ui.3861d1cf52cf041c74c5.js} +2 -2
- package/_bundles/{ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt → ordering-ui.3861d1cf52cf041c74c5.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +36 -28
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +48 -34
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -1
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +9 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/Cart/index.js +73 -25
- package/_modules/themes/five/src/components/CartContent/index.js +3 -1
- package/_modules/themes/five/src/components/Checkout/index.js +25 -15
- package/_modules/themes/five/src/components/DriverTips/index.js +26 -15
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +63 -0
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/styles.js +27 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +69 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +29 -0
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +123 -0
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/styles.js +20 -0
- package/_modules/themes/five/src/components/GiftCard/SendGiftCard/index.js +114 -0
- package/_modules/themes/five/src/components/GiftCard/SendGiftCard/styles.js +14 -0
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/index.js +3 -1
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/LoginForm/index.js +6 -0
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +69 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +84 -76
- package/_modules/themes/five/src/components/OrderDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +3 -3
- package/_modules/themes/five/src/components/OrderProgress/index.js +5 -14
- package/_modules/themes/five/src/components/PaymentOptions/index.js +22 -8
- package/_modules/themes/five/src/components/PaymentOptions/styles.js +9 -7
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +20 -14
- package/_modules/themes/five/src/components/ProfessionalFilter/index.js +23 -25
- package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +6 -32
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +38 -22
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +3 -9
- package/_modules/themes/five/src/components/ServiceForm/index.js +10 -4
- package/_modules/themes/five/src/components/ServiceForm/styles.js +23 -25
- package/_modules/themes/five/src/components/SignUpForm/index.js +6 -0
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +22 -16
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -2
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +73 -51
- package/_modules/themes/five/src/components/SingleProfessionalCard/index.js +23 -7
- package/_modules/themes/five/src/components/SingleProfessionalCard/styles.js +29 -10
- package/_modules/themes/five/src/components/Wallets/index.js +2 -1
- package/package.json +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +49 -35
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +26 -4
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -2
- package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +2 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
- package/src/themes/five/src/components/Cart/index.js +44 -14
- package/src/themes/five/src/components/CartContent/index.js +1 -0
- package/src/themes/five/src/components/Checkout/index.js +67 -51
- package/src/themes/five/src/components/DriverTips/index.js +52 -40
- package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +59 -0
- package/src/themes/five/src/components/GiftCard/GiftCardUI/styles.js +41 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +70 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +52 -0
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +122 -0
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/styles.js +41 -0
- package/src/themes/five/src/components/GiftCard/SendGiftCard/index.js +103 -0
- package/src/themes/five/src/components/GiftCard/SendGiftCard/styles.js +27 -0
- package/src/themes/five/src/components/HorizontalOrdersLayout/index.js +7 -4
- package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +0 -1
- package/src/themes/five/src/components/LoginForm/index.js +7 -0
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +59 -0
- package/src/themes/five/src/components/OrderDetails/index.js +141 -133
- package/src/themes/five/src/components/OrderDetails/styles.js +0 -1
- package/src/themes/five/src/components/OrderItAgain/styles.js +6 -6
- package/src/themes/five/src/components/OrderProgress/index.js +3 -12
- package/src/themes/five/src/components/PaymentOptions/index.js +26 -5
- package/src/themes/five/src/components/PaymentOptions/styles.js +4 -0
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +24 -4
- package/src/themes/five/src/components/ProfessionalFilter/index.js +18 -30
- package/src/themes/five/src/components/ProfessionalFilter/styles.js +1 -57
- package/src/themes/five/src/components/RenderProductsLayout/index.js +33 -17
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +0 -18
- package/src/themes/five/src/components/ServiceForm/index.js +11 -5
- package/src/themes/five/src/components/ServiceForm/styles.js +1 -9
- package/src/themes/five/src/components/SignUpForm/index.js +7 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +43 -26
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +12 -2
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +51 -4
- package/src/themes/five/src/components/SingleProfessionalCard/index.js +17 -6
- package/src/themes/five/src/components/SingleProfessionalCard/styles.js +33 -6
- package/src/themes/five/src/components/Wallets/index.js +2 -1
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components-external'
|
|
3
|
-
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
4
|
-
import { Heart as DisLike, HeartFill as Like, InfoCircle } from 'react-bootstrap-icons'
|
|
5
3
|
import {
|
|
6
4
|
Container,
|
|
7
5
|
ProfessionalItem,
|
|
8
|
-
ProfessionalPhoto,
|
|
9
6
|
ContentWrapper,
|
|
10
|
-
ProfessionalListing
|
|
11
|
-
InfoWrapper,
|
|
12
|
-
HeartIconWrapper,
|
|
13
|
-
IconWrapper
|
|
7
|
+
ProfessionalListing
|
|
14
8
|
} from './styles'
|
|
15
9
|
import { Modal } from '../Modal'
|
|
16
10
|
import { ProfessionalProfile } from '../ProfessionalProfile'
|
|
17
11
|
import { AutoScroll } from '../AutoScroll'
|
|
18
12
|
import { ProfessionalInfo } from '../ProfessionalInfo'
|
|
13
|
+
import { SingleProfessionalCard } from '../SingleProfessionalCard'
|
|
19
14
|
|
|
20
15
|
export const ProfessionalFilter = (props) => {
|
|
21
16
|
const {
|
|
22
17
|
professionals,
|
|
23
18
|
professionalSelected,
|
|
24
|
-
handleChangeProfessionalSelected
|
|
19
|
+
handleChangeProfessionalSelected,
|
|
20
|
+
handleUpdateProfessionals
|
|
25
21
|
} = props
|
|
26
22
|
|
|
27
23
|
const [, t] = useLanguage()
|
|
@@ -30,22 +26,22 @@ export const ProfessionalFilter = (props) => {
|
|
|
30
26
|
const [currentProfessional, setCurrentProfessional] = useState(null)
|
|
31
27
|
|
|
32
28
|
const handleOpenProfile = (e, professional) => {
|
|
33
|
-
if (e.target.closest('.info')) return
|
|
29
|
+
if (e.target.closest('.info') || e.target.closest('.favorite')) return
|
|
34
30
|
setCurrentProfessional(professional)
|
|
35
31
|
setOpen(true)
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
const handleOpenReview = (professional) => {
|
|
39
|
-
setReviewOpen(true)
|
|
40
|
-
setCurrentProfessional(professional)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
34
|
const handleCloseProfile = () => {
|
|
44
35
|
setCurrentProfessional(null)
|
|
45
36
|
setOpen(false)
|
|
46
37
|
setReviewOpen(false)
|
|
47
38
|
}
|
|
48
39
|
|
|
40
|
+
const onUpdateProfessionals = (id, changes) => {
|
|
41
|
+
const updatedProfessional = professionals.find(professional => professional.id === id)
|
|
42
|
+
handleUpdateProfessionals({ ...updatedProfessional, ...changes })
|
|
43
|
+
}
|
|
44
|
+
|
|
49
45
|
return (
|
|
50
46
|
<>
|
|
51
47
|
<Container>
|
|
@@ -59,23 +55,15 @@ export const ProfessionalFilter = (props) => {
|
|
|
59
55
|
>
|
|
60
56
|
<p>{t('ANY_PROFESSIONAL_MEMBER', 'Any professional member')}</p>
|
|
61
57
|
</ProfessionalItem>
|
|
62
|
-
{professionals.map(
|
|
63
|
-
<
|
|
64
|
-
|
|
58
|
+
{professionals.map(professional => (
|
|
59
|
+
<SingleProfessionalCard
|
|
60
|
+
isSmallPhoto
|
|
61
|
+
handleProfessionalClick={handleOpenProfile}
|
|
65
62
|
active={professional?.id === professionalSelected?.id}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<p className='name'>{professional?.name} {professional?.lastname}</p>
|
|
71
|
-
<IconWrapper>
|
|
72
|
-
<InfoCircle className='info' onClick={() => handleOpenReview(professional)} />
|
|
73
|
-
<HeartIconWrapper>
|
|
74
|
-
{professional?.favorite ? <Like /> : <DisLike />}
|
|
75
|
-
</HeartIconWrapper>
|
|
76
|
-
</IconWrapper>
|
|
77
|
-
</InfoWrapper>
|
|
78
|
-
</ProfessionalItem>
|
|
63
|
+
key={professional.id}
|
|
64
|
+
professional={professional}
|
|
65
|
+
handleUpdateProfessionals={onUpdateProfessionals}
|
|
66
|
+
/>
|
|
79
67
|
))}
|
|
80
68
|
</AutoScroll>
|
|
81
69
|
</ProfessionalListing>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components'
|
|
2
|
-
import React from 'react'
|
|
3
2
|
|
|
4
3
|
export const Container = styled.div`
|
|
5
4
|
> h2 {
|
|
@@ -18,7 +17,7 @@ export const ProfessionalItem = styled.div`
|
|
|
18
17
|
border: 1px solid ${props => props.theme.colors.gray200};
|
|
19
18
|
border-radius: 7.6px;
|
|
20
19
|
cursor: pointer;
|
|
21
|
-
margin:
|
|
20
|
+
margin: 10px 6px;
|
|
22
21
|
transition: all 0.3s linear;
|
|
23
22
|
width: 205px;
|
|
24
23
|
min-width: 205px;
|
|
@@ -54,35 +53,6 @@ export const ProfessionalItem = styled.div`
|
|
|
54
53
|
`}
|
|
55
54
|
`
|
|
56
55
|
|
|
57
|
-
const ProfessionalPhotoStyled = styled.div`
|
|
58
|
-
box-sizing: border-box;
|
|
59
|
-
position: relative;
|
|
60
|
-
background-repeat: no-repeat, repeat;
|
|
61
|
-
background-size: cover;
|
|
62
|
-
background-position: center;
|
|
63
|
-
object-fit: cover;
|
|
64
|
-
height: 42px;
|
|
65
|
-
width: 42px;
|
|
66
|
-
min-width: 42px;
|
|
67
|
-
border-radius: 7.6px;
|
|
68
|
-
margin-right: 12px;
|
|
69
|
-
${props => props.theme.rtl && css`
|
|
70
|
-
margin-left: 12px;
|
|
71
|
-
margin-right: 0px;
|
|
72
|
-
`}
|
|
73
|
-
`
|
|
74
|
-
export const ProfessionalPhoto = (props) => {
|
|
75
|
-
const style = {}
|
|
76
|
-
if (props.bgimage) {
|
|
77
|
-
style.backgroundImage = `url(${props.bgimage})`
|
|
78
|
-
}
|
|
79
|
-
return (
|
|
80
|
-
<ProfessionalPhotoStyled {...props} style={style}>
|
|
81
|
-
{props.children}
|
|
82
|
-
</ProfessionalPhotoStyled>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
56
|
export const ContentWrapper = styled.div`
|
|
87
57
|
overflow: auto hidden;
|
|
88
58
|
width: 100%;
|
|
@@ -91,29 +61,3 @@ export const ContentWrapper = styled.div`
|
|
|
91
61
|
export const ProfessionalListing = styled.div`
|
|
92
62
|
display: flex;
|
|
93
63
|
`
|
|
94
|
-
|
|
95
|
-
export const InfoWrapper = styled.div`
|
|
96
|
-
width: calc(100% - 54px);
|
|
97
|
-
`
|
|
98
|
-
|
|
99
|
-
export const HeartIconWrapper = styled.span`
|
|
100
|
-
display: flex;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
align-items: center;
|
|
103
|
-
svg {
|
|
104
|
-
color: ${props => props.theme.colors.danger500};
|
|
105
|
-
font-size: 16px;
|
|
106
|
-
}
|
|
107
|
-
`
|
|
108
|
-
|
|
109
|
-
export const IconWrapper = styled.div`
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
.info {
|
|
113
|
-
margin-right: 10px;
|
|
114
|
-
${props => props.theme.rtl && css`
|
|
115
|
-
margin-left: 10px;
|
|
116
|
-
margin-right: 0px;
|
|
117
|
-
`}
|
|
118
|
-
}
|
|
119
|
-
`
|
|
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'
|
|
|
2
2
|
import { useTheme } from 'styled-components'
|
|
3
3
|
import { useLanguage, useConfig, useUtils, useOrderingTheme } from 'ordering-components-external'
|
|
4
4
|
import CgSearch from '@meronex/icons/cg/CgSearch'
|
|
5
|
-
import BsCaretLeftFill from '@meronex/icons/bs/BsCaretLeftFill'
|
|
6
5
|
import { Cart3 } from 'react-bootstrap-icons'
|
|
7
6
|
import { BusinessBasicInformation } from '../BusinessBasicInformation'
|
|
8
7
|
import { BusinessBasicInformation as BusinessBasicInformationRed } from '../../../../seven'
|
|
@@ -33,8 +32,7 @@ import {
|
|
|
33
32
|
ProfessionalFilterWrapper,
|
|
34
33
|
WrapperSearchAbsolute,
|
|
35
34
|
NearBusiness,
|
|
36
|
-
PageBannerWrapper
|
|
37
|
-
CategorySelectedContainer
|
|
35
|
+
PageBannerWrapper
|
|
38
36
|
} from './styles'
|
|
39
37
|
|
|
40
38
|
import { SearchProducts as SearchProductsOriginal } from '../../../../../themes/five/src/components/SearchProducts'
|
|
@@ -46,6 +44,7 @@ import { OrderItAgain } from '../OrderItAgain'
|
|
|
46
44
|
import { ProfessionalBusinessFilter } from '../ProfessionalBusinessFilter'
|
|
47
45
|
import { PageBanner } from '../PageBanner'
|
|
48
46
|
import { useWindowSize } from '../../../../../hooks/useWindowSize'
|
|
47
|
+
import { scrollTo } from '../../../../../utils'
|
|
49
48
|
|
|
50
49
|
const layoutOne = 'groceries'
|
|
51
50
|
|
|
@@ -86,7 +85,8 @@ export const RenderProductsLayout = (props) => {
|
|
|
86
85
|
professionalSelected,
|
|
87
86
|
onBusinessClick,
|
|
88
87
|
handleChangePriceFilterValues,
|
|
89
|
-
priceFilterValues
|
|
88
|
+
priceFilterValues,
|
|
89
|
+
handleUpdateProfessionals
|
|
90
90
|
} = props
|
|
91
91
|
|
|
92
92
|
const theme = useTheme()
|
|
@@ -121,6 +121,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
121
121
|
}
|
|
122
122
|
const showCartOnProductList = !orderingTheme?.theme?.business_view?.components?.cart?.components?.hidden
|
|
123
123
|
const hideBusinessNearCity = theme?.business_view?.components?.near_business?.hidden ?? true
|
|
124
|
+
const hidePreviousOrdered = theme?.business_view?.components?.products_ordered?.hidden
|
|
124
125
|
|
|
125
126
|
const BusinessLayoutCategories = businessLayout.layoutOne
|
|
126
127
|
? CategoriesLayoutGroceries
|
|
@@ -142,6 +143,19 @@ export const RenderProductsLayout = (props) => {
|
|
|
142
143
|
handleSaveProduct()
|
|
143
144
|
}, [categorySelected])
|
|
144
145
|
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (windowSize.width < 993 && categoryClicked && document.getElementsByClassName('category-title')) {
|
|
148
|
+
const extraHeight = 80
|
|
149
|
+
const top = document.getElementsByClassName('category-title')[0].offsetTop - extraHeight
|
|
150
|
+
window.scrollTo({
|
|
151
|
+
top: top,
|
|
152
|
+
behavior: 'smooth'
|
|
153
|
+
})
|
|
154
|
+
} else {
|
|
155
|
+
window.scroll(0, 0)
|
|
156
|
+
}
|
|
157
|
+
}, [categoryClicked])
|
|
158
|
+
|
|
145
159
|
return (
|
|
146
160
|
<>
|
|
147
161
|
{!isLoading && business?.id && (
|
|
@@ -172,6 +186,8 @@ export const RenderProductsLayout = (props) => {
|
|
|
172
186
|
errorQuantityProducts={errorQuantityProducts}
|
|
173
187
|
sortByValue={sortByValue}
|
|
174
188
|
categoryClicked={categoryClicked}
|
|
189
|
+
categorySelected={categorySelected}
|
|
190
|
+
setCategoryClicked={setCategoryClicked}
|
|
175
191
|
/>
|
|
176
192
|
)}
|
|
177
193
|
|
|
@@ -193,6 +209,13 @@ export const RenderProductsLayout = (props) => {
|
|
|
193
209
|
</WrapperSearch>
|
|
194
210
|
</>
|
|
195
211
|
)}
|
|
212
|
+
{!business?.loading && business?.previously_products?.length > 0 && !hidePreviousOrdered && windowSize.width < 993 && !categoryClicked && (
|
|
213
|
+
<OrderItAgain
|
|
214
|
+
onProductClick={onProductClick}
|
|
215
|
+
productList={business?.previously_products}
|
|
216
|
+
businessId={business?.id}
|
|
217
|
+
/>
|
|
218
|
+
)}
|
|
196
219
|
{!businessLayout.layoutOne && (
|
|
197
220
|
<BusinessContent isCustomLayout={isCustomLayout || useKioskApp} id='wrapper-categories'>
|
|
198
221
|
<BusinessCategoryProductWrapper showCartOnProductList={showCartOnProductList}>
|
|
@@ -212,6 +235,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
212
235
|
professionals={business?.professionals}
|
|
213
236
|
professionalSelected={professionalSelected}
|
|
214
237
|
handleChangeProfessionalSelected={handleChangeProfessionalSelected}
|
|
238
|
+
handleUpdateProfessionals={handleUpdateProfessionals}
|
|
215
239
|
/>
|
|
216
240
|
</ProfessionalFilterWrapper>
|
|
217
241
|
</>
|
|
@@ -267,13 +291,6 @@ export const RenderProductsLayout = (props) => {
|
|
|
267
291
|
)}
|
|
268
292
|
</div>
|
|
269
293
|
<WrapContent id='businessProductList'>
|
|
270
|
-
{!business?.loading && business?.previously_products?.length > 0 && (
|
|
271
|
-
<OrderItAgain
|
|
272
|
-
onProductClick={onProductClick}
|
|
273
|
-
productList={business?.previously_products}
|
|
274
|
-
businessId={business?.id}
|
|
275
|
-
/>
|
|
276
|
-
)}
|
|
277
294
|
<BusinessLayoutProductsList
|
|
278
295
|
categories={[
|
|
279
296
|
{ id: null, name: t('ALL', theme?.defaultLanguages?.ALL || 'All') },
|
|
@@ -320,6 +337,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
320
337
|
isProducts={currentCart.products.length}
|
|
321
338
|
isCartOnProductsList={isCartOnProductsList}
|
|
322
339
|
handleCartOpen={handleCartOpen}
|
|
340
|
+
businessConfigs={business?.configs}
|
|
323
341
|
/>
|
|
324
342
|
</>
|
|
325
343
|
) : (
|
|
@@ -348,6 +366,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
348
366
|
professionals={business?.professionals}
|
|
349
367
|
professionalSelected={professionalSelected}
|
|
350
368
|
handleChangeProfessionalSelected={handleChangeProfessionalSelected}
|
|
369
|
+
handleUpdateProfessionals={handleUpdateProfessionals}
|
|
351
370
|
/>
|
|
352
371
|
</ProfessionalFilterWrapper>
|
|
353
372
|
)}
|
|
@@ -355,7 +374,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
355
374
|
<BusinessCategoriesContainer offSticky>
|
|
356
375
|
{!(business?.categories?.length === 0 && !categoryId) && (
|
|
357
376
|
<>
|
|
358
|
-
{(!categoryClicked || windowSize.width >= 993)
|
|
377
|
+
{(!categoryClicked || windowSize.width >= 993) && (
|
|
359
378
|
<BusinessLayoutCategories
|
|
360
379
|
component='categories'
|
|
361
380
|
categories={[
|
|
@@ -373,10 +392,6 @@ export const RenderProductsLayout = (props) => {
|
|
|
373
392
|
useKioskApp={useKioskApp}
|
|
374
393
|
setCategoryClicked={setCategoryClicked}
|
|
375
394
|
/>
|
|
376
|
-
) : (
|
|
377
|
-
<CategorySelectedContainer onClick={() => setCategoryClicked(false)}>
|
|
378
|
-
<BsCaretLeftFill /> {categorySelected?.name}
|
|
379
|
-
</CategorySelectedContainer>
|
|
380
395
|
)}
|
|
381
396
|
</>
|
|
382
397
|
)}
|
|
@@ -384,7 +399,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
384
399
|
{(categoryClicked || windowSize.width >= 993) && (
|
|
385
400
|
<BusinessCategoryProductWrapper>
|
|
386
401
|
<WrapContent isGroceries id='groceries'>
|
|
387
|
-
{!business?.loading && business?.previously_products?.length > 0 && (
|
|
402
|
+
{!business?.loading && business?.previously_products?.length > 0 && windowSize.width >= 993 && (
|
|
388
403
|
<OrderItAgain
|
|
389
404
|
onProductClick={onProductClick}
|
|
390
405
|
productList={business?.previously_products}
|
|
@@ -484,6 +499,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
484
499
|
isProducts={currentCart.products.length}
|
|
485
500
|
isCartOnProductsList={isCartOnProductsList}
|
|
486
501
|
handleCartOpen={handleCartOpen}
|
|
502
|
+
businessConfigs={business?.configs}
|
|
487
503
|
/>
|
|
488
504
|
</>
|
|
489
505
|
) : (
|
|
@@ -224,21 +224,3 @@ export const PageBannerWrapper = styled.div`
|
|
|
224
224
|
border-radius: 8px;
|
|
225
225
|
}
|
|
226
226
|
`
|
|
227
|
-
|
|
228
|
-
export const CategorySelectedContainer = styled.div`
|
|
229
|
-
display: inline;
|
|
230
|
-
margin-left: 10px;
|
|
231
|
-
color: ${({ theme }) => theme?.colors?.primary};
|
|
232
|
-
padding-right: 5px;
|
|
233
|
-
cursor: pointer;
|
|
234
|
-
p{
|
|
235
|
-
margin: 0;
|
|
236
|
-
}
|
|
237
|
-
svg {
|
|
238
|
-
position: relative;
|
|
239
|
-
top: 2px;
|
|
240
|
-
margin-right: 3px;
|
|
241
|
-
width: 14px;
|
|
242
|
-
height: 14px;
|
|
243
|
-
}
|
|
244
|
-
`
|
|
@@ -36,7 +36,6 @@ import {
|
|
|
36
36
|
NameWrapper,
|
|
37
37
|
StatusInfo,
|
|
38
38
|
DropDownWrapper,
|
|
39
|
-
DropDownTitle,
|
|
40
39
|
EmptyProfessional,
|
|
41
40
|
SkeletonBlock,
|
|
42
41
|
OrderTimeWrapper,
|
|
@@ -143,16 +142,24 @@ const ServiceFormUI = (props) => {
|
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
const isBusyTime = (professional) => {
|
|
146
|
-
if (
|
|
145
|
+
if (!dateSelected) return false
|
|
146
|
+
const startDay = moment(dateSelected).utc().format('d')
|
|
147
|
+
const isStartScheduleEnabled = professional?.schedule?.[startDay]?.enabled
|
|
147
148
|
const duration = product?.duration ?? 0
|
|
149
|
+
const endDay = moment(dateSelected).add(duration - 1, 'minutes').utc().format('d')
|
|
150
|
+
const isEndScheduleEnabled = professional?.schedule?.[endDay]?.enabled
|
|
151
|
+
if (!isStartScheduleEnabled || !isEndScheduleEnabled) return true
|
|
152
|
+
|
|
153
|
+
if (professional?.busy_times?.length === 0) return false
|
|
154
|
+
|
|
148
155
|
const busyTimes = isCartProduct
|
|
149
156
|
? professional?.busy_times.filter(item => !(item.start === productCart?.calendar_event?.start && item.end === productCart?.calendar_event?.end))
|
|
150
157
|
: [...professional?.busy_times]
|
|
151
158
|
const valid = busyTimes.some(item => {
|
|
152
159
|
return (moment.utc(item?.start).local().valueOf() <= moment(dateSelected).valueOf() &&
|
|
153
|
-
moment(dateSelected).valueOf()
|
|
160
|
+
moment(dateSelected).valueOf() < moment.utc(item?.end).local().valueOf()) ||
|
|
154
161
|
(moment.utc(item?.start).local().valueOf() <= moment(dateSelected).add(duration, 'minutes').valueOf() &&
|
|
155
|
-
moment(dateSelected).add(duration, 'minutes').valueOf()
|
|
162
|
+
moment(dateSelected).add(duration, 'minutes').valueOf() < moment.utc(item?.end).local().valueOf())
|
|
156
163
|
})
|
|
157
164
|
return valid
|
|
158
165
|
}
|
|
@@ -328,7 +335,6 @@ const ServiceFormUI = (props) => {
|
|
|
328
335
|
</SelectedItem>
|
|
329
336
|
{isDropDown && (
|
|
330
337
|
<DropDownWrapper>
|
|
331
|
-
<DropDownTitle>{t('ANY_PROFESSIONAL_MEMBER', 'Any professional member')}</DropDownTitle>
|
|
332
338
|
{professionalListState?.professionals?.map((professional) => (
|
|
333
339
|
<SelectedItem
|
|
334
340
|
key={professional?.id}
|
|
@@ -213,7 +213,7 @@ export const SelectedItem = styled.div`
|
|
|
213
213
|
${({ isDropDown }) => isDropDown && css`
|
|
214
214
|
border: none;
|
|
215
215
|
padding: 12px 0px;
|
|
216
|
-
border-
|
|
216
|
+
border-bottom: 1px solid ${props => props.theme.colors.gray200};
|
|
217
217
|
border-radius: 0px;
|
|
218
218
|
&:hover {
|
|
219
219
|
background-color: ${props => props.theme.colors.grayDividerColor};
|
|
@@ -225,14 +225,6 @@ export const SelectedItem = styled.div`
|
|
|
225
225
|
`}
|
|
226
226
|
`
|
|
227
227
|
|
|
228
|
-
export const DropDownTitle = styled.h1`
|
|
229
|
-
margin-top: 0px;
|
|
230
|
-
margin-bottom: 18px;
|
|
231
|
-
font-weight: 400;
|
|
232
|
-
font-size: 14px;
|
|
233
|
-
line-height: 24px;
|
|
234
|
-
`
|
|
235
|
-
|
|
236
228
|
export const InfoWrapper = styled.div`
|
|
237
229
|
display: flex;
|
|
238
230
|
align-items: center;
|
|
@@ -324,6 +324,12 @@ const SignUpFormUI = (props) => {
|
|
|
324
324
|
}
|
|
325
325
|
}, [recaptchaConfig])
|
|
326
326
|
|
|
327
|
+
const preventWhiteSpaceOnKeyDown = (e) => {
|
|
328
|
+
if (e.key === " ") {
|
|
329
|
+
e.preventDefault()
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
327
333
|
return (
|
|
328
334
|
<>
|
|
329
335
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -417,6 +423,7 @@ const SignUpFormUI = (props) => {
|
|
|
417
423
|
: null,
|
|
418
424
|
pattern: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i
|
|
419
425
|
})}
|
|
426
|
+
onKeyDown={preventWhiteSpaceOnKeyDown}
|
|
420
427
|
required={!!field.required}
|
|
421
428
|
autoComplete='on'
|
|
422
429
|
isError={formMethods.errors?.email && !notValidationFields.includes(field.code)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { useLanguage, useUtils, useConfig, useOrder,
|
|
2
|
+
import { useLanguage, useUtils, useConfig, useOrder, SingleOrderCard as SingleOrderCardController } from 'ordering-components-external'
|
|
3
3
|
import { Heart as DisLike, HeartFill as Like } from 'react-bootstrap-icons'
|
|
4
4
|
import { ReviewOrder } from '../ReviewOrder'
|
|
5
5
|
import { ReviewProduct } from '../ReviewProduct'
|
|
@@ -12,6 +12,7 @@ import { Button } from '../../styles/Buttons'
|
|
|
12
12
|
import Skeleton from 'react-loading-skeleton'
|
|
13
13
|
import { Modal } from '../Modal'
|
|
14
14
|
import { Confirm } from '../Confirm'
|
|
15
|
+
import { OrderEta } from '../OrderDetails/OrderEta'
|
|
15
16
|
import {
|
|
16
17
|
Container,
|
|
17
18
|
Content,
|
|
@@ -51,7 +52,6 @@ const SingleOrderCardUI = (props) => {
|
|
|
51
52
|
const [{ carts }] = useOrder()
|
|
52
53
|
const [{ parsePrice, parseDate, optimizeImage }] = useUtils()
|
|
53
54
|
const [{ configs }] = useConfig()
|
|
54
|
-
const [orderingTheme] = useOrderingTheme()
|
|
55
55
|
const [isReviewOpen, setIsReviewOpen] = useState(false)
|
|
56
56
|
const [reviewStatus, setReviewStatus] = useState({ order: false, product: false, driver: false })
|
|
57
57
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
@@ -128,8 +128,14 @@ const SingleOrderCardUI = (props) => {
|
|
|
128
128
|
handleReorder(order.id)
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
const
|
|
132
|
-
const
|
|
131
|
+
const hideBusinessLogo = theme?.orders?.components?.business_logo?.hidden
|
|
132
|
+
const hideDate = theme?.orders?.components?.date?.hidden
|
|
133
|
+
const hideBusinessName = theme?.orders?.components?.business_name?.hidden
|
|
134
|
+
const hideOrderNumber = theme?.orders?.components?.order_number?.hidden
|
|
135
|
+
const hideReviewOrderButton = theme?.orders?.components?.review_order_button?.hidden
|
|
136
|
+
const hideReorderButton = theme?.orders?.components?.reorder_button?.hidden
|
|
137
|
+
const hideFavorite = theme?.orders?.components?.favorite?.hidden
|
|
138
|
+
const hideOrderStatus = theme?.orders?.components?.order_status?.hidden
|
|
133
139
|
|
|
134
140
|
return (
|
|
135
141
|
<>
|
|
@@ -151,7 +157,7 @@ const SingleOrderCardUI = (props) => {
|
|
|
151
157
|
<Skeleton width={60} height={60} />
|
|
152
158
|
) : (
|
|
153
159
|
<>
|
|
154
|
-
{!isCustomerMode &&
|
|
160
|
+
{!isCustomerMode && !hideBusinessLogo && (
|
|
155
161
|
<>
|
|
156
162
|
{order?.business?.length > 1 ? (
|
|
157
163
|
<MultiLogosContainer>
|
|
@@ -173,7 +179,7 @@ const SingleOrderCardUI = (props) => {
|
|
|
173
179
|
)}
|
|
174
180
|
</>
|
|
175
181
|
)}
|
|
176
|
-
{isCustomerMode &&
|
|
182
|
+
{isCustomerMode && !hideBusinessLogo && (
|
|
177
183
|
<>
|
|
178
184
|
{(order.business?.logo || theme.images?.dummies?.businessLogo) && (
|
|
179
185
|
<Logo>
|
|
@@ -186,17 +192,21 @@ const SingleOrderCardUI = (props) => {
|
|
|
186
192
|
)}
|
|
187
193
|
|
|
188
194
|
<BusinessInformation activeOrders isMultiCart={order?.business?.length > 1}>
|
|
189
|
-
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
195
|
+
{!hideBusinessName && (
|
|
196
|
+
<>
|
|
197
|
+
{isCustomerMode ? (
|
|
198
|
+
<TitleContainer>
|
|
199
|
+
<h2>{isSkeleton ? <Skeleton width={120} /> : order.business?.name}</h2>
|
|
200
|
+
<Price isBusinessesPage={isBusinessesPage} isCustomerMode={isCustomerMode}>
|
|
201
|
+
<h2>
|
|
202
|
+
{isSkeleton ? <Skeleton width={50} /> : parsePrice(order?.summary?.total || order?.total)}
|
|
203
|
+
</h2>
|
|
204
|
+
</Price>
|
|
205
|
+
</TitleContainer>
|
|
206
|
+
) : (
|
|
207
|
+
<h2>{isSkeleton ? <Skeleton width={120} /> : order?.business?.length > 1 ? `${t('GROUP_ORDER', 'Group Order')} ${t('No', 'No')}. ${order?.cart_group_id}` : order.business?.name}</h2>
|
|
208
|
+
)}
|
|
209
|
+
</>
|
|
200
210
|
)}
|
|
201
211
|
{
|
|
202
212
|
isSkeleton ? (
|
|
@@ -205,18 +215,23 @@ const SingleOrderCardUI = (props) => {
|
|
|
205
215
|
</div>
|
|
206
216
|
) : (
|
|
207
217
|
<div className='orders-detail'>
|
|
208
|
-
{order?.id && (
|
|
218
|
+
{order?.id && !hideOrderNumber && (
|
|
209
219
|
<>
|
|
210
220
|
<BsDot />
|
|
211
221
|
<p name='order_number'>{order?.business?.length > 1 ? `${order?.business?.length} ${t('ORDERS', 'orders')}` : `${t('ORDER_NUM', 'Order No.')} ${order.id}`}</p>
|
|
212
222
|
</>
|
|
213
223
|
)}
|
|
214
|
-
{
|
|
224
|
+
{!hideDate && (
|
|
215
225
|
<>
|
|
216
226
|
<BsDot />
|
|
217
|
-
<p>
|
|
218
|
-
|
|
219
|
-
|
|
227
|
+
<p>
|
|
228
|
+
{
|
|
229
|
+
pastOrders
|
|
230
|
+
? order?.delivery_datetime_utc
|
|
231
|
+
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY hh:mm A' })
|
|
232
|
+
: parseDate(order?.delivery_datetime, { utc: false })
|
|
233
|
+
: <OrderEta order={order} />
|
|
234
|
+
}
|
|
220
235
|
</p>
|
|
221
236
|
</>
|
|
222
237
|
|
|
@@ -224,7 +239,9 @@ const SingleOrderCardUI = (props) => {
|
|
|
224
239
|
</div>
|
|
225
240
|
)
|
|
226
241
|
}
|
|
227
|
-
|
|
242
|
+
{!hideOrderStatus && (
|
|
243
|
+
<p className='order-status'>{isSkeleton ? <Skeleton width={80} /> : getOrderStatus(order.status)?.value}</p>
|
|
244
|
+
)}
|
|
228
245
|
</BusinessInformation>
|
|
229
246
|
{!isCustomerMode && (
|
|
230
247
|
<Price isBusinessesPage={isBusinessesPage}>
|
|
@@ -239,7 +256,7 @@ const SingleOrderCardUI = (props) => {
|
|
|
239
256
|
)}
|
|
240
257
|
{pastOrders && !isCustomerMode && (
|
|
241
258
|
<ButtonWrapper>
|
|
242
|
-
{!isOrderReviewed && !isFavorite && (!order?.review || (order.driver && !order?.user_review)) && (
|
|
259
|
+
{!isOrderReviewed && !isFavorite && (!order?.review || (order.driver && !order?.user_review)) && !hideReviewOrderButton && (
|
|
243
260
|
<Button
|
|
244
261
|
outline
|
|
245
262
|
color='primary'
|
|
@@ -249,14 +266,14 @@ const SingleOrderCardUI = (props) => {
|
|
|
249
266
|
{t('REVIEW', 'Review')}
|
|
250
267
|
</Button>
|
|
251
268
|
)}
|
|
252
|
-
{order.cart && (
|
|
269
|
+
{order.cart && !hideReorderButton && (
|
|
253
270
|
<Button color='primary' className='reorder' outline onClick={() => handleClickReorder(order)}>
|
|
254
271
|
{cartState?.loading ? t('LOADING', 'Loading...') : t('REORDER', 'Reorder')}
|
|
255
272
|
</Button>
|
|
256
273
|
)}
|
|
257
274
|
</ButtonWrapper>
|
|
258
275
|
)}
|
|
259
|
-
{!order?.business?.length && (
|
|
276
|
+
{!order?.business?.length && !hideFavorite && (
|
|
260
277
|
<FavoriteWrapper onClick={() => handleChangeFavorite(order)} className='favorite'>
|
|
261
278
|
{isSkeleton ? <Skeleton width={20} height={20} /> : (
|
|
262
279
|
<>
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
CardContainer,
|
|
16
16
|
CardInfo,
|
|
17
17
|
WrapLogo,
|
|
18
|
+
WrapTags,
|
|
18
19
|
CardLogo,
|
|
19
20
|
SoldOut,
|
|
20
21
|
PriceWrapper,
|
|
@@ -167,11 +168,20 @@ const SingleProductCardUI = (props) => {
|
|
|
167
168
|
)}
|
|
168
169
|
</TitleWrapper>
|
|
169
170
|
{!isSkeleton ? (
|
|
170
|
-
<PriceWrapper>
|
|
171
|
-
<span>{product?.price ? parsePrice(product?.price) : ''}</span>
|
|
171
|
+
<PriceWrapper isOffPrice={product?.offer_price && product?.in_offer}>
|
|
172
|
+
<span className='current-price'>{product?.price ? parsePrice(product?.price) : ''}</span>
|
|
172
173
|
{!(isSoldOut || maxProductQuantity <= 0) && (
|
|
173
174
|
<span className='off-price'>{product?.offer_price && product?.in_offer ? parsePrice(product?.offer_price) : ''}</span>
|
|
174
175
|
)}
|
|
176
|
+
{product?.tags && product?.tags.length > 0 && (
|
|
177
|
+
<WrapTags>
|
|
178
|
+
{product?.tags.map((tag, i) => (
|
|
179
|
+
<div key={i}>
|
|
180
|
+
<img src={tag.image ?? ''}></img>
|
|
181
|
+
</div>
|
|
182
|
+
))}
|
|
183
|
+
</WrapTags>
|
|
184
|
+
)}
|
|
175
185
|
</PriceWrapper>
|
|
176
186
|
) : (
|
|
177
187
|
<Skeleton width={100} />
|