ordering-ui-external 1.1.1 → 1.1.4
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.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{1.ordering-ui.f3d1068d8ea119f4e4f2.js → 1.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{3.ordering-ui.f3d1068d8ea119f4e4f2.js → 3.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{4.ordering-ui.f3d1068d8ea119f4e4f2.js → 4.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{5.ordering-ui.f3d1068d8ea119f4e4f2.js → 5.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{6.ordering-ui.f3d1068d8ea119f4e4f2.js → 6.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{7.ordering-ui.f3d1068d8ea119f4e4f2.js → 7.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +1 -1
- package/_bundles/{7.ordering-ui.f3d1068d8ea119f4e4f2.js.LICENSE.txt → 7.ordering-ui.06b1a9bfaf9d2abe2a7e.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.f3d1068d8ea119f4e4f2.js → 8.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{9.ordering-ui.f3d1068d8ea119f4e4f2.js → 9.ordering-ui.06b1a9bfaf9d2abe2a7e.js} +0 -0
- package/_bundles/{ordering-ui.f3d1068d8ea119f4e4f2.js → ordering-ui.06b1a9bfaf9d2abe2a7e.js} +2 -2
- package/_bundles/{ordering-ui.f3d1068d8ea119f4e4f2.js.LICENSE.txt → ordering-ui.06b1a9bfaf9d2abe2a7e.js.LICENSE.txt} +0 -0
- package/_modules/index.js +86 -0
- package/_modules/themes/five/index.js +48 -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/_modules/themes/six/index.js +8 -0
- package/package.json +15 -15
- package/src/index.js +2 -0
- package/src/themes/five/index.js +12 -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
- package/src/themes/six/index.js +2 -0
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
|
-
"main": "./
|
|
5
|
+
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
7
|
-
".": "./
|
|
8
|
-
"./theme_two": "./
|
|
9
|
-
"./theme_three": "./
|
|
10
|
-
"./theme_four": "./
|
|
11
|
-
"./theme_five": "./
|
|
12
|
-
"./theme_six": "./
|
|
13
|
-
"./theme_seven": "./
|
|
14
|
-
"./theme_eight": "./
|
|
15
|
-
"./theme_wow": "./
|
|
16
|
-
"./theme_pwa": "./
|
|
17
|
-
"./order_and_pay": "./
|
|
18
|
-
"./theme_franchise": "./
|
|
19
|
-
"./callcenter_original": "./
|
|
7
|
+
".": "./_modules/index.js",
|
|
8
|
+
"./theme_two": "./_modules/themes/two/index.js",
|
|
9
|
+
"./theme_three": "./_modules/themes/three/index.js",
|
|
10
|
+
"./theme_four": "./_modules/themes/four/index.js",
|
|
11
|
+
"./theme_five": "./_modules/themes/five/index.js",
|
|
12
|
+
"./theme_six": "./_modules/themes/six/index.js",
|
|
13
|
+
"./theme_seven": "./_modules/themes/seven/index.js",
|
|
14
|
+
"./theme_eight": "./_modules/themes/eight/index.js",
|
|
15
|
+
"./theme_wow": "./_modules/themes/wow/index.js",
|
|
16
|
+
"./theme_pwa": "./_modules/themes/pwa/index.js",
|
|
17
|
+
"./order_and_pay": "./_modules/themes/orderAndPay/index.js",
|
|
18
|
+
"./theme_franchise": "./_modules/themes/franchise/index.js",
|
|
19
|
+
"./callcenter_original": "./_modules/themes/callcenterOriginal/index.js"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"clean": "shx rm -rf _bundles _modules",
|
package/src/index.js
CHANGED
|
@@ -92,6 +92,7 @@ import { VerticalOrdersLayout } from './components/VerticalOrdersLayout'
|
|
|
92
92
|
import { GoogleLoginButton } from './components/GoogleLogin'
|
|
93
93
|
import { SmsLoginButton } from './components/SmsLogin'
|
|
94
94
|
import { AppleLogin } from './components/AppleLogin'
|
|
95
|
+
import { SearchProducts } from './components/RenderProductsLayout/SearchProducts'
|
|
95
96
|
|
|
96
97
|
import { ThemeContext, ThemeProvider, useTheme } from './contexts/ThemeContext'
|
|
97
98
|
import { useOnlineStatus } from './hooks/useOnlineStatus'
|
|
@@ -210,6 +211,7 @@ export {
|
|
|
210
211
|
ReviewDriver,
|
|
211
212
|
RenderProductsLayout,
|
|
212
213
|
SearchBar,
|
|
214
|
+
SearchProducts,
|
|
213
215
|
SignUpForm,
|
|
214
216
|
SingleProductCard,
|
|
215
217
|
SmartAppBanner,
|
package/src/themes/five/index.js
CHANGED
|
@@ -54,6 +54,7 @@ import { NotNetworkConnectivity } from './src/components/NotNetworkConnectivity'
|
|
|
54
54
|
import { Modal } from './src/components/Modal'
|
|
55
55
|
import { OrderDetails } from './src/components/OrderDetails'
|
|
56
56
|
import { OrderDetails as OrderDetailsKiosk } from './src/components/OrderDetails/layouts/Kiosk'
|
|
57
|
+
import { OrderItAgain } from './src/components/OrderItAgain'
|
|
57
58
|
import { OrdersOption } from './src/components/OrdersOption'
|
|
58
59
|
import { OrderProgress } from './src/components/OrderProgress'
|
|
59
60
|
import { OrderTypeSelectorContent } from './src/components/OrderTypeSelectorContent'
|
|
@@ -95,6 +96,11 @@ import { ReviewTrigger } from './src/components/ReviewTrigger'
|
|
|
95
96
|
import { ReviewOrder } from './src/components/ReviewOrder'
|
|
96
97
|
import { ReviewDriver } from './src/components/ReviewDriver'
|
|
97
98
|
import { ReviewProduct } from './src/components/ReviewProduct'
|
|
99
|
+
import { ServiceForm } from './src/components/ServiceForm'
|
|
100
|
+
import { ProfessionalFilter } from './src/components/ProfessionalFilter'
|
|
101
|
+
import { SearchProducts } from './src/components/SearchProducts'
|
|
102
|
+
import { MultiCartsPaymethodsAndWallets } from './src/components/MultiCartsPaymethodsAndWallets'
|
|
103
|
+
import { ProfessionalProfile } from './src/components/ProfessionalProfile'
|
|
98
104
|
|
|
99
105
|
import { Button } from './src/styles/Buttons'
|
|
100
106
|
import { Input, TextArea } from './src/styles/Inputs'
|
|
@@ -158,6 +164,7 @@ export {
|
|
|
158
164
|
NotFoundSource,
|
|
159
165
|
NotNetworkConnectivity,
|
|
160
166
|
OrderDetails,
|
|
167
|
+
OrderItAgain,
|
|
161
168
|
OrderDetailsKiosk,
|
|
162
169
|
OrdersOption,
|
|
163
170
|
OrderTypeSelectorContent,
|
|
@@ -199,6 +206,11 @@ export {
|
|
|
199
206
|
ReviewOrder,
|
|
200
207
|
ReviewDriver,
|
|
201
208
|
ReviewProduct,
|
|
209
|
+
ServiceForm,
|
|
210
|
+
ProfessionalFilter,
|
|
211
|
+
SearchProducts,
|
|
212
|
+
MultiCartsPaymethodsAndWallets,
|
|
213
|
+
ProfessionalProfile,
|
|
202
214
|
|
|
203
215
|
// styles
|
|
204
216
|
Button,
|
|
@@ -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};
|
package/src/themes/six/index.js
CHANGED
|
@@ -52,6 +52,7 @@ import { ProductIngredient } from './src/components/ProductIngredient'
|
|
|
52
52
|
import { GoogleLoginButton } from './src/components/GoogleLogin'
|
|
53
53
|
import { AppleLogin } from './src/components/AppleLogin'
|
|
54
54
|
import { SmsLoginButton } from './src/components/SmsLogin'
|
|
55
|
+
import { SearchProducts } from './src/components/BusinessProductsListing/SearchProducts'
|
|
55
56
|
|
|
56
57
|
import { Input as Inputs } from './src/styles/Inputs'
|
|
57
58
|
import { Select } from './src/styles/Select'
|
|
@@ -115,6 +116,7 @@ export {
|
|
|
115
116
|
GoogleLoginButton,
|
|
116
117
|
AppleLogin,
|
|
117
118
|
SmsLoginButton,
|
|
119
|
+
SearchProducts,
|
|
118
120
|
// styles
|
|
119
121
|
Inputs,
|
|
120
122
|
Select,
|