ordering-ui-external 1.9.3 → 1.9.5
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.ea0875b41af5b7f1d809.js → 0.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{1.ordering-ui.ea0875b41af5b7f1d809.js → 1.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{2.ordering-ui.ea0875b41af5b7f1d809.js → 2.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{4.ordering-ui.ea0875b41af5b7f1d809.js → 4.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{5.ordering-ui.ea0875b41af5b7f1d809.js → 5.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{6.ordering-ui.ea0875b41af5b7f1d809.js → 6.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{7.ordering-ui.ea0875b41af5b7f1d809.js → 7.ordering-ui.55652fab015bca672f9d.js} +1 -1
- package/_bundles/{7.ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt → 7.ordering-ui.55652fab015bca672f9d.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.ea0875b41af5b7f1d809.js → 8.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{9.ordering-ui.ea0875b41af5b7f1d809.js → 9.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/ordering-ui.55652fab015bca672f9d.js +2 -0
- package/_bundles/{ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt → ordering-ui.55652fab015bca672f9d.js.LICENSE.txt} +0 -0
- package/_modules/components/BusinessesListing/index.js +1 -3
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +17 -2
- package/_modules/components/VerticalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +14 -6
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +24 -60
- package/_modules/themes/five/src/components/Cart/index.js +52 -96
- package/_modules/themes/five/src/components/CartContent/index.js +25 -72
- package/_modules/themes/five/src/components/MultiCheckout/index.js +2 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +7 -1
- package/_modules/themes/five/src/components/OrdersOption/index.js +2 -1
- package/_modules/utils/index.js +136 -2
- package/package.json +2 -2
- package/src/components/BusinessesListing/index.js +1 -3
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +13 -2
- package/src/components/VerticalOrdersLayout/styles.js +8 -0
- package/src/themes/five/src/components/BusinessListingSearch/index.js +4 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +218 -261
- package/src/themes/five/src/components/Cart/index.js +44 -54
- package/src/themes/five/src/components/CartContent/index.js +23 -41
- package/src/themes/five/src/components/MultiCheckout/index.js +1 -7
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +19 -13
- package/src/themes/five/src/components/OrdersOption/index.js +2 -1
- package/src/utils/index.js +35 -1
- package/template/app.js +178 -65
- package/template/components/ListenPageChanges/index.js +1 -1
- package/template/pages/MultiCart/index.js +6 -0
- package/_bundles/ordering-ui.ea0875b41af5b7f1d809.js +0 -2
package/template/app.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import PWAPrompt from 'react-ios-pwa-prompt'
|
|
3
|
+
import { useTheme, ThemeProvider } from 'styled-components'
|
|
4
|
+
import loadable from '@loadable/component'
|
|
2
5
|
import {
|
|
3
6
|
Switch,
|
|
4
7
|
Route,
|
|
@@ -6,65 +9,82 @@ import {
|
|
|
6
9
|
Link,
|
|
7
10
|
useLocation
|
|
8
11
|
} from 'react-router-dom'
|
|
9
|
-
import { useTheme, ThemeProvider } from 'styled-components'
|
|
10
|
-
import PWAPrompt from 'react-ios-pwa-prompt'
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import {
|
|
14
|
+
useSession,
|
|
15
|
+
useApi,
|
|
16
|
+
useLanguage,
|
|
17
|
+
useOrder,
|
|
18
|
+
Analytics,
|
|
19
|
+
FacebookPixel,
|
|
20
|
+
useConfig,
|
|
21
|
+
AnalyticsSegment,
|
|
22
|
+
useEvent,
|
|
23
|
+
useOrderingTheme,
|
|
24
|
+
useSite
|
|
25
|
+
} from 'ordering-components-external'
|
|
17
26
|
|
|
18
|
-
import { SpinnerLoader } from '../src/components/SpinnerLoader'
|
|
19
|
-
import { Header as HeaderOld } from '../src/components/Header'
|
|
20
|
-
import { Header as HeaderRed } from '../src/themes/seven/src/components/Header'
|
|
21
|
-
import { Header as HeaderStarbucks } from '../src/themes/six/src/components/Header'
|
|
22
27
|
import { useOnlineStatus } from '../src/hooks/useOnlineStatus'
|
|
23
28
|
import { useWindowSize } from '../src/hooks/useWindowSize'
|
|
24
|
-
|
|
25
|
-
import { SmartAppBanner } from '../src/components/SmartAppBanner'
|
|
26
|
-
|
|
27
|
-
import { NavigationBar } from '../src/themes/five/src/components/NavigationBar'
|
|
28
|
-
import { Modal } from '../src/themes/five/src/components/Modal'
|
|
29
|
-
|
|
30
|
-
import { ReviewTrigger } from '../src/themes/five/src/components/ReviewTrigger'
|
|
31
|
-
import { ReviewOrder } from '../src/themes/five/src/components/ReviewOrder'
|
|
32
|
-
import { ReviewProduct } from '../src/themes/five/src/components/ReviewProduct'
|
|
33
|
-
import { ReviewDriver } from '../src/themes/five/src/components/ReviewDriver'
|
|
34
|
-
import { SignUpApproval } from '../src/themes/five/src/components/SignUpApproval'
|
|
35
|
-
|
|
36
|
-
import { AddressList } from './pages/AddressList'
|
|
37
|
-
import { BusinessesList } from './pages/BusinessesList'
|
|
38
|
-
import { BusinessProductsList } from './pages/BusinessProductsList'
|
|
39
|
-
import { CheckoutPage } from './pages/Checkout'
|
|
40
|
-
import { Cms } from './pages/Cms'
|
|
41
|
-
import { HomePage } from './pages/Home'
|
|
42
|
-
import { MyOrders } from './pages/MyOrders'
|
|
43
|
-
import { OrderDetailsPage } from './pages/OrderDetails'
|
|
44
|
-
import { PageNotFound } from './pages/PageNotFound'
|
|
45
|
-
import { PagesList } from './pages/PagesList'
|
|
46
|
-
import { Profile } from './pages/Profile'
|
|
47
|
-
import { Wallets } from './pages/Wallets'
|
|
48
|
-
import { MessagesList } from './pages/MessagesList'
|
|
49
|
-
import { Help } from './pages/Help'
|
|
50
|
-
import { Favorite } from './pages/Favorite'
|
|
51
|
-
import { SessionsList } from './pages/SessionsList'
|
|
52
|
-
import { SignUpBusiness } from './pages/SignUpBusiness'
|
|
53
|
-
import { SignUpDriver } from './pages/SignUpDriver'
|
|
54
|
-
import { UserVerification } from './pages/UserVerification'
|
|
55
|
-
import { BusinessListingSearch } from './pages/BusinessListingSearch'
|
|
56
|
-
import { ResetPassword } from './pages/ResetPassword'
|
|
57
|
-
import { ScrollToTop } from './components/ScrollToTop'
|
|
58
|
-
import { ListenPageChanges } from './components/ListenPageChanges'
|
|
59
|
-
import { HelmetTags } from './components/HelmetTags'
|
|
29
|
+
|
|
60
30
|
import settings from './config'
|
|
61
|
-
import {
|
|
62
|
-
|
|
63
|
-
import {
|
|
64
|
-
import { CancellationComponent } from '../src/components/CancellationComponent'
|
|
65
|
-
import { Button } from '../src/themes/five/src/styles/Buttons'
|
|
31
|
+
import { orderingThemeUpdated } from './components/OrderingThemeUpdated'
|
|
32
|
+
|
|
33
|
+
import { SpinnerLoader } from '../src/components/SpinnerLoader'
|
|
66
34
|
import { Input } from '../src/themes/five/src/styles/Inputs'
|
|
67
35
|
|
|
36
|
+
const Header = loadable(() => import('../src/themes/five/src/components/Header'))
|
|
37
|
+
const HeaderKiosk = loadable(() => import('../src/themes/five/src/components/Header/layouts/Kiosk'))
|
|
38
|
+
const NotNetworkConnectivity = loadable(() => import('../src/themes/five/src/components/NotNetworkConnectivity'))
|
|
39
|
+
const Footer = loadable(() => import('../src/themes/five/src/components/Footer'))
|
|
40
|
+
const NavigationBar = loadable(() => import('../src/themes/five/src/components/NavigationBar'))
|
|
41
|
+
const Modal = loadable(() => import('../src/themes/five/src/components/Modal'))
|
|
42
|
+
const ReviewTrigger = loadable(() => import('../src/themes/five/src/components/ReviewTrigger'))
|
|
43
|
+
const ReviewOrder = loadable(() => import('../src/themes/five/src/components/ReviewOrder'))
|
|
44
|
+
const ReviewProduct = loadable(() => import('../src/themes/five/src/components/ReviewProduct'))
|
|
45
|
+
const ReviewDriver = loadable(() => import('../src/themes/five/src/components/ReviewDriver'))
|
|
46
|
+
const SignUpApproval = loadable(() => import('../src/themes/five/src/components/SignUpApproval'))
|
|
47
|
+
const Button = loadable(() => import('../src/themes/five/src/styles/Buttons'))
|
|
48
|
+
|
|
49
|
+
const Alert = loadable(() => import('../src/components/Confirm'))
|
|
50
|
+
const HeaderOld = loadable(() => import('../src/components/Header'))
|
|
51
|
+
|
|
52
|
+
const SmartAppBanner = loadable(() => import('../src/components/SmartAppBanner'))
|
|
53
|
+
const CancellationComponent = loadable(() => import('../src/components/CancellationComponent'))
|
|
54
|
+
|
|
55
|
+
const HeaderRed = loadable(() => import('../src/themes/seven/src/components/Header'))
|
|
56
|
+
const HeaderStarbucks = loadable(() => import('../src/themes/six/src/components/Header'))
|
|
57
|
+
|
|
58
|
+
const AddressList = loadable(() => import('./pages/AddressList'))
|
|
59
|
+
const BusinessesList = loadable(() => import('./pages/BusinessesList'))
|
|
60
|
+
const CheckoutPage = loadable(() => import('./pages/Checkout'))
|
|
61
|
+
const Cms = loadable(() => import('./pages/Cms'))
|
|
62
|
+
const HomePage = loadable(() => import('./pages/Home'))
|
|
63
|
+
const MyOrders = loadable(() => import('./pages/MyOrders'))
|
|
64
|
+
const OrderDetailsPage = loadable(() => import('./pages/OrderDetails'))
|
|
65
|
+
const PageNotFound = loadable(() => import('./pages/PageNotFound'))
|
|
66
|
+
const PagesList = loadable(() => import('./pages/PagesList'))
|
|
67
|
+
const Profile = loadable(() => import('./pages/Profile'))
|
|
68
|
+
const Wallets = loadable(() => import('./pages/Wallets'))
|
|
69
|
+
const MessagesList = loadable(() => import('./pages/MessagesList'))
|
|
70
|
+
const Help = loadable(() => import('./pages/Help'))
|
|
71
|
+
const Favorite = loadable(() => import('./pages/Favorite'))
|
|
72
|
+
const SessionsList = loadable(() => import('./pages/SessionsList'))
|
|
73
|
+
const SignUpBusiness = loadable(() => import('./pages/SignUpBusiness'))
|
|
74
|
+
const SignUpDriver = loadable(() => import('./pages/SignUpDriver'))
|
|
75
|
+
const UserVerification = loadable(() => import('./pages/UserVerification'))
|
|
76
|
+
const BusinessListingSearch = loadable(() => import('./pages/BusinessListingSearch'))
|
|
77
|
+
const ResetPassword = loadable(() => import('./pages/ResetPassword'))
|
|
78
|
+
const Promotions = loadable(() => import('./pages/Promotions'))
|
|
79
|
+
const MultiCheckout = loadable(() => import('./pages/MultiCheckout'))
|
|
80
|
+
const MultiCart = loadable(() => import('./pages/MultiCart'))
|
|
81
|
+
const MultiOrdersDetails = loadable(() => import('./pages/MultiOrdersDetails'))
|
|
82
|
+
const BusinessProductsList = loadable(() => import('./pages/BusinessProductsList'))
|
|
83
|
+
|
|
84
|
+
const ScrollToTop = loadable(() => import('./components/ScrollToTop'))
|
|
85
|
+
const ListenPageChanges = loadable(() => import('./components/ListenPageChanges'))
|
|
86
|
+
const HelmetTags = loadable(() => import('./components/HelmetTags'))
|
|
87
|
+
|
|
68
88
|
export const App = () => {
|
|
69
89
|
const [{ auth, user }, { login }] = useSession()
|
|
70
90
|
const [events] = useEvent()
|
|
@@ -81,6 +101,7 @@ export const App = () => {
|
|
|
81
101
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
82
102
|
const windowSize = useWindowSize()
|
|
83
103
|
const [businessSignUpSuccessed, setBusinessSignUpSuccessed] = useState({ open: false, content: {} })
|
|
104
|
+
const [searchValue, setSearchValue] = useState('')
|
|
84
105
|
const [lastOrderReview, setLastOrderReview] = useState({
|
|
85
106
|
isReviewOpen: false,
|
|
86
107
|
order: null,
|
|
@@ -100,6 +121,38 @@ export const App = () => {
|
|
|
100
121
|
...theme.colors,
|
|
101
122
|
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color && { primary: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color }),
|
|
102
123
|
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color && { links: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color })
|
|
124
|
+
},
|
|
125
|
+
images: {
|
|
126
|
+
...theme.images,
|
|
127
|
+
general: {
|
|
128
|
+
...theme.images.general,
|
|
129
|
+
homeHero: orderingTheme?.theme?.homepage_view?.components?.homepage_header?.components?.image || theme.images?.general?.homeHero,
|
|
130
|
+
businessHero: orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image || theme.images?.general?.businessHero,
|
|
131
|
+
notFound: orderingTheme?.theme?.business_listing_view?.components?.not_found_source?.components?.image || theme.images?.general?.notFound,
|
|
132
|
+
emptyActiveOrders: orderingTheme?.theme?.orders?.components?.active_orders?.components?.not_found_source?.components?.image || theme.images?.general?.emptyActiveOrders,
|
|
133
|
+
emptyPastOrders: orderingTheme?.theme?.orders?.components?.past_orders?.components?.not_found_source?.components?.image,
|
|
134
|
+
notNetwork: orderingTheme?.theme?.no_internet?.components?.image || theme.images?.general?.notNetwork,
|
|
135
|
+
businessSignUpHero: orderingTheme?.theme?.business_signup?.components?.icon?.components?.image || theme.images?.general?.businessSignUpHero,
|
|
136
|
+
driverSignUpHero: orderingTheme?.theme?.driver_signup?.components?.icon?.components?.image || theme.images?.general?.driverSignUpHero
|
|
137
|
+
},
|
|
138
|
+
categories: {
|
|
139
|
+
...theme.images.categories,
|
|
140
|
+
food: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.food?.image || theme.images.categories.categoryFood,
|
|
141
|
+
groceries: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.groceries?.image || theme.images.categories.categoryGroceries,
|
|
142
|
+
alcohol: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.alcohol?.image || theme.images.categories.categoryAlcohol,
|
|
143
|
+
laundry: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.laundry?.image || theme.images.categories.categoryLaundry,
|
|
144
|
+
all: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.all?.image || theme.images.categories.categoryAll
|
|
145
|
+
},
|
|
146
|
+
dummies: {
|
|
147
|
+
...theme.images.dummies,
|
|
148
|
+
businessHeader: orderingTheme?.theme?.business_view?.components?.header?.components?.dummy_image || theme.images.dummies.businessHeader,
|
|
149
|
+
businessLogo: orderingTheme?.theme?.business_view?.components?.header?.components?.logo?.dummy_image || theme.images.dummies.businessLogo,
|
|
150
|
+
product: orderingTheme?.theme?.business_view?.components?.products?.components?.photo?.components?.dummy_image || theme.images.dummies.product
|
|
151
|
+
},
|
|
152
|
+
logos: {
|
|
153
|
+
...theme.images.logos,
|
|
154
|
+
logotype: orderingTheme?.theme?.header?.components?.logo?.components?.image || theme.images.logos.logotype
|
|
155
|
+
}
|
|
103
156
|
}
|
|
104
157
|
}
|
|
105
158
|
|
|
@@ -140,6 +193,9 @@ export const App = () => {
|
|
|
140
193
|
const isUserVerifyRequired = (isEmailVerifyRequired || isPhoneVerifyRequired) && !isKioskApp
|
|
141
194
|
const isHideFooter = orderingTheme?.theme?.footer?.hidden
|
|
142
195
|
|
|
196
|
+
const isHome = location.pathname === '/' || location.pathname === '/home'
|
|
197
|
+
const isFooterPage = location.pathname === '/pages/footer' || isKioskApp || isHideFooter
|
|
198
|
+
|
|
143
199
|
const closeAlert = () => {
|
|
144
200
|
setAlertState({
|
|
145
201
|
open: false,
|
|
@@ -152,9 +208,6 @@ export const App = () => {
|
|
|
152
208
|
window.location.reload()
|
|
153
209
|
}
|
|
154
210
|
|
|
155
|
-
const isHome = location.pathname === '/' || location.pathname === '/home'
|
|
156
|
-
const isFooterPage = location.pathname === '/pages/footer' || isKioskApp || isHideFooter
|
|
157
|
-
|
|
158
211
|
const handleSuccessSignup = (user) => {
|
|
159
212
|
if (!user?.enabled && (configs?.business_signup_enabled_default?.value === '0' || configs?.driver_signup_enabled_default?.value === '0')) {
|
|
160
213
|
signUpBusinesslayout === 'new'
|
|
@@ -277,6 +330,40 @@ export const App = () => {
|
|
|
277
330
|
}
|
|
278
331
|
}
|
|
279
332
|
|
|
333
|
+
useEffect(() => {
|
|
334
|
+
const link = document.createElement('link')
|
|
335
|
+
const oldLink = document.getElementById('favicon')
|
|
336
|
+
link.id = 'favicon'
|
|
337
|
+
link.rel = 'icon'
|
|
338
|
+
link.href = themeUpdated?.general?.components?.favicon
|
|
339
|
+
if (oldLink) {
|
|
340
|
+
document.head.removeChild(oldLink)
|
|
341
|
+
}
|
|
342
|
+
document.head.appendChild(link)
|
|
343
|
+
const fonts = Object.entries(themeUpdated?.general?.components?.fonts || {})
|
|
344
|
+
fonts.forEach(([name, fontFamily]) => {
|
|
345
|
+
const fontElement = window.document.getElementById(`${name}-font-styles`)
|
|
346
|
+
if (
|
|
347
|
+
(fontElement?.name !== fontFamily.name && fontFamily.name) ||
|
|
348
|
+
(fontElement?.href !== fontFamily?.href && fontFamily?.href)
|
|
349
|
+
) {
|
|
350
|
+
window.document.body.removeChild(window.document.getElementById(`${name}-font-styles`))
|
|
351
|
+
const font = window.document.createElement('link')
|
|
352
|
+
font.id = `${name}-font-styles`
|
|
353
|
+
font.rel = 'stylesheet'
|
|
354
|
+
font.async = true
|
|
355
|
+
font.defer = true
|
|
356
|
+
font.name = fontFamily.name
|
|
357
|
+
font.href = fontFamily.href || `https://fonts.googleapis.com/css2?family=${fontFamily.name}:wght@${fontFamily.weights.join(';')}&display=swap`
|
|
358
|
+
|
|
359
|
+
window.document.body.appendChild(font)
|
|
360
|
+
if (name === 'primary') {
|
|
361
|
+
window.document.body.style.fontFamily = fontFamily.name
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
})
|
|
365
|
+
}, [themeUpdated])
|
|
366
|
+
|
|
280
367
|
useEffect(() => {
|
|
281
368
|
if (!isShowReviewsPopupEnabled) return
|
|
282
369
|
const _user = window.localStorage.getItem('user')
|
|
@@ -367,13 +454,17 @@ export const App = () => {
|
|
|
367
454
|
/>
|
|
368
455
|
{
|
|
369
456
|
loaded && (
|
|
370
|
-
<ThemeProvider
|
|
457
|
+
<ThemeProvider
|
|
458
|
+
theme={orderingThemeUpdated(theme, orderingTheme)}
|
|
459
|
+
>
|
|
371
460
|
<ListenPageChanges />
|
|
372
461
|
{!(isKioskApp && isHome) && (
|
|
373
462
|
<HeaderComponent
|
|
374
463
|
isHome={isHome}
|
|
375
464
|
location={location}
|
|
376
465
|
isCustomLayout={singleBusinessConfig.isActive}
|
|
466
|
+
searchValue={searchValue}
|
|
467
|
+
setSearchValue={setSearchValue}
|
|
377
468
|
/>
|
|
378
469
|
)}
|
|
379
470
|
<NotNetworkConnectivity />
|
|
@@ -507,7 +598,7 @@ export const App = () => {
|
|
|
507
598
|
<Redirect to='/verify' />
|
|
508
599
|
) : (
|
|
509
600
|
orderStatus.options?.address?.location
|
|
510
|
-
? <BusinessesList />
|
|
601
|
+
? <BusinessesList searchValueCustom={searchValue} />
|
|
511
602
|
: <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
|
|
512
603
|
)
|
|
513
604
|
)
|
|
@@ -553,7 +644,7 @@ export const App = () => {
|
|
|
553
644
|
/>
|
|
554
645
|
)}
|
|
555
646
|
</Route>
|
|
556
|
-
<Route path='/multi-checkout'>
|
|
647
|
+
<Route exact path='/multi-checkout/:cartUuid?'>
|
|
557
648
|
{auth
|
|
558
649
|
? isUserVerifyRequired
|
|
559
650
|
? <Redirect to='/verify' />
|
|
@@ -568,7 +659,22 @@ export const App = () => {
|
|
|
568
659
|
/>
|
|
569
660
|
)}
|
|
570
661
|
</Route>
|
|
571
|
-
<Route path='/multi-
|
|
662
|
+
<Route exact path='/multi-cart'>
|
|
663
|
+
{auth
|
|
664
|
+
? isUserVerifyRequired
|
|
665
|
+
? <Redirect to='/verify' />
|
|
666
|
+
: <MultiCart />
|
|
667
|
+
: (
|
|
668
|
+
<Redirect to={{
|
|
669
|
+
pathname: singleBusinessConfig.isActive
|
|
670
|
+
? `/${singleBusinessConfig.businessSlug}`
|
|
671
|
+
: '/',
|
|
672
|
+
state: { from: location.pathname || null }
|
|
673
|
+
}}
|
|
674
|
+
/>
|
|
675
|
+
)}
|
|
676
|
+
</Route>
|
|
677
|
+
<Route exact path='/multi-orders/:orderId'>
|
|
572
678
|
{auth
|
|
573
679
|
? isUserVerifyRequired
|
|
574
680
|
? <Redirect to='/verify' />
|
|
@@ -648,35 +754,42 @@ export const App = () => {
|
|
|
648
754
|
<BusinessProductsList />
|
|
649
755
|
)}
|
|
650
756
|
</Route>
|
|
651
|
-
<Route exact path='/:business_slug'>
|
|
757
|
+
<Route exact path='/store/:business_slug'>
|
|
652
758
|
{isUserVerifyRequired ? (
|
|
653
759
|
<Redirect to='/verify' />
|
|
654
760
|
) : (
|
|
655
761
|
<BusinessProductsList />
|
|
656
762
|
)}
|
|
657
763
|
</Route>
|
|
658
|
-
<Route exact path='/:business_slug/:category_slug/:product_slug'>
|
|
764
|
+
<Route exact path='/store/:business_slug/:category_slug/:product_slug'>
|
|
659
765
|
{isUserVerifyRequired ? (
|
|
660
766
|
<Redirect to='/verify' />
|
|
661
767
|
) : (
|
|
662
768
|
<BusinessProductsList />
|
|
663
769
|
)}
|
|
664
770
|
</Route>
|
|
665
|
-
<Route exact path='/store/:
|
|
771
|
+
<Route exact path='/store/:category_slug/:product_slug'>
|
|
666
772
|
{isUserVerifyRequired ? (
|
|
667
773
|
<Redirect to='/verify' />
|
|
668
774
|
) : (
|
|
669
775
|
<BusinessProductsList />
|
|
670
776
|
)}
|
|
671
777
|
</Route>
|
|
672
|
-
<Route exact path='
|
|
778
|
+
<Route exact path='/:business_slug'>
|
|
673
779
|
{isUserVerifyRequired ? (
|
|
674
780
|
<Redirect to='/verify' />
|
|
675
781
|
) : (
|
|
676
782
|
<BusinessProductsList />
|
|
677
783
|
)}
|
|
678
784
|
</Route>
|
|
679
|
-
<Route exact path='
|
|
785
|
+
<Route exact path='/:business_slug/:category_slug/:product_slug'>
|
|
786
|
+
{isUserVerifyRequired ? (
|
|
787
|
+
<Redirect to='/verify' />
|
|
788
|
+
) : (
|
|
789
|
+
<BusinessProductsList />
|
|
790
|
+
)}
|
|
791
|
+
</Route>
|
|
792
|
+
<Route exact path='/:business_slug/:category_slug'>
|
|
680
793
|
{isUserVerifyRequired ? (
|
|
681
794
|
<Redirect to='/verify' />
|
|
682
795
|
) : (
|
|
@@ -695,7 +808,7 @@ export const App = () => {
|
|
|
695
808
|
{(!isFooterPage || enabledPoweredByOrdering) && (
|
|
696
809
|
<Footer isFooterPage={isFooterPage} />
|
|
697
810
|
)}
|
|
698
|
-
{windowSize.width < 576 && onlineStatus && (
|
|
811
|
+
{(windowSize.width < 576 && onlineStatus) && (
|
|
699
812
|
<NavigationBar />
|
|
700
813
|
)}
|
|
701
814
|
<Alert
|
|
@@ -33,7 +33,7 @@ export const ListenPageChanges = ({ children }) => {
|
|
|
33
33
|
checkout_list: '/checkout',
|
|
34
34
|
multi_checkout: '/multi-checkout/:cartUuid',
|
|
35
35
|
multi_orders: '/multi-orders/:orderId',
|
|
36
|
-
multi_cart: '/multi-cart
|
|
36
|
+
multi_cart: '/multi-cart',
|
|
37
37
|
business: businessUrl,
|
|
38
38
|
business_slug: '/:store',
|
|
39
39
|
product: productUrl,
|
|
@@ -10,6 +10,12 @@ export const MultiCart = (props) => {
|
|
|
10
10
|
const multiCheckoutProps = {
|
|
11
11
|
...props,
|
|
12
12
|
onRedirectPage: (data) => events.emit('go_to_page', data),
|
|
13
|
+
handleOnRedirectMultiCheckout: (cartUuid) => {
|
|
14
|
+
events.emit('go_to_page', { page: 'multi_checkout', params: { cartUuid }, replace: true })
|
|
15
|
+
},
|
|
16
|
+
handleOnRedirectCheckout: (cartUuid) => {
|
|
17
|
+
events.emit('go_to_page', { page: 'checkout', params: { cartUuid }, replace: true })
|
|
18
|
+
},
|
|
13
19
|
cartUuid,
|
|
14
20
|
cartGroup
|
|
15
21
|
}
|