ordering-ui-external 2.0.4 → 2.1.1
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 +8 -1
- 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 +8 -56
- 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/PageBanner/index.js +120 -6
- 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 +7 -1
- 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 +33 -79
- 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/PageBanner/index.js +96 -4
- 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
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
PaymentOptions as PaymentOptionsController,
|
|
12
12
|
useLanguage,
|
|
13
13
|
useOrder,
|
|
14
|
-
useSession
|
|
14
|
+
useSession,
|
|
15
|
+
useValidationFields
|
|
15
16
|
} from 'ordering-components-external'
|
|
16
17
|
|
|
17
18
|
import { Modal } from '../Modal'
|
|
@@ -30,7 +31,8 @@ import {
|
|
|
30
31
|
PaymentMethodsList,
|
|
31
32
|
PayCard,
|
|
32
33
|
PayCardSelected,
|
|
33
|
-
CardItemContent
|
|
34
|
+
CardItemContent,
|
|
35
|
+
Container
|
|
34
36
|
} from './styles'
|
|
35
37
|
|
|
36
38
|
const stripeOptions = ['stripe_direct', 'stripe', 'stripe_connect']
|
|
@@ -100,8 +102,9 @@ const PaymentOptionsUI = (props) => {
|
|
|
100
102
|
} = props
|
|
101
103
|
const [, t] = useLanguage()
|
|
102
104
|
const [{ token }] = useSession()
|
|
105
|
+
const [{ options }] = useOrder()
|
|
103
106
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
104
|
-
|
|
107
|
+
const [validationFields] = useValidationFields()
|
|
105
108
|
const paymethodSelected = props.paySelected || props.paymethodSelected
|
|
106
109
|
|
|
107
110
|
const methodsPay = ['google_pay', 'apple_pay']
|
|
@@ -116,11 +119,25 @@ const PaymentOptionsUI = (props) => {
|
|
|
116
119
|
const supportedMethods = list?.filter(p => useKioskApp ? includeKioskPaymethods.includes(p.gateway) : p)
|
|
117
120
|
|
|
118
121
|
const handlePaymentMethodClick = (paymethod) => {
|
|
122
|
+
if (paymethod?.gateway === 'paypal' &&
|
|
123
|
+
options.type === 1 &&
|
|
124
|
+
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
125
|
+
validationFields?.fields?.checkout?.driver_tip?.required &&
|
|
126
|
+
(Number(cart?.driver_tip) <= 0)
|
|
127
|
+
) {
|
|
128
|
+
setAlertState({
|
|
129
|
+
open: true,
|
|
130
|
+
content: [t('DRIVER_TIPS_REQUIRED', 'Driver tips is required, please select a driver tip before select this paymethod')]
|
|
131
|
+
})
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
|
|
119
135
|
if (cart?.balance > 0) {
|
|
120
136
|
const isPopupMethod = popupMethods.includes(paymethod?.gateway)
|
|
121
137
|
handlePaymethodClick(paymethod, isPopupMethod)
|
|
122
138
|
return
|
|
123
139
|
}
|
|
140
|
+
|
|
124
141
|
setAlertState({
|
|
125
142
|
open: true,
|
|
126
143
|
content: [t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method')]
|
|
@@ -227,7 +244,6 @@ const PaymentOptionsUI = (props) => {
|
|
|
227
244
|
setErrorCash={props.setErrorCash}
|
|
228
245
|
/>
|
|
229
246
|
)}
|
|
230
|
-
|
|
231
247
|
{isOpenMethod?.paymethod?.gateway === 'stripe' && isOpenMethod.paymethod?.gateway === 'stripe' && (
|
|
232
248
|
<PaymentOptionStripe
|
|
233
249
|
paymethod={isOpenMethod?.paymethod}
|
|
@@ -310,7 +326,12 @@ const PaymentOptionsUI = (props) => {
|
|
|
310
326
|
className='modal-info'
|
|
311
327
|
onClose={() => handlePaymethodClick(null)}
|
|
312
328
|
>
|
|
313
|
-
{
|
|
329
|
+
{!isOpenMethod?.paymethod?.credentials?.publishable &&
|
|
330
|
+
<Container>
|
|
331
|
+
<p>{t('ADD_PUBLISHABLE_KEY', 'Please add a stripe key')}</p>
|
|
332
|
+
</Container>
|
|
333
|
+
}
|
|
334
|
+
{isOpenMethod?.paymethod?.credentials?.publishable && stripeDirectMethods?.includes(isOpenMethod?.paymethod?.gateway) && (
|
|
314
335
|
<StripeElementsForm
|
|
315
336
|
methodsPay={methodsPay}
|
|
316
337
|
paymethod={isOpenMethod?.paymethod?.gateway}
|
|
@@ -92,11 +92,18 @@ export const QuantityControl = styled.div`
|
|
|
92
92
|
svg {
|
|
93
93
|
color: ${props => props.theme.colors.primary};
|
|
94
94
|
font-size: 20px;
|
|
95
|
-
margin-right:
|
|
95
|
+
margin-right: 6px;
|
|
96
96
|
${props => props.theme?.rtl && css`
|
|
97
|
-
margin-left:
|
|
97
|
+
margin-left: 6px;
|
|
98
98
|
margin-right: 0px;
|
|
99
99
|
`}
|
|
100
|
+
@media (min-width: 425px) {
|
|
101
|
+
margin-right: 3px
|
|
102
|
+
${props => props.theme?.rtl && css`
|
|
103
|
+
margin-right: 3px;
|
|
104
|
+
margin-left: 0px;
|
|
105
|
+
`}
|
|
106
|
+
}
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
svg[disabled] {
|
|
@@ -104,12 +111,20 @@ export const QuantityControl = styled.div`
|
|
|
104
111
|
}
|
|
105
112
|
|
|
106
113
|
svg:last-child {
|
|
107
|
-
margin-left:
|
|
114
|
+
margin-left: 6px;
|
|
108
115
|
margin-right: 0;
|
|
109
116
|
${props => props.theme?.rtl && css`
|
|
110
|
-
margin-right:
|
|
117
|
+
margin-right: 6px;
|
|
111
118
|
margin-left: 0px;
|
|
112
119
|
`}
|
|
120
|
+
@media (min-width: 425px) {
|
|
121
|
+
margin-left: 3px;
|
|
122
|
+
margin-right: 0;
|
|
123
|
+
${props => props.theme?.rtl && css`
|
|
124
|
+
margin-right: 3px;
|
|
125
|
+
margin-left: 0px;
|
|
126
|
+
`}
|
|
127
|
+
}
|
|
113
128
|
}
|
|
114
129
|
`
|
|
115
130
|
|
|
@@ -167,7 +182,12 @@ export const LeftOptionContainer = styled.div`
|
|
|
167
182
|
|
|
168
183
|
export const RightOptionContainer = styled.div`
|
|
169
184
|
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
170
186
|
width: 25%;
|
|
171
187
|
align-items: center;
|
|
172
188
|
justify-content: space-between;
|
|
189
|
+
|
|
190
|
+
@media (min-width: 425px) {
|
|
191
|
+
flex-direction: row;
|
|
192
|
+
}
|
|
173
193
|
`
|
|
@@ -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)}
|