ordering-ui-external 1.9.6 → 2.0.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.55652fab015bca672f9d.js → 0.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{1.ordering-ui.55652fab015bca672f9d.js → 1.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{2.ordering-ui.55652fab015bca672f9d.js → 2.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{4.ordering-ui.55652fab015bca672f9d.js → 4.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{5.ordering-ui.55652fab015bca672f9d.js → 5.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{6.ordering-ui.55652fab015bca672f9d.js → 6.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{7.ordering-ui.55652fab015bca672f9d.js → 7.ordering-ui.32113e17b220a7b5ae09.js} +2 -2
- package/_bundles/{7.ordering-ui.55652fab015bca672f9d.js.LICENSE.txt → 7.ordering-ui.32113e17b220a7b5ae09.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.55652fab015bca672f9d.js → 8.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/{9.ordering-ui.55652fab015bca672f9d.js → 9.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
- package/_bundles/ordering-ui.32113e17b220a7b5ae09.js +2 -0
- package/_bundles/{ordering-ui.55652fab015bca672f9d.js.LICENSE.txt → ordering-ui.32113e17b220a7b5ae09.js.LICENSE.txt} +0 -0
- package/_modules/components/Confirm/index.js +4 -2
- package/_modules/components/Header/index.js +4 -2
- package/_modules/components/SmartAppBanner/index.js +4 -2
- package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersTable/index.js +32 -11
- package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersTable/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +7 -6
- package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/index.js +4 -4
- package/_modules/themes/five/src/components/Cart/index.js +6 -6
- package/_modules/themes/five/src/components/Checkout/index.js +4 -0
- package/_modules/themes/five/src/components/FavoriteList/index.js +2 -83
- package/_modules/themes/five/src/components/Footer/index.js +4 -2
- package/_modules/themes/five/src/components/Header/layouts/Kiosk/index.js +4 -2
- package/_modules/themes/five/src/components/MessagesListing/index.js +2 -82
- package/_modules/themes/five/src/components/Modal/index.js +4 -2
- package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/index.js +14 -8
- package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +12 -135
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +15 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +5 -3
- package/_modules/themes/five/src/components/NavigationBar/index.js +4 -2
- package/_modules/themes/five/src/components/NotNetworkConnectivity/index.js +4 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +11 -140
- package/_modules/themes/five/src/components/OrderProgress/index.js +3 -131
- package/_modules/themes/five/src/components/ProductForm/index.js +27 -26
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +11 -14
- package/_modules/themes/five/src/components/ReviewDriver/index.js +4 -2
- package/_modules/themes/five/src/components/ReviewOrder/index.js +4 -2
- package/_modules/themes/five/src/components/ReviewProduct/index.js +4 -2
- package/_modules/themes/five/src/components/ReviewTrigger/index.js +4 -2
- package/_modules/themes/five/src/components/SignUpApproval/index.js +4 -2
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -2
- package/_modules/themes/five/src/styles/Buttons/index.js +5 -3
- package/_modules/themes/five/src/styles/Inputs/index.js +1 -1
- package/_modules/themes/seven/src/components/Header/index.js +4 -2
- package/_modules/themes/six/src/components/Header/index.js +4 -2
- package/package.json +2 -2
- package/src/components/CancellationComponent/index.js +31 -27
- package/src/components/Confirm/index.js +2 -0
- package/src/components/Header/index.js +2 -0
- package/src/components/SmartAppBanner/index.js +2 -0
- package/src/themes/callcenterOriginal/src/components/Orders/OrdersTable/index.js +43 -19
- package/src/themes/callcenterOriginal/src/components/Orders/OrdersTable/styles.js +1 -0
- package/src/themes/five/src/components/BusinessProductsList/index.js +7 -6
- package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/index.js +4 -4
- package/src/themes/five/src/components/Cart/index.js +15 -4
- package/src/themes/five/src/components/Checkout/index.js +2 -0
- package/src/themes/five/src/components/FavoriteList/index.js +1 -35
- package/src/themes/five/src/components/Footer/index.js +2 -0
- package/src/themes/five/src/components/Header/layouts/Kiosk/index.js +2 -0
- package/src/themes/five/src/components/MessagesListing/index.js +1 -34
- package/src/themes/five/src/components/Modal/index.js +2 -0
- package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +1 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +14 -5
- package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +24 -45
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +16 -2
- package/src/themes/five/src/components/MultiOrdersDetails/styles.js +8 -0
- package/src/themes/five/src/components/NavigationBar/index.js +2 -0
- package/src/themes/five/src/components/NotNetworkConnectivity/index.js +2 -0
- package/src/themes/five/src/components/OrderDetails/index.js +1 -35
- package/src/themes/five/src/components/OrderProgress/index.js +1 -34
- package/src/themes/five/src/components/ProductForm/index.js +11 -11
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
- package/src/themes/five/src/components/ReviewDriver/index.js +2 -0
- package/src/themes/five/src/components/ReviewOrder/index.js +2 -0
- package/src/themes/five/src/components/ReviewProduct/index.js +2 -0
- package/src/themes/five/src/components/ReviewTrigger/index.js +2 -0
- package/src/themes/five/src/components/SignUpApproval/index.js +2 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +1 -2
- package/src/themes/five/src/styles/Buttons/index.js +3 -1
- package/src/themes/five/src/styles/Inputs/index.js +1 -1
- package/src/themes/seven/src/components/Header/index.js +2 -0
- package/src/themes/six/src/components/Header/index.js +2 -0
- package/template/components/HelmetTags/index.js +2 -0
- package/template/components/ListenPageChanges/index.js +2 -0
- package/template/components/ScrollToTop/index.js +2 -0
- package/template/components/SubdomainComponent/index.js +4 -39
- package/template/config.json +2 -1
- package/template/pages/AddressList/index.js +2 -0
- package/template/pages/BusinessListingSearch/index.js +2 -0
- package/template/pages/BusinessProductsList/index.js +2 -0
- package/template/pages/BusinessesList/index.js +2 -0
- package/template/pages/Checkout/index.js +2 -0
- package/template/pages/Cms/index.js +2 -0
- package/template/pages/Favorite/index.js +2 -0
- package/template/pages/Help/index.js +2 -0
- package/template/pages/Home/index.js +2 -0
- package/template/pages/MessagesList/index.js +2 -0
- package/template/pages/MultiCheckout/index.js +5 -0
- package/template/pages/MultiOrdersDetails/index.js +2 -0
- package/template/pages/MyOrders/index.js +2 -0
- package/template/pages/OrderDetails/index.js +2 -0
- package/template/pages/PageNotFound/index.js +2 -0
- package/template/pages/PagesList/index.js +2 -0
- package/template/pages/Profile/index.js +2 -0
- package/template/pages/Promotions/index.js +2 -0
- package/template/pages/ResetPassword/index.js +2 -0
- package/template/pages/SessionsList/index.js +2 -0
- package/template/pages/SignUpBusiness/index.js +2 -0
- package/template/pages/SignUpDriver/index.js +2 -0
- package/template/pages/UserVerification/index.js +2 -0
- package/template/pages/Wallets/index.js +2 -0
- package/_bundles/ordering-ui.55652fab015bca672f9d.js +0 -2
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
import { useTheme } from 'styled-components'
|
|
75
75
|
import { TaxInformation } from '../TaxInformation'
|
|
76
76
|
|
|
77
|
-
import { getGoogleMapImage } from '../../../../../utils'
|
|
77
|
+
import { getGoogleMapImage, getOrderStatus } from '../../../../../utils'
|
|
78
78
|
import { OrderHistory } from './OrderHistory'
|
|
79
79
|
import { ReviewProfessional } from '../ReviewProfessional'
|
|
80
80
|
import { OrderActionsSection } from './OrderActionsSection'
|
|
@@ -148,40 +148,6 @@ const OrderDetailsUI = (props) => {
|
|
|
148
148
|
const showCustomerEmail = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.email?.hidden
|
|
149
149
|
const showCustomerPhoto = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.photo?.hidden
|
|
150
150
|
|
|
151
|
-
const getOrderStatus = (s) => {
|
|
152
|
-
const status = parseInt(s)
|
|
153
|
-
const orderStatus = [
|
|
154
|
-
{ key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending'), slug: 'PENDING', percentage: 25 },
|
|
155
|
-
{ key: 1, value: t('COMPLETED', theme?.defaultLanguages?.COMPLETED || 'Completed'), slug: 'COMPLETED', percentage: 100 },
|
|
156
|
-
{ key: 2, value: t('REJECTED', theme?.defaultLanguages?.REJECTED || 'Rejected'), slug: 'REJECTED', percentage: 0 },
|
|
157
|
-
{ key: 3, value: t('DRIVER_IN_BUSINESS', theme?.defaultLanguages?.DRIVER_IN_BUSINESS || 'Driver in business'), slug: 'DRIVER_IN_BUSINESS', percentage: 60 },
|
|
158
|
-
{ key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed'), slug: 'PREPARATION_COMPLETED', percentage: 70 },
|
|
159
|
-
{ key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business'), slug: 'REJECTED_BY_BUSINESS', percentage: 0 },
|
|
160
|
-
{ key: 6, value: t('REJECTED_BY_DRIVER', theme?.defaultLanguages?.REJECTED_BY_DRIVER || 'Rejected by Driver'), slug: 'REJECTED_BY_DRIVER', percentage: 0 },
|
|
161
|
-
{ key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business'), slug: 'ACCEPTED_BY_BUSINESS', percentage: 35 },
|
|
162
|
-
{ key: 8, value: t('ACCEPTED_BY_DRIVER', theme?.defaultLanguages?.ACCEPTED_BY_DRIVER || 'Accepted by driver'), slug: 'ACCEPTED_BY_DRIVER', percentage: 45 },
|
|
163
|
-
{ key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_COMPLETED_BY_DRIVER || 'Pick up completed by driver'), slug: 'PICK_UP_COMPLETED_BY_DRIVER', percentage: 80 },
|
|
164
|
-
{ key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_FAILED_BY_DRIVER || 'Pick up Failed by driver'), slug: 'PICK_UP_FAILED_BY_DRIVER', percentage: 0 },
|
|
165
|
-
{ key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver'), slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 100 },
|
|
166
|
-
{ key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_FAILED_BY_DRIVER || 'Delivery Failed by driver'), slug: 'DELIVERY_FAILED_BY_DRIVER', percentage: 0 },
|
|
167
|
-
{ key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder'), slug: 'PREORDER', percentage: 0 },
|
|
168
|
-
{ key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready'), slug: 'ORDER_NOT_READY', percentage: 65 },
|
|
169
|
-
{ key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer'), slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', percentage: 100 },
|
|
170
|
-
{ key: 16, value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_STATUS_CANCELLED_BY_CUSTOMER || 'Order cancelled by customer'), slug: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER', percentage: 0 },
|
|
171
|
-
{ key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_NOT_PICKEDUP_BY_CUSTOMER || 'Order not picked up by customer'), slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER', percentage: 0 },
|
|
172
|
-
{ key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', percentage: 55 },
|
|
173
|
-
{ key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', percentage: 90 },
|
|
174
|
-
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90 },
|
|
175
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 },
|
|
176
|
-
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35 },
|
|
177
|
-
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
|
|
178
|
-
]
|
|
179
|
-
|
|
180
|
-
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
181
|
-
|
|
182
|
-
return objectStatus && objectStatus
|
|
183
|
-
}
|
|
184
|
-
|
|
185
151
|
const validTrackingStatus = [9, 19, 23]
|
|
186
152
|
const mapConfigs = { zoom: 15 }
|
|
187
153
|
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
TimeWrapper,
|
|
24
24
|
OrderProgressWrapper
|
|
25
25
|
} from './styles'
|
|
26
|
+
import { getOrderStatus } from '../../../../../utils'
|
|
26
27
|
|
|
27
28
|
const OrderProgressUI = (props) => {
|
|
28
29
|
const {
|
|
@@ -35,40 +36,6 @@ const OrderProgressUI = (props) => {
|
|
|
35
36
|
const [events] = useEvent()
|
|
36
37
|
const [lastOrder, setLastOrder] = useState(null)
|
|
37
38
|
|
|
38
|
-
const getOrderStatus = (s) => {
|
|
39
|
-
const status = parseInt(s)
|
|
40
|
-
const orderStatus = [
|
|
41
|
-
{ key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending'), slug: 'PENDING', percentage: 25 },
|
|
42
|
-
{ key: 1, value: t('COMPLETED', theme?.defaultLanguages?.COMPLETED || 'Completed'), slug: 'COMPLETED', percentage: 100 },
|
|
43
|
-
{ key: 2, value: t('REJECTED', theme?.defaultLanguages?.REJECTED || 'Rejected'), slug: 'REJECTED', percentage: 0 },
|
|
44
|
-
{ key: 3, value: t('DRIVER_IN_BUSINESS', theme?.defaultLanguages?.DRIVER_IN_BUSINESS || 'Driver in business'), slug: 'DRIVER_IN_BUSINESS', percentage: 60 },
|
|
45
|
-
{ key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed'), slug: 'PREPARATION_COMPLETED', percentage: 70 },
|
|
46
|
-
{ key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business'), slug: 'REJECTED_BY_BUSINESS', percentage: 0 },
|
|
47
|
-
{ key: 6, value: t('REJECTED_BY_DRIVER', theme?.defaultLanguages?.REJECTED_BY_DRIVER || 'Rejected by Driver'), slug: 'REJECTED_BY_DRIVER', percentage: 0 },
|
|
48
|
-
{ key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business'), slug: 'ACCEPTED_BY_BUSINESS', percentage: 35 },
|
|
49
|
-
{ key: 8, value: t('ACCEPTED_BY_DRIVER', theme?.defaultLanguages?.ACCEPTED_BY_DRIVER || 'Accepted by driver'), slug: 'ACCEPTED_BY_DRIVER', percentage: 45 },
|
|
50
|
-
{ key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_COMPLETED_BY_DRIVER || 'Pick up completed by driver'), slug: 'PICK_UP_COMPLETED_BY_DRIVER', percentage: 80 },
|
|
51
|
-
{ key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_FAILED_BY_DRIVER || 'Pick up Failed by driver'), slug: 'PICK_UP_FAILED_BY_DRIVER', percentage: 0 },
|
|
52
|
-
{ key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver'), slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 100 },
|
|
53
|
-
{ key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_FAILED_BY_DRIVER || 'Delivery Failed by driver'), slug: 'DELIVERY_FAILED_BY_DRIVER', percentage: 0 },
|
|
54
|
-
{ key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder'), slug: 'PREORDER', percentage: 0 },
|
|
55
|
-
{ key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready'), slug: 'ORDER_NOT_READY', percentage: 65 },
|
|
56
|
-
{ key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer'), slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', percentage: 100 },
|
|
57
|
-
{ key: 16, value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_STATUS_CANCELLED_BY_CUSTOMER || 'Order cancelled by customer'), slug: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER', percentage: 0 },
|
|
58
|
-
{ key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_NOT_PICKEDUP_BY_CUSTOMER || 'Order not picked up by customer'), slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER', percentage: 0 },
|
|
59
|
-
{ key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', percentage: 55 },
|
|
60
|
-
{ key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', percentage: 90 },
|
|
61
|
-
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90 },
|
|
62
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 },
|
|
63
|
-
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35 },
|
|
64
|
-
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
|
|
65
|
-
]
|
|
66
|
-
|
|
67
|
-
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
68
|
-
|
|
69
|
-
return objectStatus && objectStatus
|
|
70
|
-
}
|
|
71
|
-
|
|
72
39
|
const convertDiffToHours = (time) => {
|
|
73
40
|
if (!time) return
|
|
74
41
|
const deliveryTime = lastOrder?.delivery_datetime_utc
|
|
@@ -151,7 +151,7 @@ const ProductOptionsUI = (props) => {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
const handleSaveProduct = () => {
|
|
154
|
-
const isErrors = Object.values(errors)
|
|
154
|
+
const isErrors = Object.values(errors)?.length > 0
|
|
155
155
|
if (!isErrors) {
|
|
156
156
|
handleSave && handleSave()
|
|
157
157
|
return
|
|
@@ -212,7 +212,7 @@ const ProductOptionsUI = (props) => {
|
|
|
212
212
|
|
|
213
213
|
const getOverFlowImage = (url) => {
|
|
214
214
|
const keys = url.split('/')
|
|
215
|
-
const _videoId = keys[keys
|
|
215
|
+
const _videoId = keys[keys?.length - 1]
|
|
216
216
|
const overFlowImg = 'http://img.youtube.com/vi/' + _videoId + '/0.jpg'
|
|
217
217
|
return overFlowImg
|
|
218
218
|
}
|
|
@@ -230,7 +230,7 @@ const ProductOptionsUI = (props) => {
|
|
|
230
230
|
|
|
231
231
|
const scrollDown = () => {
|
|
232
232
|
const adjustHeight = windowSize?.width > 768 ? 50 : 55
|
|
233
|
-
const isErrors = Object.values(errors)
|
|
233
|
+
const isErrors = Object.values(errors)?.length > 0
|
|
234
234
|
if (!isErrors) {
|
|
235
235
|
return
|
|
236
236
|
}
|
|
@@ -272,8 +272,8 @@ const ProductOptionsUI = (props) => {
|
|
|
272
272
|
if (product?.ingredients.length > 0 || product?.extras.length > 0) {
|
|
273
273
|
const menuList = []
|
|
274
274
|
if (product?.ingredients?.length > 0) menuList.push('ingredients')
|
|
275
|
-
product?.extras
|
|
276
|
-
extra.
|
|
275
|
+
product?.extras.length > 0 && product?.extras.sort((a, b) => a.rank - b.rank).forEach(extra => {
|
|
276
|
+
extra?.options.length > 0 && extra?.options.sort((a, b) => a.rank - b.rank).forEach(option => {
|
|
277
277
|
showOption(option) && menuList.push(`id_${option?.id}`)
|
|
278
278
|
})
|
|
279
279
|
})
|
|
@@ -545,12 +545,12 @@ const ProductOptionsUI = (props) => {
|
|
|
545
545
|
<Divider />
|
|
546
546
|
<ProductEdition>
|
|
547
547
|
{
|
|
548
|
-
(product?.ingredients
|
|
548
|
+
(product?.ingredients?.length > 0 || product?.extras?.length > 0) && (
|
|
549
549
|
<ProductTabContainer id='all'>
|
|
550
550
|
<Tabs>
|
|
551
551
|
<AutoScroll scrollId='optionList'>
|
|
552
552
|
{
|
|
553
|
-
product?.ingredients
|
|
553
|
+
product?.ingredients?.length > 0 && (
|
|
554
554
|
<Tab
|
|
555
555
|
key='ingredients'
|
|
556
556
|
id='menu_ingredients'
|
|
@@ -563,7 +563,7 @@ const ProductOptionsUI = (props) => {
|
|
|
563
563
|
)
|
|
564
564
|
}
|
|
565
565
|
{
|
|
566
|
-
product?.extras.sort((a, b) => a.rank - b.rank).map(extra => extra.options
|
|
566
|
+
product?.extras.sort((a, b) => a.rank - b.rank).map(extra => extra.options?.sort((a, b) => a.rank - b.rank).map(option => {
|
|
567
567
|
return (
|
|
568
568
|
showOption(option) && (
|
|
569
569
|
<Tab
|
|
@@ -584,9 +584,9 @@ const ProductOptionsUI = (props) => {
|
|
|
584
584
|
</ProductTabContainer>
|
|
585
585
|
)
|
|
586
586
|
}
|
|
587
|
-
{product?.ingredients
|
|
587
|
+
{product?.ingredients?.length > 0 && (
|
|
588
588
|
<div id='ingredients'>
|
|
589
|
-
{product?.ingredients
|
|
589
|
+
{product?.ingredients?.length > 0 && (<SectionTitle>{t('INGREDIENTS', theme?.defaultLanguages.INGREDIENTS || 'Ingredients')}</SectionTitle>)}
|
|
590
590
|
<WrapperIngredients isProductSoldout={isSoldOut || maxProductQuantity <= 0}>
|
|
591
591
|
{product?.ingredients.map(ingredient => (
|
|
592
592
|
<ProductIngredient
|
|
@@ -602,7 +602,7 @@ const ProductOptionsUI = (props) => {
|
|
|
602
602
|
)}
|
|
603
603
|
<div>
|
|
604
604
|
{
|
|
605
|
-
product?.extras
|
|
605
|
+
product?.extras?.sort((a, b) => a.rank - b.rank).map(extra => extra.options.sort((a, b) => a.rank - b.rank).map(option => {
|
|
606
606
|
const currentState = productCart.options[`id:${option?.id}`] || {}
|
|
607
607
|
return (
|
|
608
608
|
<React.Fragment key={option?.id}>
|
|
@@ -6,7 +6,7 @@ import { ReviewProduct } from '../ReviewProduct'
|
|
|
6
6
|
import { ReviewDriver } from '../ReviewDriver'
|
|
7
7
|
|
|
8
8
|
import { useTheme } from 'styled-components'
|
|
9
|
-
import { getGoogleMapImage } from '../../../../../utils'
|
|
9
|
+
import { getGoogleMapImage, getOrderStatus } from '../../../../../utils'
|
|
10
10
|
import BsDot from '@meronex/icons/bs/BsDot'
|
|
11
11
|
import { Button } from '../../styles/Buttons'
|
|
12
12
|
import Skeleton from 'react-loading-skeleton'
|
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
const SingleOrderCardUI = (props) => {
|
|
34
34
|
const {
|
|
35
35
|
order,
|
|
36
|
-
getOrderStatus,
|
|
37
36
|
isBusinessesPage,
|
|
38
37
|
handleReorder,
|
|
39
38
|
customArray,
|
|
@@ -36,7 +36,7 @@ export const Button = styled.button`
|
|
|
36
36
|
padding-left: 15%
|
|
37
37
|
${props => props.theme?.rtl && css`
|
|
38
38
|
padding-right: 15%;
|
|
39
|
-
padding-left: 0
|
|
39
|
+
padding-left: 0;
|
|
40
40
|
`}
|
|
41
41
|
}
|
|
42
42
|
`}
|
|
@@ -259,3 +259,5 @@ export const Button = styled.button`
|
|
|
259
259
|
`}
|
|
260
260
|
`}
|
|
261
261
|
`
|
|
262
|
+
|
|
263
|
+
export default Button
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { SpinnerLoader } from '../../../src/components/SpinnerLoader'
|
|
1
|
+
import { cloneElement } from 'react'
|
|
4
2
|
import settings from '../../config'
|
|
5
3
|
|
|
6
4
|
export const SubdomainComponent = (props) => {
|
|
7
|
-
const [checkState, setCheckState] = useState({ loading: true, result: null, error: null })
|
|
8
|
-
|
|
9
5
|
const projectFromSubdomain = window.location.hostname.split('.').slice(0, 1).join()
|
|
10
6
|
const isValidSubdomain = window.location.hostname.includes('tryordering.com') || window.location.hostname.includes('ordering.co')
|
|
11
7
|
|
|
@@ -22,40 +18,9 @@ export const SubdomainComponent = (props) => {
|
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
const checkProject = async () => {
|
|
26
|
-
try {
|
|
27
|
-
const response = await fetch(`${settings?.api?.url}/${settings?.api?.version}/system/integrations/projects/check_availability?project_code=${project}`, {
|
|
28
|
-
method: 'GET',
|
|
29
|
-
headers: { 'Content-Type': 'application/json' }
|
|
30
|
-
})
|
|
31
|
-
const { error, result } = await response.json()
|
|
32
|
-
|
|
33
|
-
setCheckState({
|
|
34
|
-
...checkState,
|
|
35
|
-
loading: false,
|
|
36
|
-
result: error ? [] : result,
|
|
37
|
-
error: error
|
|
38
|
-
? typeof result === 'string' ? result : result?.[0]
|
|
39
|
-
: null
|
|
40
|
-
})
|
|
41
|
-
} catch (error) {
|
|
42
|
-
setCheckState({
|
|
43
|
-
...checkState,
|
|
44
|
-
loading: false,
|
|
45
|
-
error: error.message
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
checkProject()
|
|
52
|
-
}, [])
|
|
53
|
-
|
|
54
21
|
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
settings: { ...settings, project }
|
|
59
|
-
})
|
|
22
|
+
cloneElement(props.children, {
|
|
23
|
+
settings: { ...settings, project }
|
|
24
|
+
})
|
|
60
25
|
)
|
|
61
26
|
}
|
package/template/config.json
CHANGED
|
@@ -86,6 +86,9 @@ export const MultiCheckout = (props) => {
|
|
|
86
86
|
cartUuid,
|
|
87
87
|
errors,
|
|
88
88
|
clearErrors: () => setErrors([]),
|
|
89
|
+
handleSearchRedirect: () => {
|
|
90
|
+
events.emit('go_to_page', { page: 'search' })
|
|
91
|
+
},
|
|
89
92
|
onRedirectPage: (data) => events.emit('go_to_page', data),
|
|
90
93
|
onPlaceOrderClick: (order) => {
|
|
91
94
|
events.emit('go_to_page', { page: 'multi_orders', params: { orderId: order?.id } })
|
|
@@ -100,3 +103,5 @@ export const MultiCheckout = (props) => {
|
|
|
100
103
|
</>
|
|
101
104
|
)
|
|
102
105
|
}
|
|
106
|
+
|
|
107
|
+
export default MultiCheckout
|