ordering-ui-external 2.1.3 → 2.2.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.7ab84608232e3f5c3b4b.js → 0.ordering-ui.bdd6b221a4d558a752fc.js} +1 -1
- package/_bundles/{1.ordering-ui.7ab84608232e3f5c3b4b.js → 1.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{2.ordering-ui.7ab84608232e3f5c3b4b.js → 2.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{4.ordering-ui.7ab84608232e3f5c3b4b.js → 4.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{5.ordering-ui.7ab84608232e3f5c3b4b.js → 5.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{6.ordering-ui.7ab84608232e3f5c3b4b.js → 6.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{7.ordering-ui.7ab84608232e3f5c3b4b.js → 7.ordering-ui.bdd6b221a4d558a752fc.js} +1 -1
- package/_bundles/{7.ordering-ui.7ab84608232e3f5c3b4b.js.LICENSE.txt → 7.ordering-ui.bdd6b221a4d558a752fc.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.7ab84608232e3f5c3b4b.js → 8.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{9.ordering-ui.7ab84608232e3f5c3b4b.js → 9.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{ordering-ui.7ab84608232e3f5c3b4b.js → ordering-ui.bdd6b221a4d558a752fc.js} +2 -2
- package/_bundles/{ordering-ui.7ab84608232e3f5c3b4b.js.LICENSE.txt → ordering-ui.bdd6b221a4d558a752fc.js.LICENSE.txt} +0 -0
- package/_modules/hooks/useIntersectionObserver.js +6 -5
- package/_modules/styles/Toast/index.js +4 -3
- package/_modules/themes/five/src/components/AddressDetails/index.js +1 -1
- package/_modules/themes/five/src/components/AddressDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessListingSearch/Accordion/index.js +43 -0
- package/_modules/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +16 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +26 -13
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +43 -41
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +23 -4
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +38 -22
- package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +23 -17
- package/_modules/themes/five/src/components/Cart/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +24 -19
- package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
- package/_modules/themes/five/src/components/DriverTips/index.js +6 -2
- package/_modules/themes/five/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/Help/index.js +1 -1
- package/_modules/themes/five/src/components/LastOrders/index.js +3 -8
- package/_modules/themes/five/src/components/MessagesListing/index.js +2 -2
- package/_modules/themes/five/src/components/MessagesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/index.js +1 -1
- package/_modules/themes/five/src/components/MyOrders/index.js +1 -3
- package/_modules/themes/five/src/components/NotFoundSource/index.js +3 -11
- package/_modules/themes/five/src/components/NotFoundSource/styles.js +2 -2
- package/_modules/themes/five/src/components/OrderContextUI/index.js +2 -1
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +14 -11
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +1 -1
- package/_modules/themes/five/src/components/ServiceForm/index.js +16 -11
- package/_modules/themes/five/src/components/ServiceForm/styles.js +16 -5
- package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserPopover/index.js +6 -0
- package/_modules/themes/five/src/components/UserProfileForm/index.js +0 -2
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +1 -1
- package/_modules/themes/five/src/components/WalletTransactionItem/index.js +4 -2
- package/_modules/themes/five/src/components/Wallets/index.js +4 -4
- package/_modules/themes/five/src/components/Wallets/styles.js +33 -12
- package/_modules/themes/five/src/styles/Buttons/index.js +3 -1
- package/_modules/themes/pwa/src/components/MomentControl/index.js +7 -9
- package/_modules/utils/index.js +28 -2
- package/package.json +2 -2
- package/src/hooks/useIntersectionObserver.js +7 -6
- package/src/styles/Toast/index.js +4 -2
- package/src/themes/five/src/components/AddressDetails/index.js +1 -1
- package/src/themes/five/src/components/AddressDetails/styles.js +4 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +3 -1
- package/src/themes/five/src/components/BusinessItemAccordion/styles.js +9 -3
- package/src/themes/five/src/components/BusinessListingSearch/Accordion/index.js +23 -0
- package/src/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +28 -17
- package/src/themes/five/src/components/BusinessListingSearch/index.js +65 -66
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +21 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +24 -0
- package/src/themes/five/src/components/BusinessPreorder/styles.js +11 -1
- package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +7 -3
- package/src/themes/five/src/components/BusinessProductsList/styles.js +3 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +11 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +11 -1
- package/src/themes/five/src/components/Cart/styles.js +3 -1
- package/src/themes/five/src/components/Checkout/index.js +49 -62
- package/src/themes/five/src/components/Checkout/styles.js +3 -1
- package/src/themes/five/src/components/DriverTips/index.js +7 -2
- package/src/themes/five/src/components/Header/styles.js +4 -2
- package/src/themes/five/src/components/Help/index.js +0 -1
- package/src/themes/five/src/components/LastOrders/index.js +25 -28
- package/src/themes/five/src/components/MessagesListing/index.js +2 -2
- package/src/themes/five/src/components/MessagesListing/styles.js +3 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +13 -13
- package/src/themes/five/src/components/MyOrders/index.js +0 -3
- package/src/themes/five/src/components/NotFoundSource/index.js +5 -10
- package/src/themes/five/src/components/NotFoundSource/styles.js +7 -2
- package/src/themes/five/src/components/OrderContextUI/index.js +1 -1
- package/src/themes/five/src/components/OrderContextUI/styles.js +4 -2
- package/src/themes/five/src/components/PageBanner/styles.js +1 -0
- package/src/themes/five/src/components/ReviewProduct/styles.js +3 -3
- package/src/themes/five/src/components/ServiceForm/index.js +20 -14
- package/src/themes/five/src/components/ServiceForm/styles.js +11 -3
- package/src/themes/five/src/components/UserDetails/index.js +2 -2
- package/src/themes/five/src/components/UserDetails/styles.js +3 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +0 -1
- package/src/themes/five/src/components/UserPopover/index.js +2 -0
- package/src/themes/five/src/components/UserProfileForm/index.js +0 -3
- package/src/themes/five/src/components/UserProfileForm/styles.js +0 -5
- package/src/themes/five/src/components/WalletTransactionItem/index.js +4 -1
- package/src/themes/five/src/components/Wallets/index.js +101 -95
- package/src/themes/five/src/components/Wallets/styles.js +37 -17
- package/src/themes/five/src/styles/Buttons/index.js +4 -0
- package/src/themes/pwa/src/components/MomentControl/index.js +6 -11
- package/src/utils/index.js +38 -12
- package/template/pages/Home/index.js +3 -0
|
@@ -10,7 +10,8 @@ export const NotFound = styled.div`
|
|
|
10
10
|
margin: 20px auto;
|
|
11
11
|
|
|
12
12
|
h1 {
|
|
13
|
-
font-size:
|
|
13
|
+
font-size: 20px;
|
|
14
|
+
opacity: 0.5;
|
|
14
15
|
line-height: 24px;
|
|
15
16
|
text-align: center;
|
|
16
17
|
color: ${props => props.theme.colors?.headingColor};
|
|
@@ -24,7 +25,11 @@ export const NotFound = styled.div`
|
|
|
24
25
|
`
|
|
25
26
|
|
|
26
27
|
export const NotFoundImage = styled.div`
|
|
27
|
-
|
|
28
|
+
svg {
|
|
29
|
+
width: 150px;
|
|
30
|
+
height: 120px;
|
|
31
|
+
opacity: 0.5;
|
|
32
|
+
}
|
|
28
33
|
`
|
|
29
34
|
|
|
30
35
|
export const ButtonWrapper = styled.div`
|
|
@@ -67,7 +67,7 @@ export const OrderContextUI = (props) => {
|
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
69
|
<>
|
|
70
|
-
<Container isBusinessList={isBusinessList}>
|
|
70
|
+
<Container isBusinessList={isBusinessList} hero={props.hideHero} >
|
|
71
71
|
<AddressMenu
|
|
72
72
|
onClick={() => handleClickAddress()}
|
|
73
73
|
isCheckOut={isCheckOut}
|
|
@@ -2,12 +2,14 @@ import styled, { css } from 'styled-components'
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
4
|
${({ isBusinessList }) => isBusinessList && css`
|
|
5
|
-
position: absolute;
|
|
6
|
-
top: 10%;
|
|
7
5
|
width: 100%;
|
|
8
6
|
padding: 0 15px;
|
|
9
7
|
box-sizing: border-box;
|
|
10
8
|
`}
|
|
9
|
+
${({ hero }) => hero && css`
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 10%;
|
|
12
|
+
`}
|
|
11
13
|
margin-top: 10px;
|
|
12
14
|
`
|
|
13
15
|
|
|
@@ -94,10 +94,10 @@ export const AddCommentHideShow = styled.p`
|
|
|
94
94
|
transition: all 0.3s linear;
|
|
95
95
|
color: #909BA9;
|
|
96
96
|
font-size: 13px;
|
|
97
|
-
|
|
98
97
|
&:hover {
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
text-decoration: underline;
|
|
99
|
+
color: ${props => props.theme?.colors.primary};
|
|
100
|
+
}
|
|
101
101
|
|
|
102
102
|
${({ active }) => active && css`
|
|
103
103
|
color: ${props => props.theme?.colors.primary};
|
|
@@ -134,19 +134,24 @@ const ServiceFormUI = (props) => {
|
|
|
134
134
|
handleSave(values)
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
const getMomentTime = (time) => {
|
|
138
|
+
const _moment = moment(`${moment(selectDate).format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm').toDate()
|
|
139
|
+
return _moment
|
|
140
|
+
}
|
|
141
|
+
|
|
137
142
|
const handleChangeTime = (time) => {
|
|
138
143
|
if (!time || time === timeSelected) return
|
|
139
|
-
const _moment =
|
|
144
|
+
const _moment = getMomentTime(time)
|
|
140
145
|
setTimeSelected(time)
|
|
141
146
|
setDateSelected(_moment)
|
|
142
147
|
}
|
|
143
148
|
|
|
144
|
-
const isBusyTime = (professional) => {
|
|
145
|
-
if (!
|
|
146
|
-
const startDay = moment(
|
|
149
|
+
const isBusyTime = (professional, selectedMoment) => {
|
|
150
|
+
if (!selectedMoment) return false
|
|
151
|
+
const startDay = moment(selectedMoment).utc().format('d')
|
|
147
152
|
const isStartScheduleEnabled = professional?.schedule?.[startDay]?.enabled
|
|
148
153
|
const duration = product?.duration ?? 0
|
|
149
|
-
const endDay = moment(
|
|
154
|
+
const endDay = moment(selectedMoment).add(duration - 1, 'minutes').utc().format('d')
|
|
150
155
|
const isEndScheduleEnabled = professional?.schedule?.[endDay]?.enabled
|
|
151
156
|
if (!isStartScheduleEnabled || !isEndScheduleEnabled) return true
|
|
152
157
|
|
|
@@ -156,10 +161,10 @@ const ServiceFormUI = (props) => {
|
|
|
156
161
|
? professional?.busy_times.filter(item => !(item.start === productCart?.calendar_event?.start && item.end === productCart?.calendar_event?.end))
|
|
157
162
|
: [...professional?.busy_times]
|
|
158
163
|
const valid = busyTimes.some(item => {
|
|
159
|
-
return (moment.utc(item?.start).local().valueOf() <= moment(
|
|
160
|
-
moment(
|
|
161
|
-
(moment.utc(item?.start).local().valueOf()
|
|
162
|
-
moment(
|
|
164
|
+
return (moment.utc(item?.start).local().valueOf() <= moment(selectedMoment).valueOf() &&
|
|
165
|
+
moment(selectedMoment).valueOf() < moment.utc(item?.end).local().valueOf()) ||
|
|
166
|
+
(moment.utc(item?.start).local().valueOf() < moment(selectedMoment).add(duration, 'minutes').valueOf() &&
|
|
167
|
+
moment(selectedMoment).add(duration, 'minutes').valueOf() < moment.utc(item?.end).local().valueOf())
|
|
163
168
|
})
|
|
164
169
|
return valid
|
|
165
170
|
}
|
|
@@ -317,8 +322,8 @@ const ServiceFormUI = (props) => {
|
|
|
317
322
|
) : <FaUserAlt />}
|
|
318
323
|
<NameWrapper>
|
|
319
324
|
<p>{currentProfessional?.name} {currentProfessional?.lastname}</p>
|
|
320
|
-
<StatusInfo available={!isBusyTime(currentProfessional)}>
|
|
321
|
-
{isBusyTime(currentProfessional) ? (
|
|
325
|
+
<StatusInfo available={!isBusyTime(currentProfessional, dateSelected)}>
|
|
326
|
+
{isBusyTime(currentProfessional, dateSelected) ? (
|
|
322
327
|
<>
|
|
323
328
|
<span className='status'>{t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')}</span>
|
|
324
329
|
</>
|
|
@@ -350,8 +355,8 @@ const ServiceFormUI = (props) => {
|
|
|
350
355
|
) : <FaUserAlt />}
|
|
351
356
|
<NameWrapper>
|
|
352
357
|
<p>{professional?.name} {professional?.lastname}</p>
|
|
353
|
-
<StatusInfo available={!isBusyTime(professional)}>
|
|
354
|
-
{isBusyTime(professional) ? (
|
|
358
|
+
<StatusInfo available={!isBusyTime(professional, dateSelected)}>
|
|
359
|
+
{isBusyTime(professional, dateSelected) ? (
|
|
355
360
|
<>
|
|
356
361
|
<span className='status'>{t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')}</span>
|
|
357
362
|
</>
|
|
@@ -435,6 +440,7 @@ const ServiceFormUI = (props) => {
|
|
|
435
440
|
<TimeItem
|
|
436
441
|
key={i}
|
|
437
442
|
active={timeSelected === time.value}
|
|
443
|
+
disabled={isBusyTime(currentProfessional, getMomentTime(time.value))}
|
|
438
444
|
onClick={() => handleChangeTime(time.value)}
|
|
439
445
|
>
|
|
440
446
|
<span>{time.text}</span>
|
|
@@ -463,7 +469,7 @@ const ServiceFormUI = (props) => {
|
|
|
463
469
|
<Button
|
|
464
470
|
onClick={() => handleAddProduct()}
|
|
465
471
|
color='primary'
|
|
466
|
-
disabled={isBusyTime(currentProfessional)}
|
|
472
|
+
disabled={isBusyTime(currentProfessional, dateSelected)}
|
|
467
473
|
>
|
|
468
474
|
{t('BOOK', 'Book')}
|
|
469
475
|
</Button>
|
|
@@ -421,7 +421,9 @@ export const TimeItem = styled.div`
|
|
|
421
421
|
display: flex;
|
|
422
422
|
justify-content: center;
|
|
423
423
|
align-items: center;
|
|
424
|
-
background: ${props => props.theme.colors.
|
|
424
|
+
background: ${props => props.theme.colors.primaryContrast};
|
|
425
|
+
border: 1px solid transparent;
|
|
426
|
+
color: ${props => props.theme.colors.primary};
|
|
425
427
|
border-radius: 7.6px;
|
|
426
428
|
padding: 5px 15px;
|
|
427
429
|
margin: 12px;
|
|
@@ -431,8 +433,14 @@ export const TimeItem = styled.div`
|
|
|
431
433
|
user-select: none;
|
|
432
434
|
|
|
433
435
|
${({ active }) => active && css`
|
|
434
|
-
background: ${props => props.theme.colors.
|
|
435
|
-
color: ${props => props.theme.colors.
|
|
436
|
+
background: ${props => props.theme.colors.primary};
|
|
437
|
+
color: ${props => props.theme.colors.primaryContrast};
|
|
438
|
+
border: 1px solid ${props => props.theme.colors.primary};
|
|
439
|
+
`}
|
|
440
|
+
|
|
441
|
+
${({ disabled }) => disabled && css`
|
|
442
|
+
background: ${props => props.theme.colors.gray200};
|
|
443
|
+
color: ${props => props.theme.colors.lightGray};
|
|
436
444
|
`}
|
|
437
445
|
|
|
438
446
|
span {
|
|
@@ -167,7 +167,7 @@ const UserDetailsUI = (props) => {
|
|
|
167
167
|
)}
|
|
168
168
|
{cartStatus !== 2 && (
|
|
169
169
|
!isEdit ? (
|
|
170
|
-
<span onClick={() => toggleIsEdit()}>{t('
|
|
170
|
+
<span onClick={() => toggleIsEdit()}>{t('CHANGE_USER_DETAILS', 'Change customer details')}</span>
|
|
171
171
|
) : (
|
|
172
172
|
<FcCancel className='cancel' onClick={() => toggleEditState()} />
|
|
173
173
|
)
|
|
@@ -190,7 +190,7 @@ const UserDetailsUI = (props) => {
|
|
|
190
190
|
<CountryFlag>
|
|
191
191
|
{
|
|
192
192
|
userData?.country_phone_code && (
|
|
193
|
-
<PhoneInput onChange={() => {}} defaultCountry={parsePhoneNumber(`+${(userData?.country_phone_code?.replace('+', ''))} ${userData?.cellphone}`)?.country} />
|
|
193
|
+
<PhoneInput onChange={() => { }} defaultCountry={parsePhoneNumber(`+${(userData?.country_phone_code?.replace('+', ''))} ${userData?.cellphone}`)?.country} />
|
|
194
194
|
)
|
|
195
195
|
}
|
|
196
196
|
</CountryFlag>
|
|
@@ -300,7 +300,6 @@ export const UserFormDetailsUI = (props) => {
|
|
|
300
300
|
props.beforeMidComponents?.map((BeforeMidComponents, i) => (
|
|
301
301
|
<BeforeMidComponents key={i} {...props} />))
|
|
302
302
|
}
|
|
303
|
-
{!requiredFields && <Divider />}
|
|
304
303
|
{sortInputFields({ values: validationFields?.fields?.checkout }).map(field =>
|
|
305
304
|
showField && showField(field.code) && showFieldWithTheme(field.code) && (
|
|
306
305
|
<React.Fragment key={field.id}>
|
|
@@ -194,6 +194,7 @@ export const UserPopover = (props) => {
|
|
|
194
194
|
|
|
195
195
|
const LogoutActionUI = (props) => {
|
|
196
196
|
const [, t] = useLanguage()
|
|
197
|
+
const [events] = useEvent()
|
|
197
198
|
const [, { deleteUserCustomer }] = useCustomer()
|
|
198
199
|
|
|
199
200
|
const handleClick = () => {
|
|
@@ -210,6 +211,7 @@ const LogoutActionUI = (props) => {
|
|
|
210
211
|
deleteUserCustomer(true)
|
|
211
212
|
props.handleLogoutClick()
|
|
212
213
|
props.onClose && props.onClose()
|
|
214
|
+
events.emit('go_to_page', { page: 'home' })
|
|
213
215
|
}
|
|
214
216
|
return (
|
|
215
217
|
<PopoverListItem onClick={handleClick}>
|
|
@@ -232,9 +232,6 @@ const UserProfileFormUI = (props) => {
|
|
|
232
232
|
</React.Fragment>))}
|
|
233
233
|
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
234
234
|
<BeforeComponent key={i} {...props} />))}
|
|
235
|
-
{!isHiddenAddress && !props.hideOptions && (
|
|
236
|
-
<ProfileOptions value='account' />
|
|
237
|
-
)}
|
|
238
235
|
<Container>
|
|
239
236
|
<UserProfileContainer mbottom={isHiddenAddress && 25}>
|
|
240
237
|
{showCustomerPicture && (
|
|
@@ -10,11 +10,6 @@ export const UserProfileContainer = styled.div`
|
|
|
10
10
|
text-align: center;
|
|
11
11
|
width: 90%;
|
|
12
12
|
margin: 25px auto ${props => props.mbottom ? `${props.mbottom}px` : 'auto'};
|
|
13
|
-
|
|
14
|
-
@media (min-width: 768px) {
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
}
|
|
18
13
|
`
|
|
19
14
|
|
|
20
15
|
export const ProfileOptionsList = styled.div`
|
|
@@ -26,6 +26,9 @@ export const WalletTransactionItem = (props) => {
|
|
|
26
26
|
? `:author ${item?.amount >= 0 ? 'Add' : 'Reduce'} money in Order No. :order_id`
|
|
27
27
|
: `:author ${item?.amount >= 0 ? 'Add' : 'Reduce'} money`
|
|
28
28
|
|
|
29
|
+
const itemDescription = item?.description?.split(' ')
|
|
30
|
+
const order_id = itemDescription?.pop() ?? ''
|
|
31
|
+
|
|
29
32
|
return (
|
|
30
33
|
<Container>
|
|
31
34
|
<Dot isTop={idx === 0} />
|
|
@@ -49,7 +52,7 @@ export const WalletTransactionItem = (props) => {
|
|
|
49
52
|
</MessageBlock>
|
|
50
53
|
{!!item?.description && (
|
|
51
54
|
<DescriptionBlock>
|
|
52
|
-
<span>{
|
|
55
|
+
<span>{`${t('ACCUMULATION_CREDIT_POINT_BY_ORDER', itemDescription?.join(' ') ?? 'Accumulation credit point by order')} ${order_id}`}</span>
|
|
53
56
|
</DescriptionBlock>
|
|
54
57
|
)}
|
|
55
58
|
{!!item?.code && (
|
|
@@ -16,13 +16,16 @@ import {
|
|
|
16
16
|
WrapContent,
|
|
17
17
|
Transactions,
|
|
18
18
|
LoyaltyContent,
|
|
19
|
-
LoyaltyWrapp
|
|
19
|
+
LoyaltyWrapp,
|
|
20
|
+
Title,
|
|
21
|
+
TabsContainer,
|
|
22
|
+
Tab
|
|
20
23
|
} from './styles'
|
|
21
24
|
|
|
22
25
|
import { WalletTransactionItem } from '../WalletTransactionItem'
|
|
23
|
-
import {
|
|
24
|
-
import { Tabs, Tab } from '../../styles/Tabs'
|
|
26
|
+
import { Tabs } from '../../styles/Tabs'
|
|
25
27
|
import { GiftCardUI } from '../GiftCard/GiftCardUI'
|
|
28
|
+
import { NotFoundSource } from '../NotFoundSource'
|
|
26
29
|
|
|
27
30
|
const WalletsUI = (props) => {
|
|
28
31
|
const {
|
|
@@ -69,99 +72,102 @@ const WalletsUI = (props) => {
|
|
|
69
72
|
!userLoyaltyLevel.loading &&
|
|
70
73
|
!walletList.error &&
|
|
71
74
|
walletList.wallets?.length > 0 &&
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
75
|
+
(
|
|
76
|
+
<>
|
|
77
|
+
<Title>{t('WALLETS', 'Wallets')}</Title>
|
|
78
|
+
<TabsContainer>
|
|
79
|
+
<Tabs variant='primary' className='tabs'>
|
|
80
|
+
{walletList.wallets?.map(wallet => walletName[wallet.type]?.isActive && (
|
|
81
|
+
<Tab
|
|
82
|
+
key={wallet.id}
|
|
83
|
+
active={tabSelected === wallet.type}
|
|
84
|
+
onClick={() => handleChangeTab(wallet)}
|
|
85
|
+
borderBottom
|
|
86
|
+
className='tab_title'
|
|
87
|
+
>
|
|
88
|
+
{walletName[wallet.type]?.name}
|
|
89
|
+
</Tab>
|
|
90
|
+
))}
|
|
91
|
+
</Tabs>
|
|
92
|
+
</TabsContainer>
|
|
93
|
+
|
|
94
|
+
<WrapContent>
|
|
95
|
+
<Transactions isLoyaltyLevel={!!loyaltyLevel}>
|
|
96
|
+
<SectionWrapper>
|
|
97
|
+
<BalanceElement>
|
|
98
|
+
<h1>
|
|
99
|
+
{
|
|
100
|
+
currentWalletSelected?.type === 'cash'
|
|
101
|
+
? parsePrice(currentWalletSelected?.balance)
|
|
102
|
+
: currentWalletSelected?.balance
|
|
103
|
+
}
|
|
104
|
+
</h1>
|
|
105
|
+
<span>
|
|
106
|
+
{currentWalletSelected?.type === 'cash'
|
|
107
|
+
? configs?.stripe_currency?.value
|
|
108
|
+
: t('POINTS', 'Points')}
|
|
109
|
+
</span>
|
|
110
|
+
</BalanceElement>
|
|
111
|
+
</SectionWrapper>
|
|
112
|
+
<GiftCardUI />
|
|
113
|
+
<div className='transactions_list'>
|
|
114
|
+
{!transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length > 0 && (
|
|
115
|
+
<>
|
|
116
|
+
<h2 style={{ fontSize: 20 }}>{t('TRANSACTIONS_HISTORY', 'Transactions history')}</h2>
|
|
117
|
+
<TransactionsWrapper>
|
|
118
|
+
{transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction, i) => (
|
|
119
|
+
<WalletTransactionItem
|
|
120
|
+
idx={i}
|
|
121
|
+
type={currentWalletSelected?.type}
|
|
122
|
+
key={transaction.id}
|
|
123
|
+
item={transaction}
|
|
124
|
+
/>
|
|
125
|
+
))}
|
|
126
|
+
</TransactionsWrapper>
|
|
127
|
+
</>
|
|
128
|
+
)}
|
|
129
|
+
|
|
130
|
+
{transactionsList?.loading && (
|
|
131
|
+
<>
|
|
132
|
+
{[...Array(8).keys()].map(i => (
|
|
133
|
+
<SectionWrapper key={i} isLoading>
|
|
134
|
+
<Skeleton height={40} />
|
|
135
|
+
</SectionWrapper>
|
|
119
136
|
))}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<img src={loyaltyLevel.image ?? theme.images.dummies.loyaltyLevel} />
|
|
155
|
-
<span className='loyalty_name'>
|
|
156
|
-
{loyaltyLevel.name}
|
|
157
|
-
</span>
|
|
158
|
-
</LoyaltyWrapp>
|
|
159
|
-
</LoyaltyContent>
|
|
160
|
-
)}
|
|
161
|
-
</WrapContent>
|
|
162
|
-
|
|
163
|
-
</>
|
|
164
|
-
)}
|
|
137
|
+
</>
|
|
138
|
+
)}
|
|
139
|
+
|
|
140
|
+
{!transactionsList?.loading &&
|
|
141
|
+
(transactionsList?.error || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
|
|
142
|
+
(
|
|
143
|
+
<NotFoundSource
|
|
144
|
+
content={
|
|
145
|
+
transactionsList?.error
|
|
146
|
+
? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
|
|
147
|
+
: t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
|
|
148
|
+
}
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
</div>
|
|
152
|
+
</Transactions>
|
|
153
|
+
|
|
154
|
+
{!!loyaltyLevel && tabSelected === 'credit_point' && (
|
|
155
|
+
<LoyaltyContent>
|
|
156
|
+
<LoyaltyWrapp>
|
|
157
|
+
<span className='loyalty_title'>
|
|
158
|
+
{t('LOYALTY_LEVEL_TITLE', 'Your level is')}:
|
|
159
|
+
</span>
|
|
160
|
+
<img src={loyaltyLevel.image ?? theme.images.dummies.loyaltyLevel} />
|
|
161
|
+
<span className='loyalty_name'>
|
|
162
|
+
{loyaltyLevel.name}
|
|
163
|
+
</span>
|
|
164
|
+
</LoyaltyWrapp>
|
|
165
|
+
</LoyaltyContent>
|
|
166
|
+
)}
|
|
167
|
+
</WrapContent>
|
|
168
|
+
|
|
169
|
+
</>
|
|
170
|
+
)}
|
|
165
171
|
|
|
166
172
|
{(walletList?.loading || userLoyaltyLevel.loading) && (
|
|
167
173
|
<>
|
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components'
|
|
2
2
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
|
-
|
|
4
|
+
width: 100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
|
+
margin: 0 auto;
|
|
8
|
+
padding: 30px 15px 15px 15px;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
min-height: calc(100vh - 280px);
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
.tab_title {
|
|
12
|
-
padding: 10px 2px;
|
|
12
|
+
@media (min-width: 768px) {
|
|
13
|
+
width: 70%;
|
|
13
14
|
}
|
|
15
|
+
`
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
17
|
+
export const Title = styled.h1`
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
font-size: 32px;
|
|
20
|
+
margin-bottom: 30px;
|
|
21
|
+
margin-top: 0;
|
|
22
|
+
`
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
export const TabsContainer = styled.div`
|
|
25
|
+
border-bottom: 1px solid ${props => props.theme.colors.gray200};
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
export const Tab = styled.div`
|
|
29
|
+
padding: 10px 0px;
|
|
30
|
+
margin-right: 30px;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
|
|
33
|
+
${props => props.theme.rtl && css`
|
|
34
|
+
margin-right: 0px;
|
|
35
|
+
margin-left: 30px;
|
|
36
|
+
`}
|
|
37
|
+
|
|
38
|
+
${({ active }) => active && css`
|
|
39
|
+
${({ borderBottom }) => borderBottom && css`
|
|
40
|
+
border-bottom: 1px solid;
|
|
41
|
+
`}
|
|
42
|
+
`}
|
|
43
|
+
|
|
44
|
+
${({ active }) => !active && css`
|
|
45
|
+
color: ${props => props.theme.colors.darkGray};
|
|
46
|
+
`}
|
|
27
47
|
`
|
|
28
48
|
|
|
29
49
|
export const SectionWrapper = styled.div`
|
|
@@ -23,6 +23,10 @@ export const Button = styled.button`
|
|
|
23
23
|
}
|
|
24
24
|
${({ bgtransparent }) => bgtransparent && css`
|
|
25
25
|
background: transparent !important;
|
|
26
|
+
&:hover {
|
|
27
|
+
background: ${darken(0.15, '#CCC')};
|
|
28
|
+
color: ${props => darken(0.15, props.theme.colors.primary)} !important;
|
|
29
|
+
}
|
|
26
30
|
`}
|
|
27
31
|
${({ initialIcon }) => initialIcon && css`
|
|
28
32
|
text-align: left;
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import CgRadioCheck from '@meronex/icons/cg/CgRadioCheck'
|
|
28
28
|
import CgRadioChecked from '@meronex/icons/cg/CgRadioChecked'
|
|
29
29
|
import BiTimeFive from '@meronex/icons/bi/BiTimeFive'
|
|
30
|
+
import { calendarLanguages } from '../../../../../utils'
|
|
30
31
|
|
|
31
32
|
const MomentControlUI = (props) => {
|
|
32
33
|
const {
|
|
@@ -67,18 +68,13 @@ const MomentControlUI = (props) => {
|
|
|
67
68
|
setIsASP(true)
|
|
68
69
|
} else setIsASP(false)
|
|
69
70
|
}
|
|
70
|
-
|
|
71
71
|
const handleRemoveDate = () => {
|
|
72
72
|
!orderState.loading && handleAsap()
|
|
73
73
|
setIsASP(true)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const
|
|
77
|
-
return moment(date).format('MMMM')
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const formatShortWeekday = (date) => {
|
|
81
|
-
return moment(date).format('dd')
|
|
76
|
+
const formatWeekMonth = (obj, date) => {
|
|
77
|
+
return obj === 'month' ? t(calendarLanguages.months[moment(date).format('MMMM')], moment(date).format('MMMM')) : t(calendarLanguages.week[moment(date).format('dd')], moment(date).format('dd'))
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
const formatDay = (date) => {
|
|
@@ -133,7 +129,6 @@ const MomentControlUI = (props) => {
|
|
|
133
129
|
}
|
|
134
130
|
}, [hoursList])
|
|
135
131
|
|
|
136
|
-
|
|
137
132
|
return (
|
|
138
133
|
<div id='moment_control'>
|
|
139
134
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -149,7 +144,7 @@ const MomentControlUI = (props) => {
|
|
|
149
144
|
isLoading={orderState?.loading}
|
|
150
145
|
>
|
|
151
146
|
{isASP ? <CgRadioChecked /> : <CgRadioCheck />}
|
|
152
|
-
<span>{t('CHECKOUT_ASAP', 'ASAP')
|
|
147
|
+
<span>{t('CHECKOUT_ASAP', 'ASAP') + ` (${t(moment().format('dddd')?.toLocaleUpperCase(), moment().format('dddd'))}, ${t(calendarLanguages.months[moment().format('MMMM')], moment().format('MMMM'))}${moment().format(' D, yyyy h:mm A')} - ${t('DELIVERY_TIME', 'delivery time')})`}</span>
|
|
153
148
|
</CheckBoxWrapper>
|
|
154
149
|
<CheckBoxWrapper
|
|
155
150
|
highlight={!isASP}
|
|
@@ -183,8 +178,8 @@ const MomentControlUI = (props) => {
|
|
|
183
178
|
nextLabel={<MdKeyboardArrowRight />}
|
|
184
179
|
minDate={minDate}
|
|
185
180
|
maxDate={maxDate}
|
|
186
|
-
formatMonthYear={(locale, date) =>
|
|
187
|
-
formatShortWeekday={(locale, date) =>
|
|
181
|
+
formatMonthYear={(locale, date) => formatWeekMonth('month', date)}
|
|
182
|
+
formatShortWeekday={(locale, date) => formatWeekMonth('week', date)}
|
|
188
183
|
formatDay={(locale, date) => formatDay(date)}
|
|
189
184
|
calendarType='US'
|
|
190
185
|
/>
|