ordering-ui-external 1.5.5 → 1.6.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.
Files changed (94) hide show
  1. package/_bundles/{0.ordering-ui.cb87b9b647114f245c57.js → 0.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  2. package/_bundles/{1.ordering-ui.cb87b9b647114f245c57.js → 1.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  3. package/_bundles/{2.ordering-ui.cb87b9b647114f245c57.js → 2.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  4. package/_bundles/{4.ordering-ui.cb87b9b647114f245c57.js → 4.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  5. package/_bundles/{5.ordering-ui.cb87b9b647114f245c57.js → 5.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  6. package/_bundles/{6.ordering-ui.cb87b9b647114f245c57.js → 6.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  7. package/_bundles/7.ordering-ui.9399c2752e3ad5f2250b.js +2 -0
  8. package/_bundles/{7.ordering-ui.cb87b9b647114f245c57.js.LICENSE.txt → 7.ordering-ui.9399c2752e3ad5f2250b.js.LICENSE.txt} +18 -0
  9. package/_bundles/{8.ordering-ui.cb87b9b647114f245c57.js → 8.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  10. package/_bundles/{9.ordering-ui.cb87b9b647114f245c57.js → 9.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
  11. package/_bundles/ordering-ui.9399c2752e3ad5f2250b.js +2 -0
  12. package/_bundles/{ordering-ui.cb87b9b647114f245c57.js.LICENSE.txt → ordering-ui.9399c2752e3ad5f2250b.js.LICENSE.txt} +0 -0
  13. package/_modules/components/BusinessTypeFilter/index.js +6 -3
  14. package/_modules/components/CancellationComponent/index.js +58 -0
  15. package/_modules/components/CancellationComponent/styles.js +43 -0
  16. package/_modules/components/Header/index.js +1 -1
  17. package/_modules/index.js +7 -0
  18. package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +1 -1
  19. package/_modules/themes/five/src/components/AddressForm/index.js +5 -5
  20. package/_modules/themes/five/src/components/AddressList/index.js +3 -1
  21. package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
  22. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +4 -2
  23. package/_modules/themes/five/src/components/BusinessController/index.js +22 -13
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +2 -2
  25. package/_modules/themes/five/src/components/BusinessReviews/index.js +4 -4
  26. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +8 -5
  27. package/_modules/themes/five/src/components/CartPopover/styles.js +1 -1
  28. package/_modules/themes/five/src/components/Footer/index.js +7 -2
  29. package/_modules/themes/five/src/components/Header/index.js +6 -3
  30. package/_modules/themes/five/src/components/HomeHero/index.js +5 -3
  31. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +15 -7
  32. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +21 -18
  33. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +2 -2
  34. package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +1 -1
  35. package/_modules/themes/five/src/components/OrderDetails/OrderActionsSection.js +38 -0
  36. package/_modules/themes/five/src/components/OrderDetails/OrderHeaderInfoSection.js +27 -0
  37. package/_modules/themes/five/src/components/OrderDetails/index.js +65 -61
  38. package/_modules/themes/five/src/components/OrderDetails/styles.js +7 -5
  39. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -2
  40. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +2 -2
  41. package/_modules/themes/five/src/components/OrdersOption/index.js +4 -2
  42. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +5 -3
  43. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +7 -0
  44. package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
  45. package/_modules/themes/five/src/components/SingleProductCard/index.js +4 -4
  46. package/_modules/themes/five/src/components/UserFormDetails/index.js +51 -26
  47. package/_modules/themes/five/src/components/UserFormDetails/styles.js +9 -3
  48. package/_modules/themes/five/src/components/UserVerification/index.js +7 -2
  49. package/index-template.js +9 -5
  50. package/package.json +2 -2
  51. package/src/components/BusinessTypeFilter/index.js +2 -2
  52. package/src/components/CancellationComponent/index.js +62 -0
  53. package/src/components/CancellationComponent/styles.js +162 -0
  54. package/src/components/Header/index.js +1 -1
  55. package/src/index.js +2 -0
  56. package/src/themes/callcenterOriginal/src/components/Header/styles.js +1 -0
  57. package/src/themes/five/src/components/AddressForm/index.js +2 -2
  58. package/src/themes/five/src/components/AddressList/index.js +2 -1
  59. package/src/themes/five/src/components/AddressList/styles.js +4 -1
  60. package/src/themes/five/src/components/BusinessBasicInformation/index.js +3 -2
  61. package/src/themes/five/src/components/BusinessController/index.js +68 -44
  62. package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +6 -1
  63. package/src/themes/five/src/components/BusinessReviews/index.js +4 -4
  64. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +16 -12
  65. package/src/themes/five/src/components/CartPopover/styles.js +1 -1
  66. package/src/themes/five/src/components/Footer/index.js +6 -3
  67. package/src/themes/five/src/components/Header/index.js +4 -3
  68. package/src/themes/five/src/components/HomeHero/index.js +4 -2
  69. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +18 -6
  70. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +3 -0
  71. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +1 -1
  72. package/src/themes/five/src/components/MultiOrdersDetails/styles.js +5 -1
  73. package/src/themes/five/src/components/OrderDetails/OrderActionsSection.js +33 -0
  74. package/src/themes/five/src/components/OrderDetails/OrderHeaderInfoSection.js +20 -0
  75. package/src/themes/five/src/components/OrderDetails/index.js +85 -101
  76. package/src/themes/five/src/components/OrderDetails/styles.js +4 -1
  77. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +4 -2
  78. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +2 -2
  79. package/src/themes/five/src/components/OrdersOption/index.js +3 -1
  80. package/src/themes/five/src/components/ProductItemAccordion/index.js +4 -2
  81. package/src/themes/five/src/components/RenderProductsLayout/index.js +10 -1
  82. package/src/themes/five/src/components/SignUpApproval/index.js +6 -7
  83. package/src/themes/five/src/components/SingleProductCard/index.js +3 -3
  84. package/src/themes/five/src/components/UserFormDetails/index.js +59 -23
  85. package/src/themes/five/src/components/UserFormDetails/styles.js +26 -0
  86. package/src/themes/five/src/components/UserVerification/index.js +18 -11
  87. package/template/app.js +394 -370
  88. package/template/assets/images/home-hero-mobile.jpg +0 -0
  89. package/template/components/HelmetTags/index.js +4 -2
  90. package/template/components/SubdomainComponent/index.js +61 -0
  91. package/template/config.json +4 -1
  92. package/template/pages/Home/index.js +5 -3
  93. package/_bundles/7.ordering-ui.cb87b9b647114f245c57.js +0 -2
  94. package/_bundles/ordering-ui.cb87b9b647114f245c57.js +0 -2
package/template/app.js CHANGED
@@ -61,6 +61,9 @@ import settings from './config'
61
61
  import { Promotions } from './pages/Promotions'
62
62
  import { MultiCheckout } from './pages/MultiCheckout'
63
63
  import { MultiOrdersDetails } from './pages/MultiOrdersDetails'
64
+ import { CancellationComponent } from '../src/components/CancellationComponent'
65
+ import { Button } from '../src/themes/five/src/styles/Buttons'
66
+ import { Input } from '../src/themes/five/src/styles/Inputs'
64
67
 
65
68
  export const App = () => {
66
69
  const [{ auth, user }, { login }] = useSession()
@@ -76,7 +79,6 @@ export const App = () => {
76
79
  const onlineStatus = useOnlineStatus()
77
80
  const location = useLocation()
78
81
  const [alertState, setAlertState] = useState({ open: false, content: [] })
79
- const signUplayout = 'new'
80
82
  const windowSize = useWindowSize()
81
83
  const [businessSignUpSuccessed, setBusinessSignUpSuccessed] = useState({ open: false, content: {} })
82
84
  const [lastOrderReview, setLastOrderReview] = useState({
@@ -86,12 +88,18 @@ export const App = () => {
86
88
  reviewStatus: { trigger: false, order: false, product: false, driver: false },
87
89
  reviewed: { isOrderReviewed: false, isProductReviewed: false, isDriverReviewed: false }
88
90
  })
91
+ const isShowReviewsPopupEnabled = configs?.show_reviews_popups_enabled?.value === '1'
89
92
  const hashKey = new URLSearchParams(useLocation()?.search)?.get('hash') || null
90
93
  const isKioskApp = settings?.use_kiosk
91
94
 
92
95
  const themeUpdated = {
93
96
  ...theme,
94
- ...orderingTheme?.theme
97
+ ...orderingTheme?.theme,
98
+ colors: {
99
+ ...theme.colors,
100
+ ...(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 }),
101
+ ...(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 })
102
+ }
95
103
  }
96
104
 
97
105
  const businessesSlug = {
@@ -104,6 +112,14 @@ export const App = () => {
104
112
  businessSlug: businessesSlug[isKioskApp ? 'kiosk' : 'marketplace']
105
113
  }
106
114
 
115
+ const signUpBusinesslayout = orderingTheme?.theme?.business_signup?.components?.layout?.type === 'old'
116
+ ? 'old'
117
+ : 'new'
118
+
119
+ const signUpDriverlayout = orderingTheme?.theme?.driver_signup?.components?.layout?.type === 'old'
120
+ ? 'old'
121
+ : 'new'
122
+
107
123
  const HeaderComponent =
108
124
  isKioskApp ? HeaderKiosk
109
125
  : orderingTheme?.theme?.header?.components?.layout?.type === 'old'
@@ -121,6 +137,7 @@ export const App = () => {
121
137
  const isEmailVerifyRequired = auth && configs?.verification_email_required?.value === '1' && !user?.email_verified
122
138
  const isPhoneVerifyRequired = auth && configs?.verification_phone_required?.value === '1' && !user?.phone_verified
123
139
  const isUserVerifyRequired = (isEmailVerifyRequired || isPhoneVerifyRequired) && !isKioskApp
140
+ const isHideFooter = orderingTheme?.theme?.footer?.hidden
124
141
 
125
142
  const closeAlert = () => {
126
143
  setAlertState({
@@ -135,11 +152,11 @@ export const App = () => {
135
152
  }
136
153
 
137
154
  const isHome = location.pathname === '/' || location.pathname === '/home'
138
- const isFooterPage = location.pathname === '/pages/footer' || isKioskApp
155
+ const isFooterPage = location.pathname === '/pages/footer' || isKioskApp || isHideFooter
139
156
 
140
157
  const handleSuccessSignup = (user) => {
141
158
  if (!user?.enabled && (configs?.business_signup_enabled_default?.value === '0' || configs?.driver_signup_enabled_default?.value === '0')) {
142
- signUplayout === 'new'
159
+ signUpBusinesslayout === 'new'
143
160
  ? setBusinessSignUpSuccessed({
144
161
  open: true,
145
162
  content: {
@@ -157,7 +174,7 @@ export const App = () => {
157
174
  }
158
175
 
159
176
  if (configs?.business_signup_enabled_default?.value === '1' || configs?.driver_signup_enabled_default?.value === '1') {
160
- signUplayout === 'new' ? setBusinessSignUpSuccessed({
177
+ signUpBusinesslayout === 'new' ? setBusinessSignUpSuccessed({
161
178
  open: true,
162
179
  content: {
163
180
  approvalType: 'automatic',
@@ -210,7 +227,7 @@ export const App = () => {
210
227
 
211
228
  const OrderReviewRequired = (order) => {
212
229
  setLastOrderReview({
213
- isReviewOpen: true,
230
+ isReviewOpen: !!((location?.pathname === '/' || location?.pathname === '/search' || location?.pathname === '/home')),
214
231
  order: order,
215
232
  defaultStar: 5,
216
233
  reviewStatus: { trigger: true, order: false, product: false, driver: false },
@@ -258,6 +275,7 @@ export const App = () => {
258
275
  }
259
276
 
260
277
  useEffect(() => {
278
+ if (!isShowReviewsPopupEnabled) return
261
279
  const _user = window.localStorage.getItem('user')
262
280
  const _token = window.localStorage.getItem('token')
263
281
  const _reviewRequired = window.sessionStorage.getItem('review-required')
@@ -268,7 +286,7 @@ export const App = () => {
268
286
  if (!(_user || _token)) {
269
287
  window.sessionStorage.removeItem('review-required')
270
288
  }
271
- }, [auth])
289
+ }, [auth, isShowReviewsPopupEnabled])
272
290
 
273
291
  useEffect(() => {
274
292
  if (!loaded && !orderStatus.loading && !configLoading && !siteLoading && !orderingTheme?.loading) {
@@ -312,376 +330,382 @@ export const App = () => {
312
330
  }
313
331
  }, [orderStatus])
314
332
 
315
- return (
316
- <div style={{ marginBottom: windowSize.width < 576 && onlineStatus ? 80 : 0 }}>
317
- {!!configs?.track_id_google_analytics?.value && (
318
- <Analytics trackId={configs?.track_id_google_analytics?.value} />
319
- )}
320
- {!!configs?.segment_track_id?.value && (
321
- <AnalyticsSegment writeKey={configs?.segment_track_id?.value} />
322
- )}
323
- {!!configs?.facebook_id?.value && FacebookPixel && (
324
- <FacebookPixel trackId={configs?.facebook_id?.value} />
325
- )}
326
- {!loaded && <SpinnerLoader />}
327
- <SmartAppBanner
328
- storeAndroidId={settings?.store_android_id !== '0' ? settings?.store_android_id : false}
329
- storeAppleId={settings?.store_apple_id !== '0' ? settings?.store_apple_id : false}
330
- storeKindleId={settings?.store_kindle_id !== '0' ? settings?.store_kindle_id : false}
331
- />
332
- {
333
- loaded && (
334
- <ThemeProvider theme={themeUpdated}>
335
- <ListenPageChanges />
336
- {!(isKioskApp && isHome) && windowSize.width > 576 && (
337
- <HeaderComponent
338
- isHome={isHome}
339
- location={location}
340
- isCustomLayout={singleBusinessConfig.isActive}
341
- />
342
- )}
343
- <NotNetworkConnectivity />
344
- {onlineStatus && (
345
- <ScrollToTop>
346
- <HelmetTags />
347
- <Switch>
348
- <Route exact path='/home'>
349
- {isUserVerifyRequired ? (
350
- <Redirect to='/verify' />
351
- ) : (
352
- isKioskApp
353
- ? <HomePage />
354
- : orderStatus.options?.address?.location
355
- ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
356
- : singleBusinessConfig.isActive
357
- ? <Redirect to={singleBusinessConfig.isActive ? '' : '/search'} />
333
+ return settings.isCancellation ? (
334
+ <CancellationComponent
335
+ ButtonComponent={Button}
336
+ InputComponent={Input}
337
+ />
338
+ )
339
+ : (
340
+ <div style={{ marginBottom: windowSize.width < 576 && onlineStatus ? 80 : 0 }}>
341
+ {!!configs?.track_id_google_analytics?.value && (
342
+ <Analytics trackId={configs?.track_id_google_analytics?.value} />
343
+ )}
344
+ {!!configs?.segment_track_id?.value && (
345
+ <AnalyticsSegment writeKey={configs?.segment_track_id?.value} />
346
+ )}
347
+ {!!configs?.facebook_id?.value && FacebookPixel && (
348
+ <FacebookPixel trackId={configs?.facebook_id?.value} />
349
+ )}
350
+ {!loaded && <SpinnerLoader />}
351
+ <SmartAppBanner
352
+ storeAndroidId={settings?.store_android_id !== '0' ? settings?.store_android_id : false}
353
+ storeAppleId={settings?.store_apple_id !== '0' ? settings?.store_apple_id : false}
354
+ storeKindleId={settings?.store_kindle_id !== '0' ? settings?.store_kindle_id : false}
355
+ />
356
+ {
357
+ loaded && (
358
+ <ThemeProvider theme={themeUpdated}>
359
+ <ListenPageChanges />
360
+ {!(isKioskApp && isHome) && windowSize.width > 576 && (
361
+ <HeaderComponent
362
+ isHome={isHome}
363
+ location={location}
364
+ isCustomLayout={singleBusinessConfig.isActive}
365
+ />
366
+ )}
367
+ <NotNetworkConnectivity />
368
+ {onlineStatus && (
369
+ <ScrollToTop>
370
+ <HelmetTags />
371
+ <Switch>
372
+ <Route exact path='/home'>
373
+ {isUserVerifyRequired ? (
374
+ <Redirect to='/verify' />
375
+ ) : (
376
+ isKioskApp
377
+ ? <HomePage />
378
+ : orderStatus.options?.address?.location
379
+ ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
380
+ : singleBusinessConfig.isActive
381
+ ? <Redirect to={singleBusinessConfig.isActive ? '' : '/search'} />
382
+ : <HomePage />
383
+ )}
384
+ </Route>
385
+ <Route exact path='/'>
386
+ {isUserVerifyRequired ? (
387
+ <Redirect to='/verify' />
388
+ ) : (
389
+ isKioskApp
390
+ ? <HomePage />
391
+ : orderStatus.options?.address?.location
392
+ ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
358
393
  : <HomePage />
359
- )}
360
- </Route>
361
- <Route exact path='/'>
362
- {isUserVerifyRequired ? (
363
- <Redirect to='/verify' />
364
- ) : (
365
- isKioskApp
366
- ? <HomePage />
367
- : orderStatus.options?.address?.location
368
- ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
369
- : <HomePage />
370
- )}
371
- </Route>
372
- <Route exact path='/wallets'>
373
- {auth
374
- ? isUserVerifyRequired
375
- ? <Redirect to='/verify' />
376
- : isWalletEnabled
377
- ? <Wallets />
378
- : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
379
- : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
380
- </Route>
381
- <Route exact path='/signup_business'>
382
- {!auth && !isKioskApp ? (
383
- <SignUpBusiness
384
- elementLinkToLogin={<Link to='/'>{t('LOGIN', 'Login')}</Link>}
385
- useLoginByCellphone
386
- useChekoutFileds
387
- handleSuccessSignup={handleSuccessSignup}
388
- layout={signUplayout}
389
- isRecaptchaEnable
390
- />
391
- ) : (
392
- <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
393
- )}
394
- </Route>
395
- <Route exact path='/signup-driver'>
396
- {!auth && !isKioskApp ? (
397
- <SignUpDriver
398
- layout={signUplayout}
399
- elementLinkToLogin={<Link to='/'>{t('LOGIN', 'Login')}</Link>}
400
- useLoginByCellphone
401
- useChekoutFileds
402
- handleSuccessSignup={handleSuccessSignup}
403
- isRecaptchaEnable
404
- />
405
- ) : (
406
- <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
407
- )}
408
- </Route>
409
- <Route exact path='/password/reset'>
410
- {auth ? (
411
- <Redirect to='/' />
412
- ) : (
413
- isKioskApp
414
- ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
415
- : <ResetPassword />
416
- )}
417
- </Route>
418
- <Route exact path='/profile'>
419
- {auth
420
- ? isUserVerifyRequired
421
- ? <Redirect to='/verify' />
422
- : (<Profile userId={user?.id} accessToken={user?.session?.access_token} useValidationFields />)
423
- : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
424
- </Route>
425
- <Route exact path='/verify'>
426
- {isUserVerifyRequired
427
- ? <UserVerification />
428
- : <Redirect to={(auth || isKioskApp) ? singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search' : '/'} />}
429
- </Route>
430
- <Route exact path='/profile/orders'>
431
- {auth
432
- ? isUserVerifyRequired
433
- ? <Redirect to='/verify' />
434
- : (<MyOrders />)
435
- : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
436
- </Route>
437
- <Route exact path='/profile/addresses'>
438
- {auth
439
- ? isUserVerifyRequired
440
- ? <Redirect to='/verify' />
441
- : (<AddressList />)
442
- : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
443
- </Route>
444
- <Route exact path='/messages'>
445
- {auth
446
- ? isUserVerifyRequired
447
- ? <Redirect to='/verify' />
448
- : <MessagesList />
449
- : (
394
+ )}
395
+ </Route>
396
+ <Route exact path='/wallets'>
397
+ {auth
398
+ ? isUserVerifyRequired
399
+ ? <Redirect to='/verify' />
400
+ : isWalletEnabled
401
+ ? <Wallets />
402
+ : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
403
+ : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
404
+ </Route>
405
+ <Route exact path='/signup_business'>
406
+ {!auth && !isKioskApp ? (
407
+ <SignUpBusiness
408
+ elementLinkToLogin={<Link to='/'>{t('LOGIN', 'Login')}</Link>}
409
+ useLoginByCellphone
410
+ useChekoutFileds
411
+ handleSuccessSignup={handleSuccessSignup}
412
+ layout={signUpBusinesslayout}
413
+ isRecaptchaEnable
414
+ />
415
+ ) : (
416
+ <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
417
+ )}
418
+ </Route>
419
+ <Route exact path='/signup-driver'>
420
+ {!auth && !isKioskApp ? (
421
+ <SignUpDriver
422
+ layout={signUpDriverlayout}
423
+ elementLinkToLogin={<Link to='/'>{t('LOGIN', 'Login')}</Link>}
424
+ useLoginByCellphone
425
+ useChekoutFileds
426
+ handleSuccessSignup={handleSuccessSignup}
427
+ isRecaptchaEnable
428
+ />
429
+ ) : (
430
+ <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
431
+ )}
432
+ </Route>
433
+ <Route exact path='/password/reset'>
434
+ {auth ? (
435
+ <Redirect to='/' />
436
+ ) : (
450
437
  isKioskApp
451
438
  ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
452
- : <Redirect to={{ pathname: '/search' }} />
439
+ : <ResetPassword />
453
440
  )}
454
- </Route>
455
- <Route exact path='/help'>
456
- {auth
457
- ? isUserVerifyRequired
458
- ? <Redirect to='/verify' />
459
- : (<Help />)
460
- : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
461
- </Route>
462
- <Route exact path='/search'>
463
- {
464
- isKioskApp
465
- ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
441
+ </Route>
442
+ <Route exact path='/profile'>
443
+ {auth
444
+ ? isUserVerifyRequired
445
+ ? <Redirect to='/verify' />
446
+ : (<Profile userId={user?.id} accessToken={user?.session?.access_token} useValidationFields />)
447
+ : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
448
+ </Route>
449
+ <Route exact path='/verify'>
450
+ {isUserVerifyRequired
451
+ ? <UserVerification />
452
+ : <Redirect to={(auth || isKioskApp) ? singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search' : '/'} />}
453
+ </Route>
454
+ <Route exact path='/profile/orders'>
455
+ {auth
456
+ ? isUserVerifyRequired
457
+ ? <Redirect to='/verify' />
458
+ : (<MyOrders />)
459
+ : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
460
+ </Route>
461
+ <Route exact path='/profile/addresses'>
462
+ {auth
463
+ ? isUserVerifyRequired
464
+ ? <Redirect to='/verify' />
465
+ : (<AddressList />)
466
+ : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
467
+ </Route>
468
+ <Route exact path='/messages'>
469
+ {auth
470
+ ? isUserVerifyRequired
471
+ ? <Redirect to='/verify' />
472
+ : <MessagesList />
466
473
  : (
467
- orderStatus.loading && !orderStatus.options?.address?.location ? (
468
- <SpinnerLoader />
469
- ) : (
470
- isUserVerifyRequired ? (
471
- <Redirect to='/verify' />
474
+ isKioskApp
475
+ ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
476
+ : <Redirect to={{ pathname: '/search' }} />
477
+ )}
478
+ </Route>
479
+ <Route exact path='/help'>
480
+ {auth
481
+ ? isUserVerifyRequired
482
+ ? <Redirect to='/verify' />
483
+ : (<Help />)
484
+ : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />}
485
+ </Route>
486
+ <Route exact path='/search'>
487
+ {
488
+ isKioskApp
489
+ ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
490
+ : (
491
+ orderStatus.loading && !orderStatus.options?.address?.location ? (
492
+ <SpinnerLoader />
472
493
  ) : (
494
+ isUserVerifyRequired ? (
495
+ <Redirect to='/verify' />
496
+ ) : (
473
497
  orderStatus.options?.address?.location
474
498
  ? <BusinessesList />
475
499
  : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
500
+ )
476
501
  )
477
502
  )
478
- )
479
- }
480
- </Route>
481
- <Route exact path='/business_search'>
482
- {isUserVerifyRequired ? (
483
- <Redirect to='/verify' />
484
- ) : (
503
+ }
504
+ </Route>
505
+ <Route exact path='/business_search'>
506
+ {isUserVerifyRequired ? (
507
+ <Redirect to='/verify' />
508
+ ) : (
485
509
  orderStatus.options?.address?.location && !isKioskApp ? (
486
510
  <BusinessListingSearch />
487
511
  ) : (
488
512
  <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
489
513
  )
490
- )}
491
- </Route>
492
- <Route exact path='/promotions'>
493
- {orderStatus.loading && !orderStatus.options?.address?.location ? (
494
- <SpinnerLoader />
495
- ) : (
496
- isUserVerifyRequired ? (
497
- <Redirect to='/verify' />
514
+ )}
515
+ </Route>
516
+ <Route exact path='/promotions'>
517
+ {orderStatus.loading && !orderStatus.options?.address?.location ? (
518
+ <SpinnerLoader />
498
519
  ) : (
520
+ isUserVerifyRequired ? (
521
+ <Redirect to='/verify' />
522
+ ) : (
499
523
  orderStatus.options?.address?.location && !isKioskApp
500
524
  ? <Promotions />
501
525
  : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
502
- )
503
- )}
504
- </Route>
505
- <Route path='/checkout/:cartUuid?'>
506
- {auth
507
- ? isUserVerifyRequired
508
- ? <Redirect to='/verify' />
509
- : <CheckoutPage />
510
- : (
511
- <Redirect to={{
512
- pathname: singleBusinessConfig.isActive
513
- ? `/${singleBusinessConfig.businessSlug}`
514
- : '/',
515
- state: { from: location.pathname || null }
516
- }}
517
- />
526
+ )
518
527
  )}
519
- </Route>
520
- <Route path='/multi-checkout'>
521
- {auth
522
- ? isUserVerifyRequired
523
- ? <Redirect to='/verify' />
524
- : <MultiCheckout />
525
- : (
526
- <Redirect to={{
527
- pathname: singleBusinessConfig.isActive
528
- ? `/${singleBusinessConfig.businessSlug}`
529
- : '/',
530
- state: { from: location.pathname || null }
531
- }}
532
- />
528
+ </Route>
529
+ <Route path='/checkout/:cartUuid?'>
530
+ {auth
531
+ ? isUserVerifyRequired
532
+ ? <Redirect to='/verify' />
533
+ : <CheckoutPage />
534
+ : (
535
+ <Redirect to={{
536
+ pathname: singleBusinessConfig.isActive
537
+ ? `/${singleBusinessConfig.businessSlug}`
538
+ : '/',
539
+ state: { from: location.pathname || null }
540
+ }}
541
+ />
542
+ )}
543
+ </Route>
544
+ <Route path='/multi-checkout'>
545
+ {auth
546
+ ? isUserVerifyRequired
547
+ ? <Redirect to='/verify' />
548
+ : <MultiCheckout />
549
+ : (
550
+ <Redirect to={{
551
+ pathname: singleBusinessConfig.isActive
552
+ ? `/${singleBusinessConfig.businessSlug}`
553
+ : '/',
554
+ state: { from: location.pathname || null }
555
+ }}
556
+ />
557
+ )}
558
+ </Route>
559
+ <Route path='/multi-orders'>
560
+ {auth
561
+ ? isUserVerifyRequired
562
+ ? <Redirect to='/verify' />
563
+ : <MultiOrdersDetails />
564
+ : (
565
+ <Redirect to={{
566
+ pathname: singleBusinessConfig.isActive
567
+ ? `/${singleBusinessConfig.businessSlug}`
568
+ : '/',
569
+ state: { from: location.pathname || null }
570
+ }}
571
+ />
572
+ )}
573
+ </Route>
574
+ <Route exact path='/orders/:orderId'>
575
+ {(auth || hashKey)
576
+ ? isUserVerifyRequired
577
+ ? <Redirect to='/verify' />
578
+ : <OrderDetailsPage />
579
+ : (
580
+ <Redirect to={{
581
+ pathname: singleBusinessConfig.isActive
582
+ ? `/${singleBusinessConfig.businessSlug}`
583
+ : '/',
584
+ state: { from: location.pathname || null }
585
+ }}
586
+ />
587
+ )}
588
+ </Route>
589
+ <Route exact path='/promotions'>
590
+ {(auth || hashKey)
591
+ ? isUserVerifyRequired
592
+ ? <Redirect to='/verify' />
593
+ : <Promotions />
594
+ : (
595
+ <Redirect to={{
596
+ pathname: singleBusinessConfig.isActive
597
+ ? `/${singleBusinessConfig.businessSlug}`
598
+ : '/',
599
+ state: { from: location.pathname || null }
600
+ }}
601
+ />
602
+ )}
603
+ </Route>
604
+ <Route exact path='/pages/:pageSlug'>
605
+ {isUserVerifyRequired ? (
606
+ <Redirect to='/verify' />
607
+ ) : (
608
+ <Cms />
533
609
  )}
534
- </Route>
535
- <Route path='/multi-orders'>
536
- {auth
537
- ? isUserVerifyRequired
538
- ? <Redirect to='/verify' />
539
- : <MultiOrdersDetails />
540
- : (
541
- <Redirect to={{
542
- pathname: singleBusinessConfig.isActive
543
- ? `/${singleBusinessConfig.businessSlug}`
544
- : '/',
545
- state: { from: location.pathname || null }
546
- }}
547
- />
610
+ </Route>
611
+ <Route exact path='/pages'>
612
+ {isUserVerifyRequired ? (
613
+ <Redirect to='/verify' />
614
+ ) : (
615
+ <PagesList />
548
616
  )}
549
- </Route>
550
- <Route exact path='/orders/:orderId'>
551
- {(auth || hashKey)
552
- ? isUserVerifyRequired
553
- ? <Redirect to='/verify' />
554
- : <OrderDetailsPage />
555
- : (
556
- <Redirect to={{
557
- pathname: singleBusinessConfig.isActive
558
- ? `/${singleBusinessConfig.businessSlug}`
559
- : '/',
560
- state: { from: location.pathname || null }
561
- }}
562
- />
617
+ </Route>
618
+ <Route exact path='/favorite'>
619
+ {auth && !isKioskApp
620
+ ? <Favorite />
621
+ : (
622
+ <Redirect to='/' />
623
+ )}
624
+ </Route>
625
+ <Route exact path='/sessions'>
626
+ {auth && !isKioskApp
627
+ ? <SessionsList />
628
+ : (
629
+ <Redirect to='/' />
630
+ )}
631
+ </Route>
632
+ <Route exact path='/store'>
633
+ {isUserVerifyRequired ? (
634
+ <Redirect to='/verify' />
635
+ ) : (
636
+ <BusinessProductsList />
563
637
  )}
564
- </Route>
565
- <Route exact path='/promotions'>
566
- {(auth || hashKey)
567
- ? isUserVerifyRequired
568
- ? <Redirect to='/verify' />
569
- : <Promotions />
570
- : (
571
- <Redirect to={{
572
- pathname: singleBusinessConfig.isActive
573
- ? `/${singleBusinessConfig.businessSlug}`
574
- : '/',
575
- state: { from: location.pathname || null }
576
- }}
577
- />
638
+ </Route>
639
+ <Route exact path='/:business_slug'>
640
+ {isUserVerifyRequired ? (
641
+ <Redirect to='/verify' />
642
+ ) : (
643
+ <BusinessProductsList />
578
644
  )}
579
- </Route>
580
- <Route exact path='/pages/:pageSlug'>
581
- {isUserVerifyRequired ? (
582
- <Redirect to='/verify' />
583
- ) : (
584
- <Cms />
585
- )}
586
- </Route>
587
- <Route exact path='/pages'>
588
- {isUserVerifyRequired ? (
589
- <Redirect to='/verify' />
590
- ) : (
591
- <PagesList />
592
- )}
593
- </Route>
594
- <Route exact path='/favorite'>
595
- {auth && !isKioskApp
596
- ? <Favorite />
597
- : (
598
- <Redirect to='/' />
645
+ </Route>
646
+ <Route exact path='/:business_slug/:category_slug/:product_slug'>
647
+ {isUserVerifyRequired ? (
648
+ <Redirect to='/verify' />
649
+ ) : (
650
+ <BusinessProductsList />
599
651
  )}
600
- </Route>
601
- <Route exact path='/sessions'>
602
- {auth && !isKioskApp
603
- ? <SessionsList />
604
- : (
605
- <Redirect to='/' />
652
+ </Route>
653
+ <Route exact path='/store/:business_slug'>
654
+ {isUserVerifyRequired ? (
655
+ <Redirect to='/verify' />
656
+ ) : (
657
+ <BusinessProductsList />
606
658
  )}
607
- </Route>
608
- <Route exact path='/store'>
609
- {isUserVerifyRequired ? (
610
- <Redirect to='/verify' />
611
- ) : (
612
- <BusinessProductsList />
613
- )}
614
- </Route>
615
- <Route exact path='/:business_slug'>
616
- {isUserVerifyRequired ? (
617
- <Redirect to='/verify' />
618
- ) : (
619
- <BusinessProductsList />
620
- )}
621
- </Route>
622
- <Route exact path='/:business_slug/:category_slug/:product_slug'>
623
- {isUserVerifyRequired ? (
624
- <Redirect to='/verify' />
625
- ) : (
626
- <BusinessProductsList />
627
- )}
628
- </Route>
629
- <Route exact path='/store/:business_slug'>
630
- {isUserVerifyRequired ? (
631
- <Redirect to='/verify' />
632
- ) : (
633
- <BusinessProductsList />
634
- )}
635
- </Route>
636
- <Route exact path='/store/:business_slug/:category_slug/:product_slug'>
637
- {isUserVerifyRequired ? (
638
- <Redirect to='/verify' />
639
- ) : (
640
- <BusinessProductsList />
641
- )}
642
- </Route>
643
- <Route exact path='/store/:category_slug/:product_slug'>
644
- {isUserVerifyRequired ? (
645
- <Redirect to='/verify' />
646
- ) : (
647
- <BusinessProductsList />
648
- )}
649
- </Route>
650
- <Route path='*'>
651
- <PageNotFound />
652
- </Route>
653
- </Switch>
654
- </ScrollToTop>
655
- )}
656
- {!navigator.userAgent.match('CriOS') && (
657
- <PWAPrompt promptOnVisit={1} timesToShow={100} copyClosePrompt='Close' permanentlyHideOnDismiss={false} />
658
- )}
659
- {!isFooterPage && (
660
- <Footer />
661
- )}
662
- {windowSize.width < 576 && onlineStatus && (
663
- <NavigationBar />
664
- )}
665
- <Alert
666
- title={t('INFORMATION', 'Information')}
667
- content={alertState.content}
668
- links={alertState.links}
669
- acceptText={t('ACCEPT', 'Accept')}
670
- open={alertState.open}
671
- onClose={() => closeAlert()}
672
- onCancel={() => closeAlert()}
673
- onAccept={() => alertState?.isOnlyAlert ? closeAlert() : acceptAlert()}
674
- closeOnBackdrop={false}
675
- />
676
- {lastOrderReview?.isReviewOpen && (
677
- <Modal
678
- open={lastOrderReview?.isReviewOpen}
679
- onClose={handleCloseReivew}
680
- title={lastOrderReview?.order && reviewModalTitle()}
681
- width={lastOrderReview?.reviewStatus?.trigger ? '680px' : null}
682
- >
683
- <div>
684
- {
659
+ </Route>
660
+ <Route exact path='/store/:business_slug/:category_slug/:product_slug'>
661
+ {isUserVerifyRequired ? (
662
+ <Redirect to='/verify' />
663
+ ) : (
664
+ <BusinessProductsList />
665
+ )}
666
+ </Route>
667
+ <Route exact path='/store/:category_slug/:product_slug'>
668
+ {isUserVerifyRequired ? (
669
+ <Redirect to='/verify' />
670
+ ) : (
671
+ <BusinessProductsList />
672
+ )}
673
+ </Route>
674
+ <Route path='*'>
675
+ <PageNotFound />
676
+ </Route>
677
+ </Switch>
678
+ </ScrollToTop>
679
+ )}
680
+ {!navigator.userAgent.match('CriOS') && (
681
+ <PWAPrompt promptOnVisit={1} timesToShow={100} copyClosePrompt='Close' permanentlyHideOnDismiss={false} />
682
+ )}
683
+ {!isFooterPage && (
684
+ <Footer />
685
+ )}
686
+ {windowSize.width < 576 && onlineStatus && (
687
+ <NavigationBar />
688
+ )}
689
+ <Alert
690
+ title={t('INFORMATION', 'Information')}
691
+ content={alertState.content}
692
+ links={alertState.links}
693
+ acceptText={t('ACCEPT', 'Accept')}
694
+ open={alertState.open}
695
+ onClose={() => closeAlert()}
696
+ onCancel={() => closeAlert()}
697
+ onAccept={() => alertState?.isOnlyAlert ? closeAlert() : acceptAlert()}
698
+ closeOnBackdrop={false}
699
+ />
700
+ {lastOrderReview?.isReviewOpen && (
701
+ <Modal
702
+ open={lastOrderReview?.isReviewOpen}
703
+ onClose={handleCloseReivew}
704
+ title={lastOrderReview?.order && reviewModalTitle()}
705
+ width={lastOrderReview?.reviewStatus?.trigger ? '680px' : null}
706
+ >
707
+ <div>
708
+ {
685
709
  lastOrderReview?.reviewStatus?.trigger
686
710
  ? <ReviewTrigger order={lastOrderReview?.order} handleOpenOrderReview={handleOpenOrderReview} />
687
711
  : lastOrderReview?.reviewStatus?.order
@@ -689,25 +713,25 @@ export const App = () => {
689
713
  : (lastOrderReview?.reviewStatus?.product
690
714
  ? <ReviewProduct order={lastOrderReview?.order} closeReviewProduct={closeReviewProduct} setIsProductReviewed={() => setIsReviewed('isProductReviewed')} />
691
715
  : <ReviewDriver order={lastOrderReview?.order} closeReviewDriver={handleCloseReivew} setIsDriverReviewed={() => setIsReviewed('isDriverReviewed')} />)
692
- }
693
- </div>
716
+ }
717
+ </div>
718
+ </Modal>
719
+ )}
720
+ <Modal
721
+ open={businessSignUpSuccessed?.open}
722
+ onClose={() => setBusinessSignUpSuccessed({ open: false, content: {} })}
723
+ title={t('CONGRATULATIONS', 'Congratulations')}
724
+ width='990px'
725
+ >
726
+ <SignUpApproval
727
+ content={businessSignUpSuccessed?.content}
728
+ onAccept={() => acceptAlert()}
729
+ onCancel={() => setBusinessSignUpSuccessed({ open: false, content: {} })}
730
+ />
694
731
  </Modal>
695
- )}
696
- <Modal
697
- open={businessSignUpSuccessed?.open}
698
- onClose={() => setBusinessSignUpSuccessed({ open: false, content: {} })}
699
- title={t('CONGRATULATIONS', 'Congratulations')}
700
- width='990px'
701
- >
702
- <SignUpApproval
703
- content={businessSignUpSuccessed?.content}
704
- onAccept={() => acceptAlert()}
705
- onCancel={() => setBusinessSignUpSuccessed({ open: false, content: {} })}
706
- />
707
- </Modal>
708
- </ThemeProvider>
709
- )
710
- }
711
- </div>
712
- )
732
+ </ThemeProvider>
733
+ )
734
+ }
735
+ </div>
736
+ )
713
737
  }