ordering-ui-external 1.1.0 → 1.1.3
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.f3d1068d8ea119f4e4f2.js → 0.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{1.ordering-ui.f3d1068d8ea119f4e4f2.js → 1.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{3.ordering-ui.f3d1068d8ea119f4e4f2.js → 3.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{4.ordering-ui.f3d1068d8ea119f4e4f2.js → 4.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{5.ordering-ui.f3d1068d8ea119f4e4f2.js → 5.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{6.ordering-ui.f3d1068d8ea119f4e4f2.js → 6.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{7.ordering-ui.f3d1068d8ea119f4e4f2.js → 7.ordering-ui.6d646b995521e7aa65da.js} +1 -1
- package/_bundles/{7.ordering-ui.f3d1068d8ea119f4e4f2.js.LICENSE.txt → 7.ordering-ui.6d646b995521e7aa65da.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.f3d1068d8ea119f4e4f2.js → 8.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{9.ordering-ui.f3d1068d8ea119f4e4f2.js → 9.ordering-ui.6d646b995521e7aa65da.js} +0 -0
- package/_bundles/{ordering-ui.f3d1068d8ea119f4e4f2.js → ordering-ui.6d646b995521e7aa65da.js} +2 -2
- package/_bundles/{ordering-ui.f3d1068d8ea119f4e4f2.js.LICENSE.txt → ordering-ui.6d646b995521e7aa65da.js.LICENSE.txt} +0 -0
- package/_modules/index.js +78 -0
- package/_modules/themes/five/index.js +8 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +72 -27
- package/_modules/themes/five/src/components/ReviewOrder/index.js +4 -4
- package/_modules/themes/five/src/components/ReviewProduct/index.js +4 -4
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +6 -6
- package/package.json +1 -1
- package/src/index.js +28 -2
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/OrderDetails/index.js +45 -28
- package/src/themes/five/src/components/ReviewOrder/index.js +1 -1
- package/src/themes/five/src/components/ReviewProduct/index.js +1 -1
- package/src/themes/five/src/components/ReviewProduct/styles.js +0 -14
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
BusinessWrapper,
|
|
39
39
|
BusinessInfo,
|
|
40
40
|
OrderInfo,
|
|
41
|
+
OrderIdSec,
|
|
41
42
|
StatusBar,
|
|
42
43
|
OrderCustomer,
|
|
43
44
|
PhotoBlock,
|
|
@@ -61,6 +62,7 @@ import {
|
|
|
61
62
|
HeaderTitle,
|
|
62
63
|
PlaceSpotSection,
|
|
63
64
|
BtsOrderStatus,
|
|
65
|
+
OrderStatusAndLinkContainer,
|
|
64
66
|
LinkWrapper,
|
|
65
67
|
MapWrapper,
|
|
66
68
|
BusinessExternalWrapper
|
|
@@ -108,7 +110,7 @@ const OrderDetailsUI = (props) => {
|
|
|
108
110
|
const [isService, setIsService] = useState(false)
|
|
109
111
|
const [isOrderHistory, setIsOrderHistory] = useState(false)
|
|
110
112
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
111
|
-
|
|
113
|
+
const [isShowBusinessLogo, setIsShowBusinessLogo] = useState(true)
|
|
112
114
|
const { order, loading, businessData, error } = props.order
|
|
113
115
|
const yourSpotString = order?.delivery_type === 3 ? t('TABLE_NUMBER', 'Table number') : t('SPOT_NUMBER', 'Spot number')
|
|
114
116
|
const acceptedStatus = [1, 2, 5, 6, 10, 11, 12]
|
|
@@ -183,6 +185,26 @@ const OrderDetailsUI = (props) => {
|
|
|
183
185
|
setUnreadAlert({ business, driver })
|
|
184
186
|
}
|
|
185
187
|
|
|
188
|
+
const validateImage = (src) => {
|
|
189
|
+
return new Promise((resolve, reject) => {
|
|
190
|
+
if (!src || typeof src !== 'string') {
|
|
191
|
+
resolve(false)
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const image = new Image()
|
|
195
|
+
image.src = src
|
|
196
|
+
image.complete ? resolve(true) : resolve(false)
|
|
197
|
+
} catch (err) {
|
|
198
|
+
resolve(false)
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const businessLogoUrlValidation = async () => {
|
|
204
|
+
const isValidImage = await validateImage(order?.business?.logo)
|
|
205
|
+
setIsShowBusinessLogo(isValidImage)
|
|
206
|
+
}
|
|
207
|
+
|
|
186
208
|
const locations = [
|
|
187
209
|
{ ...order?.driver?.location, icon: order?.driver?.photo || theme.images?.dummies?.driverPhoto },
|
|
188
210
|
{ ...order?.business?.location, icon: order?.business?.logo || theme.images?.dummies?.businessLogo },
|
|
@@ -311,6 +333,7 @@ const OrderDetailsUI = (props) => {
|
|
|
311
333
|
if (!order) return
|
|
312
334
|
const _isService = order.products.some(product => product.type === 'service')
|
|
313
335
|
setIsService(_isService)
|
|
336
|
+
businessLogoUrlValidation()
|
|
314
337
|
}, [order])
|
|
315
338
|
|
|
316
339
|
const OrderMapSection = (props) => {
|
|
@@ -384,7 +407,7 @@ const OrderDetailsUI = (props) => {
|
|
|
384
407
|
<WrapperLeftContainer>
|
|
385
408
|
<OrderInfo>
|
|
386
409
|
<TitleContainer>
|
|
387
|
-
<
|
|
410
|
+
<OrderIdSec>{isService ? t('APPOINTMENT', 'Appointment') : t('ORDER', theme?.defaultLanguages?.ORDER || 'Order')} #{order?.id}</OrderIdSec>
|
|
388
411
|
{parseInt(configs?.guest_uuid_access?.value, 10) && order?.hash_key && (
|
|
389
412
|
<Content className='order-content'>
|
|
390
413
|
<ShareOrder>
|
|
@@ -419,40 +442,34 @@ const OrderDetailsUI = (props) => {
|
|
|
419
442
|
acceptedStatus.includes(parseInt(order?.status, 10)) ||
|
|
420
443
|
!isOriginalLayout
|
|
421
444
|
) && (
|
|
422
|
-
|
|
445
|
+
<ReOrder>
|
|
446
|
+
<Button
|
|
447
|
+
color='primary'
|
|
448
|
+
outline
|
|
449
|
+
onClick={() => handleStartNewOrder(order.id)}
|
|
450
|
+
disabled={reorderState?.loading}
|
|
451
|
+
>
|
|
452
|
+
{t('START_NEW_ORDER', 'Start new order')}
|
|
453
|
+
</Button>
|
|
454
|
+
{completedStatus.includes(parseInt(order?.status, 10)) && (
|
|
423
455
|
<Button
|
|
424
456
|
color='primary'
|
|
425
457
|
outline
|
|
426
|
-
onClick={() =>
|
|
458
|
+
onClick={() => handleClickReorder(order)}
|
|
427
459
|
disabled={reorderState?.loading}
|
|
428
460
|
>
|
|
429
|
-
{
|
|
461
|
+
{reorderState?.loading
|
|
462
|
+
? t('LOADING', 'Loading...')
|
|
463
|
+
: t('REORDER', 'Reorder')}
|
|
430
464
|
</Button>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
outline
|
|
435
|
-
onClick={() => handleClickReorder(order)}
|
|
436
|
-
disabled={reorderState?.loading}
|
|
437
|
-
>
|
|
438
|
-
{reorderState?.loading
|
|
439
|
-
? t('LOADING', 'Loading...')
|
|
440
|
-
: t('REORDER', 'Reorder')}
|
|
441
|
-
</Button>
|
|
442
|
-
)}
|
|
443
|
-
</ReOrder>
|
|
444
|
-
)}
|
|
465
|
+
)}
|
|
466
|
+
</ReOrder>
|
|
467
|
+
)}
|
|
445
468
|
</TitleContainer>
|
|
446
469
|
{showDeliveryProgress && (
|
|
447
470
|
<>
|
|
448
471
|
<StatusBar percentage={getOrderStatus(order?.status)?.percentage} />
|
|
449
|
-
<
|
|
450
|
-
style={{
|
|
451
|
-
display: 'flex',
|
|
452
|
-
flexDirection: 'row',
|
|
453
|
-
justifyContent: 'space-between'
|
|
454
|
-
}}
|
|
455
|
-
>
|
|
472
|
+
<OrderStatusAndLinkContainer>
|
|
456
473
|
<p className='order-status'>{getOrderStatus(order?.status)?.value}</p>
|
|
457
474
|
<LinkWrapper>
|
|
458
475
|
<ReviewOrderLink
|
|
@@ -472,7 +489,7 @@ const OrderDetailsUI = (props) => {
|
|
|
472
489
|
<span onClick={handleOpenReview}>{t('REVIEW_ORDER', theme?.defaultLanguages?.REVIEW_ORDER || 'Review your Order')}</span>
|
|
473
490
|
</ReviewOrderLink>
|
|
474
491
|
</LinkWrapper>
|
|
475
|
-
</
|
|
492
|
+
</OrderStatusAndLinkContainer>
|
|
476
493
|
</>
|
|
477
494
|
)}
|
|
478
495
|
</OrderInfo>
|
|
@@ -482,7 +499,7 @@ const OrderDetailsUI = (props) => {
|
|
|
482
499
|
w='calc(100% - 20px)'
|
|
483
500
|
// borderBottom={showOrderActions}
|
|
484
501
|
>
|
|
485
|
-
<img src={order?.business?.logo} />
|
|
502
|
+
{isShowBusinessLogo && <img src={order?.business?.logo} />}
|
|
486
503
|
<BusinessInfo>
|
|
487
504
|
<h2>{order?.business?.name}</h2>
|
|
488
505
|
<ActionsSection
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useForm } from 'react-hook-form'
|
|
3
3
|
|
|
4
|
-
import { useLanguage, useUtils, OrderReview as ReviewOrderController } from 'ordering-components
|
|
4
|
+
import { useLanguage, useUtils, OrderReview as ReviewOrderController } from 'ordering-components'
|
|
5
5
|
import MdClose from '@meronex/icons/md/MdClose'
|
|
6
6
|
import BsArrowRight from '@meronex/icons/bs/BsArrowRight'
|
|
7
7
|
import {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLanguage, ReviewProduct as ReviewProductController } from 'ordering-components
|
|
2
|
+
import { useLanguage, ReviewProduct as ReviewProductController } from 'ordering-components'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -9,18 +9,15 @@ export const ActionBlock = styled.div`
|
|
|
9
9
|
justify-content: space-between;
|
|
10
10
|
margin-top: 30px;
|
|
11
11
|
width: 100%;
|
|
12
|
-
|
|
13
12
|
span {
|
|
14
13
|
cursor: pointer;
|
|
15
14
|
font-weight: 600;
|
|
16
15
|
font-size: 16px;
|
|
17
16
|
user-select: none;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
button {
|
|
21
19
|
font-size: 14px;
|
|
22
20
|
padding: 6px 20px;
|
|
23
|
-
|
|
24
21
|
svg {
|
|
25
22
|
color: white;
|
|
26
23
|
font-size: 21px;
|
|
@@ -43,7 +40,6 @@ export const HandReviewWrapper = styled.div`
|
|
|
43
40
|
display: flex;
|
|
44
41
|
align-items: center;
|
|
45
42
|
justify-content: space-between;
|
|
46
|
-
|
|
47
43
|
p {
|
|
48
44
|
font-size: 15px;
|
|
49
45
|
color: ${props => props.theme?.colors.headingColor};
|
|
@@ -62,19 +58,16 @@ export const HandReviewContent = styled.div`
|
|
|
62
58
|
|
|
63
59
|
export const HandIconWrapper = styled.span`
|
|
64
60
|
margin-left: 15px;
|
|
65
|
-
|
|
66
61
|
${props => props.theme?.rtl && css`
|
|
67
62
|
margin-right: 15px;
|
|
68
63
|
margin-left: 0;
|
|
69
64
|
`}
|
|
70
|
-
|
|
71
65
|
svg {
|
|
72
66
|
font-size: 24px;
|
|
73
67
|
color: #B1BCCC;
|
|
74
68
|
cursor: pointer;
|
|
75
69
|
transition: all 0.3s linear;
|
|
76
70
|
}
|
|
77
|
-
|
|
78
71
|
${({ active }) => active && css`
|
|
79
72
|
svg {
|
|
80
73
|
color: ${props => props.theme?.colors.primary};
|
|
@@ -93,7 +86,6 @@ export const AddCommentHideShow = styled.p`
|
|
|
93
86
|
transition: all 0.3s linear;
|
|
94
87
|
color: #909BA9;
|
|
95
88
|
font-size: 13px;
|
|
96
|
-
|
|
97
89
|
&:hover {
|
|
98
90
|
color: ${props => props.theme?.colors.primary};
|
|
99
91
|
}
|
|
@@ -105,14 +97,12 @@ export const AddCommentHideShow = styled.p`
|
|
|
105
97
|
|
|
106
98
|
export const Comments = styled.div`
|
|
107
99
|
margin-top: 50px;
|
|
108
|
-
|
|
109
100
|
p {
|
|
110
101
|
margin-top: 0;
|
|
111
102
|
margin-bottom: 8px;
|
|
112
103
|
font-size: 14px;
|
|
113
104
|
color: #344050;
|
|
114
105
|
}
|
|
115
|
-
|
|
116
106
|
textarea {
|
|
117
107
|
width: 100%;
|
|
118
108
|
box-sizing: border-box;
|
|
@@ -134,22 +124,18 @@ export const ButtonCustomized = styled(Button)`
|
|
|
134
124
|
background: #E9ECEF;
|
|
135
125
|
border: 1px solid #E9ECEF;
|
|
136
126
|
transition: all 0.3s linear;
|
|
137
|
-
|
|
138
127
|
${props => props.theme?.rtl && css`
|
|
139
128
|
margin-left: 18px;
|
|
140
129
|
margin-right: 0;
|
|
141
130
|
`}
|
|
142
|
-
|
|
143
131
|
svg {
|
|
144
132
|
vertical-align: middle;
|
|
145
133
|
margin-left: 5px;
|
|
146
|
-
|
|
147
134
|
${props => props.theme?.rtl && css`
|
|
148
135
|
margin-right: 5px;
|
|
149
136
|
margin-left: 0;
|
|
150
137
|
`}
|
|
151
138
|
}
|
|
152
|
-
|
|
153
139
|
${({ active }) => active && css`
|
|
154
140
|
background: ${props => props.theme?.colors.primary};
|
|
155
141
|
border: 1px solid ${props => props.theme?.colors.primary};
|