ordering-ui-external 2.4.6 → 2.5.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 (147) hide show
  1. package/_bundles/{0.ordering-ui.038c4b4d536032472bc7.js → 0.ordering-ui.5488030edb520175432d.js} +1 -1
  2. package/_bundles/{1.ordering-ui.038c4b4d536032472bc7.js → 1.ordering-ui.5488030edb520175432d.js} +1 -1
  3. package/_bundles/{2.ordering-ui.038c4b4d536032472bc7.js → 2.ordering-ui.5488030edb520175432d.js} +1 -1
  4. package/_bundles/{4.ordering-ui.038c4b4d536032472bc7.js → 4.ordering-ui.5488030edb520175432d.js} +1 -1
  5. package/_bundles/{5.ordering-ui.038c4b4d536032472bc7.js → 5.ordering-ui.5488030edb520175432d.js} +1 -1
  6. package/_bundles/{6.ordering-ui.038c4b4d536032472bc7.js → 6.ordering-ui.5488030edb520175432d.js} +1 -1
  7. package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js → 7.ordering-ui.5488030edb520175432d.js} +2 -2
  8. package/_bundles/{8.ordering-ui.038c4b4d536032472bc7.js → 8.ordering-ui.5488030edb520175432d.js} +1 -1
  9. package/_bundles/{9.ordering-ui.038c4b4d536032472bc7.js → 9.ordering-ui.5488030edb520175432d.js} +1 -1
  10. package/_bundles/ordering-ui.5488030edb520175432d.js +2 -0
  11. package/_modules/components/OrdersOption/styles.js +1 -1
  12. package/_modules/components/StripeMethodForm/index.js +26 -11
  13. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
  14. package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
  15. package/_modules/contexts/ThemeContext/index.js +1 -0
  16. package/_modules/themes/five/src/components/AddressList/index.js +8 -7
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
  18. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
  19. package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
  20. package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
  21. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
  22. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
  23. package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  25. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  26. package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
  27. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
  28. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
  29. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
  30. package/_modules/themes/five/src/components/Cart/index.js +7 -3
  31. package/_modules/themes/five/src/components/Checkout/index.js +12 -11
  32. package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
  33. package/_modules/themes/five/src/components/CitiesControl/index.js +1 -1
  34. package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  35. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
  36. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
  37. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
  38. package/_modules/themes/five/src/components/Header/index.js +29 -21
  39. package/_modules/themes/five/src/components/Header/styles.js +44 -40
  40. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +1 -1
  41. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +36 -5
  42. package/_modules/themes/five/src/components/MultiCheckout/index.js +35 -6
  43. package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
  44. package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
  45. package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
  46. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +4 -3
  47. package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
  48. package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
  49. package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
  50. package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
  51. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
  52. package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
  53. package/_modules/themes/five/src/components/PaymentOptions/index.js +8 -5
  54. package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
  55. package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
  56. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
  57. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  58. package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
  59. package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
  60. package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
  61. package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
  62. package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
  63. package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
  64. package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
  65. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
  66. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  67. package/_modules/themes/five/src/components/StripeElementsForm/index.js +3 -1
  68. package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
  69. package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
  70. package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
  71. package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
  72. package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
  73. package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
  74. package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
  75. package/_modules/utils/index.js +8 -2
  76. package/index.html +1 -1
  77. package/package.json +3 -2
  78. package/src/components/OrdersOption/styles.js +1 -0
  79. package/src/components/StripeMethodForm/index.js +22 -10
  80. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
  81. package/src/components/VerticalOrdersLayout/styles.js +9 -0
  82. package/src/contexts/ThemeContext/index.js +1 -0
  83. package/src/themes/five/src/components/AddressList/index.js +6 -6
  84. package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
  85. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
  86. package/src/themes/five/src/components/BusinessController/index.js +4 -2
  87. package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
  88. package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
  89. package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
  90. package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
  91. package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  92. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  93. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
  94. package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
  95. package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
  96. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
  97. package/src/themes/five/src/components/Cart/index.js +3 -4
  98. package/src/themes/five/src/components/Checkout/index.js +18 -4
  99. package/src/themes/five/src/components/Checkout/styles.js +22 -0
  100. package/src/themes/five/src/components/CitiesControl/index.js +1 -1
  101. package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  102. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
  103. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
  104. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
  105. package/src/themes/five/src/components/Header/index.js +17 -5
  106. package/src/themes/five/src/components/Header/styles.js +9 -6
  107. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +1 -1
  108. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +83 -51
  109. package/src/themes/five/src/components/MultiCheckout/index.js +21 -6
  110. package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
  111. package/src/themes/five/src/components/MyOrders/index.js +13 -9
  112. package/src/themes/five/src/components/MyOrders/styles.js +3 -1
  113. package/src/themes/five/src/components/OrderDetails/OrderEta.js +6 -3
  114. package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
  115. package/src/themes/five/src/components/OrderDetails/index.js +2 -2
  116. package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
  117. package/src/themes/five/src/components/OrderProgress/index.js +16 -5
  118. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
  119. package/src/themes/five/src/components/PageBanner/styles.js +1 -4
  120. package/src/themes/five/src/components/PaymentOptions/index.js +7 -4
  121. package/src/themes/five/src/components/ProductForm/index.js +23 -5
  122. package/src/themes/five/src/components/ProductForm/styles.js +36 -1
  123. package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
  124. package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  125. package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
  126. package/src/themes/five/src/components/ServiceForm/index.js +22 -4
  127. package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
  128. package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
  129. package/src/themes/five/src/components/SignUpForm/index.js +4 -3
  130. package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
  131. package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
  132. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
  133. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  134. package/src/themes/five/src/components/StripeElementsForm/index.js +3 -1
  135. package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
  136. package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
  137. package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
  138. package/src/themes/five/src/components/UserPopover/index.js +26 -15
  139. package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
  140. package/src/themes/five/src/styles/Buttons/index.js +11 -0
  141. package/src/themes/five/src/styles/Inputs/index.js +34 -0
  142. package/src/utils/index.js +5 -0
  143. package/template/app.js +5 -3
  144. package/template/theme.json +335 -24
  145. package/_bundles/ordering-ui.038c4b4d536032472bc7.js +0 -2
  146. /package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → 7.ordering-ui.5488030edb520175432d.js.LICENSE.txt} +0 -0
  147. /package/_bundles/{ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → ordering-ui.5488030edb520175432d.js.LICENSE.txt} +0 -0
@@ -4,12 +4,15 @@ import Skeleton from 'react-loading-skeleton'
4
4
  import { Button } from '../../../styles/Buttons'
5
5
  import RiRadioButtonFill from '@meronex/icons/ri/RiRadioButtonFill'
6
6
  import MdRadioButtonUnchecked from '@meronex/icons/md/MdRadioButtonUnchecked'
7
+ import { NotFoundSource } from '../../NotFoundSource'
7
8
 
8
9
  import {
9
10
  Container,
10
11
  GiftCardsListContainer,
12
+ GiftCardsWrapper,
11
13
  GiftCardItem,
12
- IconControl
14
+ IconControl,
15
+ ActionButtonContainer
13
16
  } from './styles'
14
17
 
15
18
  const PurchaseGiftCardUI = (props) => {
@@ -24,39 +27,46 @@ const PurchaseGiftCardUI = (props) => {
24
27
  return (
25
28
  <Container>
26
29
  <h2>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</h2>
27
- <p>{t('SELECT_ONE_OPTION', 'Select one option')}</p>
28
30
  <GiftCardsListContainer>
29
- {productsListState.loading && (
30
- [...Array(5).keys()].map(i => (
31
- <GiftCardItem key={i}>
32
- <Skeleton width={150} />
31
+ <p>{t('SELECT_ONE_OPTION', 'Select one option')}</p>
32
+ <GiftCardsWrapper>
33
+ {productsListState.loading && (
34
+ [...Array(5).keys()].map(i => (
35
+ <GiftCardItem key={i}>
36
+ <Skeleton width={150} />
37
+ </GiftCardItem>
38
+ ))
39
+ )}
40
+ {productsListState.products.map(product => (
41
+ <GiftCardItem
42
+ key={product.id}
43
+ onClick={() => setSelectedProduct(product)}
44
+ >
45
+ <IconControl>
46
+ {selectedProduct?.id === product.id ? (
47
+ <RiRadioButtonFill />
48
+ ) : (
49
+ <MdRadioButtonUnchecked disabled />
50
+ )}
51
+ </IconControl>
52
+ <span>{product.name}</span>
33
53
  </GiftCardItem>
34
- ))
35
- )}
36
- {productsListState.products.map(product => (
37
- <GiftCardItem
38
- key={product.id}
39
- onClick={() => setSelectedProduct(product)}
40
- >
41
- <IconControl>
42
- {selectedProduct?.id === product.id ? (
43
- <RiRadioButtonFill />
44
- ) : (
45
- <MdRadioButtonUnchecked disabled />
46
- )}
47
- </IconControl>
48
- <span>{product.name}</span>
49
- </GiftCardItem>
50
- ))}
54
+ ))}
55
+ {!productsListState.loading && productsListState.products.length === 0 && (
56
+ <NotFoundSource />
57
+ )}
58
+ </GiftCardsWrapper>
51
59
  </GiftCardsListContainer>
52
- <Button
53
- type='button'
54
- color='primary'
55
- disabled={!selectedProduct}
56
- onClick={() => handleAccept()}
57
- >
58
- {t('ACCEPT', 'Accept')}
59
- </Button>
60
+ <ActionButtonContainer>
61
+ <Button
62
+ type='button'
63
+ color='primary'
64
+ disabled={!selectedProduct}
65
+ onClick={() => handleAccept()}
66
+ >
67
+ {t('ACCEPT', 'Accept')}
68
+ </Button>
69
+ </ActionButtonContainer>
60
70
  </Container>
61
71
  )
62
72
  }
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components'
3
3
  export const Container = styled.div`
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ padding-top: 30px;
6
7
 
7
8
  h2 {
8
9
  font-size: 24px;
@@ -16,12 +17,12 @@ export const Container = styled.div`
16
17
  line-height: 24px;
17
18
  margin-top: 0;
18
19
  }
19
- > button {
20
- height: 44px;
21
- }
22
20
  `
23
21
  export const GiftCardsListContainer = styled.div`
24
- margin-bottom: 40px;
22
+ padding: 30px 20px;
23
+ `
24
+ export const GiftCardsWrapper = styled.div`
25
+ margin-bottom: 10px;
25
26
  `
26
27
  export const GiftCardItem = styled.div`
27
28
  cursor: pointer;
@@ -50,3 +51,13 @@ export const IconControl = styled.div`
50
51
  color: ${props => props.theme.colors.lightGray};
51
52
  }
52
53
  `
54
+ export const ActionButtonContainer = styled.div`
55
+ position: sticky;
56
+ bottom: 0px;
57
+ background-color: ${props => props.theme.colors.backgroundPage};
58
+ padding: 15px 20px;
59
+ > button {
60
+ height: 44px;
61
+ width: 100%;
62
+ }
63
+ `
@@ -98,8 +98,8 @@ const RedeemGiftCardUI = (props) => {
98
98
  <p>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</p>
99
99
  <p>{t('AMOUNT', 'Amount')}: {parsePrice(redeemedGiftCard?.amount)}</p>
100
100
  <p>{t('FROM', 'From')}: {redeemedGiftCard?.receiver?.name} {redeemedGiftCard?.receiver?.lastname}</p>
101
- <p>{t('TITLE', 'Title')}: {redeemedGiftCard?.title}</p>
102
- <p>{t('MESSAGES', 'Messages')}: {redeemedGiftCard?.message}</p>
101
+ {redeemedGiftCard?.title && <p>{t('TITLE', 'Title')}: {redeemedGiftCard?.title}</p>}
102
+ {redeemedGiftCard?.message && <p>{t('MESSAGES', 'Messages')}: {redeemedGiftCard?.message}</p>}
103
103
  <Button
104
104
  color='primary'
105
105
  onClick={() => onClose()}
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useLocation } from 'react-router-dom'
3
- import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useOrderingTheme } from 'ordering-components-external'
3
+ import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useOrderingTheme, useBusiness } from 'ordering-components-external'
4
4
  import { useTheme } from 'styled-components'
5
5
  import AiOutlineClose from '@meronex/icons/ai/AiOutlineClose'
6
6
  import { LanguageSelector } from '../../../../../components/LanguageSelector'
@@ -47,7 +47,7 @@ import { Confirm } from '../Confirm'
47
47
  import { LoginForm } from '../LoginForm'
48
48
  import { SignUpForm } from '../SignUpForm'
49
49
  import { ForgotPasswordForm } from '../ForgotPasswordForm'
50
- import { getDistance } from '../../../../../utils'
50
+ import { getDistance, getCateringValues } from '../../../../../utils'
51
51
  import { BusinessPreorder } from '../BusinessPreorder'
52
52
  import { SearchBar } from '../SearchBar'
53
53
 
@@ -73,6 +73,7 @@ export const Header = (props) => {
73
73
  const [configState] = useConfig()
74
74
  const [customerState, { deleteUserCustomer }] = useCustomer()
75
75
  const [orderingTheme] = useOrderingTheme()
76
+ const [{ business }] = useBusiness()
76
77
 
77
78
  const clearCustomer = useRef(null)
78
79
  const [modalIsOpen, setModalIsOpen] = useState(false)
@@ -93,11 +94,18 @@ export const Header = (props) => {
93
94
 
94
95
  const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
95
96
 
96
- const orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru')]
97
+ const orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru'), '', t('CATERING_DELIVERY', 'Catering Delivery'), t('CATERING_PICKUP', 'Catering pickup')]
97
98
  const configTypes = configState?.configs?.order_types_allowed?.value.split('|').map(value => Number(value)) || []
98
99
  const isPreOrderSetting = configState?.configs?.preorder_status_enabled?.value === '1'
99
100
  const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
100
101
  const isHideLanguages = theme?.header?.components?.language_selector?.hidden
102
+ const cateringTypeString = orderState?.options?.type === 7
103
+ ? 'catering_delivery'
104
+ : orderState?.options?.type === 8
105
+ ? 'catering_pickup'
106
+ : null
107
+
108
+ const cateringValues = getCateringValues(cateringTypeString, pathname.includes('store') && Object?.keys(business || {})?.length > 0 ? business?.configs : configState?.configs)
101
109
 
102
110
  const handleSuccessSignup = (user) => {
103
111
  login({
@@ -225,12 +233,12 @@ export const Header = (props) => {
225
233
  isChew={isChew}
226
234
  >
227
235
  <img alt='Logotype' width='170px' height={isChew ? '35px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.logotype} loading='lazy' />
228
- <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || (isHome ? theme?.images?.logos?.isotypeInvert : theme?.images?.logos?.isotype)} loading='lazy' />
236
+ <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : (isHome && windowSize.width < 576 ? theme?.images?.logos?.isotypeInvert : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.isotype)} loading='lazy' />
229
237
  </LogoHeader>
230
238
  </LeftHeader>
231
239
  {isShowOrderOptions && !props.isCustomLayout && windowSize.width >= 576 && (
232
240
  <Menu id='center-side' className='left-header' isCustomerMode={isCustomerMode} isChew={isChew}>
233
- {windowSize.width > 820 && isFarAway && (
241
+ {windowSize.width > 850 && isFarAway && (
234
242
  <FarAwayMessage>
235
243
  <TiWarningOutline />
236
244
  <span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
@@ -484,6 +492,10 @@ export const Header = (props) => {
484
492
  {modalSelected === 'moment' && (
485
493
  <MomentContent
486
494
  onClose={() => setModalIsOpen(false)}
495
+ cateringPreorder={!!cateringTypeString}
496
+ isHeader
497
+ business={pathname.includes('store') && business}
498
+ {...cateringValues}
487
499
  />
488
500
  )}
489
501
  {modalSelected === 'delivery' && (
@@ -62,6 +62,10 @@ export const LogoHeader = styled.div`
62
62
  margin-left: 0;
63
63
  `}
64
64
  @media (min-width: 769px) {
65
+ ${({ theme }) =>
66
+ ['center', 'right']?.includes(theme?.header?.components?.logo?.components?.layout?.position) && css`
67
+ margin-right: 30px;
68
+ `};
65
69
  width: ${props => props.imgW ?? '150px'};
66
70
  height: ${props => props.isChew && '35px'};
67
71
  }
@@ -101,7 +105,6 @@ export const Menu = styled.div`
101
105
  display: flex;
102
106
  align-items: center;
103
107
  margin-right: 10px;
104
-
105
108
  #select-input {
106
109
  border-radius: 7.6px;
107
110
  #list {
@@ -137,7 +140,7 @@ export const Menu = styled.div`
137
140
  justify-content: center;
138
141
  position: relative;
139
142
  height: 44px;
140
- @media (min-width: 821px) {
143
+ @media (min-width: 850px) {
141
144
  border: 1px solid #DEE2E6;
142
145
  justify-content: space-between;
143
146
  }
@@ -195,7 +198,7 @@ export const Menu = styled.div`
195
198
  padding: 0 20px;
196
199
  }
197
200
  }
198
- @media (min-width: 821px) {
201
+ @media (min-width: 850px) {
199
202
  .moment-popover,
200
203
  .address-popover {
201
204
  display: flex;
@@ -233,7 +236,7 @@ export const SubMenu = styled(InnerHeader)`
233
236
  box-sizing: border-box;
234
237
  margin: 0px;
235
238
  position: relative;
236
- @media (min-width: 821px) {
239
+ @media (min-width: 850px) {
237
240
  display: none;
238
241
  }
239
242
  `
@@ -326,7 +329,7 @@ export const MomentMenu = styled.div`
326
329
  width: 200px;
327
330
  display: none;
328
331
 
329
- @media (min-width: 821px) {
332
+ @media (min-width: 850px) {
330
333
  display: flex;
331
334
  }
332
335
  @media (min-width: 1175px) {
@@ -455,7 +458,7 @@ export const LeftSide = styled.div`
455
458
  width: 100%;
456
459
  @media (min-width: 769px){
457
460
  flex-direction: ${({ theme }) =>
458
- theme?.header?.components?.logo?.components?.layout?.position === 'center' ? 'row-reverse' : 'row'};
461
+ ['center', 'right']?.includes(theme?.header?.components?.logo?.components?.layout?.position) ? 'row-reverse' : 'row'};
459
462
  width: 60%;
460
463
  }
461
464
  `
@@ -115,7 +115,7 @@ export const OriginalHomeHero = (props) => {
115
115
  <ContentWrapper>
116
116
  {windowSize.width < 576 && !isChew && (
117
117
  <LogoWrapper>
118
- <img alt='Logotype' src={logo || theme?.images?.logos?.logotypeInvert} loading='lazy' />
118
+ <img alt='Logotype' src={theme?.images?.logos?.logotypeInvert} loading='lazy' />
119
119
  </LogoWrapper>
120
120
  )}
121
121
  <HeroContent>
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useState } from 'react'
2
2
  import {
3
3
  useLanguage,
4
4
  useConfig,
@@ -28,6 +28,8 @@ import {
28
28
  SectionLeft,
29
29
  SectionLeftText
30
30
  } from './styles'
31
+ import { StripeElementsForm } from '../StripeElementsForm'
32
+ import Modal from '../Modal'
31
33
 
32
34
  const stripeOptions = ['stripe_direct', 'stripe', 'stripe_connect']
33
35
 
@@ -72,17 +74,21 @@ const MultiCartsPaymethodsAndWalletsUI = (props) => {
72
74
  handlePaymethodDataChange,
73
75
  setCardList,
74
76
  walletsPaymethod,
75
- isCustomerMode
77
+ isCustomerMode,
78
+ handlePlaceOrder,
79
+ cartGroup
76
80
  } = props
77
81
 
78
82
  const theme = useTheme()
79
83
  const [, t] = useLanguage()
80
84
  const [{ configs }] = useConfig()
81
85
  const [{ parsePrice }] = useUtils()
86
+ const [openPaymethod, setOpenPaymethod] = useState(null)
82
87
 
83
88
  const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
84
89
  const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
85
-
90
+ const methodsPay = ['global_google_pay', 'global_apple_pay']
91
+ const stripeDirectMethods = ['stripe_direct', ...methodsPay]
86
92
  const walletName = {
87
93
  cash: {
88
94
  name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
@@ -109,7 +115,10 @@ const MultiCartsPaymethodsAndWalletsUI = (props) => {
109
115
  {(!isCustomerMode || (isCustomerMode && (paymethod.gateway === 'card_delivery' || paymethod.gateway === 'cash'))) && (
110
116
  <PayCard
111
117
  isActive={paymethodSelected?.id === paymethod.id}
112
- onClick={() => handleSelectPaymethod({ ...paymethod, paymethod: { gateway: paymethod.gateway }, paymethod_id: paymethod?.id })}
118
+ onClick={() => {
119
+ handleSelectPaymethod({ ...paymethod, paymethod: { gateway: paymethod.gateway }, paymethod_id: paymethod?.id })
120
+ setOpenPaymethod(paymethod)
121
+ }}
113
122
  >
114
123
  <div>{getPayIcon(paymethod.id)}</div>
115
124
  <p>{t(paymethod?.gateway.toUpperCase(), paymethod?.name)}</p>
@@ -161,57 +170,80 @@ const MultiCartsPaymethodsAndWalletsUI = (props) => {
161
170
  {walletsState?.result?.filter(wallet =>
162
171
  paymethodsAndWallets.wallets.find(item => item.type === wallet.type))
163
172
  .map((wallet, idx) => walletName[wallet.type]?.isActive &&
164
- (
165
- <WalletOptionContainer
166
- key={wallet.type}
167
- isBottomBorder={idx === paymethodsAndWallets.wallets?.length - 1}
168
- >
169
- <SectionLeft>
170
- <Checkbox
171
- name={`payment_option_${wallet.type}`}
172
- id={`custom-checkbox-${idx}`}
173
- disabled={
174
- (balance === 0 && !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id) ||
175
- wallet.balance === 0
176
- }
177
- value={`payment_option_${wallet.type}`}
178
- checked={!!walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id}
179
- onChange={() => handleSelectWallet(
180
- !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id,
181
- wallet
182
- )}
183
- />
184
- <SectionLeftText>
185
- <label
186
- style={{
187
- color: (balance === 0 && !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id) ||
188
- wallet.balance === 0 ? theme.colors.darkGray : 'black'
189
- }}
190
- htmlFor={`custom-checkbox-${idx}`}
191
- >
192
- {walletName[wallet.type]?.name}
193
- </label>
194
- </SectionLeftText>
195
- </SectionLeft>
196
- <div>
197
- {wallet.type === 'cash' && (
198
- <span>{parsePrice(wallet?.balance, { isTruncable: true })}</span>
199
- )}
200
- {wallet.type === 'credit_point' && (
201
- <span>
202
- <span style={{ color: theme.colors.primary }}>
203
- {`${wallet?.balance} ${t('POINTS', 'Points')}`}
204
- </span> {wallet?.balance > 0 && `= ${parsePrice(wallet?.balance / wallet?.redemption_rate, { isTruncable: true })}`}
205
- </span>
206
- )}
207
- </div>
208
- </WalletOptionContainer>
209
- ))}
173
+ (
174
+ <WalletOptionContainer
175
+ key={wallet.type}
176
+ isBottomBorder={idx === paymethodsAndWallets.wallets?.length - 1}
177
+ >
178
+ <SectionLeft>
179
+ <Checkbox
180
+ name={`payment_option_${wallet.type}`}
181
+ id={`custom-checkbox-${idx}`}
182
+ disabled={
183
+ (balance === 0 && !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id) ||
184
+ wallet.balance === 0
185
+ }
186
+ value={`payment_option_${wallet.type}`}
187
+ checked={!!walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id}
188
+ onChange={() => handleSelectWallet(
189
+ !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id,
190
+ wallet
191
+ )}
192
+ />
193
+ <SectionLeftText>
194
+ <label
195
+ style={{
196
+ color: (balance === 0 && !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id) ||
197
+ wallet.balance === 0 ? theme.colors.darkGray : 'black'
198
+ }}
199
+ htmlFor={`custom-checkbox-${idx}`}
200
+ >
201
+ {walletName[wallet.type]?.name}
202
+ </label>
203
+ </SectionLeftText>
204
+ </SectionLeft>
205
+ <div>
206
+ {wallet.type === 'cash' && (
207
+ <span>{parsePrice(wallet?.balance, { isTruncable: true })}</span>
208
+ )}
209
+ {wallet.type === 'credit_point' && (
210
+ <span>
211
+ <span style={{ color: theme.colors.primary }}>
212
+ {`${wallet?.balance} ${t('POINTS', 'Points')}`}
213
+ </span> {wallet?.balance > 0 && `= ${parsePrice(wallet?.balance / wallet?.redemption_rate, { isTruncable: true })}`}
214
+ </span>
215
+ )}
216
+ </div>
217
+ </WalletOptionContainer>
218
+ ))}
210
219
  </>
211
220
  )}
212
221
  </WalletPaymentOptionContainer>
213
222
  )}
214
-
223
+ {/* Stripe direct, Google pay, Apple pay */}
224
+ <Modal
225
+ title={t('ADD_CARD', 'Add card')}
226
+ open={stripeDirectMethods?.includes(openPaymethod?.gateway) && !paymethodSelected?.paymethod_data?.id}
227
+ className='modal-info'
228
+ onClose={() => setOpenPaymethod(null)}
229
+ >
230
+ {!paymethodSelected?.data?.publishable &&
231
+ <Container>
232
+ <p>{t('ADD_PUBLISHABLE_KEY', 'Please add a publishable key')}</p>
233
+ </Container>}
234
+ {paymethodSelected?.data?.publishable && stripeDirectMethods?.includes(paymethodSelected?.paymethod?.gateway) && (
235
+ <StripeElementsForm
236
+ methodsPay={methodsPay}
237
+ paymethod={paymethodSelected?.paymethod?.gateway}
238
+ businessId={props.businessId}
239
+ cartGroup={cartGroup?.result}
240
+ publicKey={paymethodSelected?.data?.publishable || paymethodSelected?.data?.publishable_key}
241
+ handleSource={handlePaymethodDataChange}
242
+ onCancel={() => setOpenPaymethod(null)}
243
+ handlePlaceOrder={handlePlaceOrder}
244
+ />
245
+ )}
246
+ </Modal>
215
247
  </Container>
216
248
  )
217
249
  }
@@ -101,10 +101,18 @@ const MultiCheckoutUI = (props) => {
101
101
  ? JSON.parse(configs?.driver_tip_options?.value) || []
102
102
  : configs?.driver_tip_options?.value || []
103
103
 
104
+ const methodsPay = ['global_google_pay', 'global_apple_pay']
104
105
  const creditPointPlan = loyaltyPlansState?.result?.find((loyal) => loyal.type === 'credit_point')
105
106
  const businessIds = openCarts.map((cart) => cart.business_id)
106
107
  const loyalBusinessIds = creditPointPlan?.businesses?.filter((b) => b.accumulates).map((item) => item.business_id) ?? []
107
108
  const creditPointPlanOnBusiness = businessIds.every((bid) => loyalBusinessIds.includes(bid)) && creditPointPlan
109
+ const creditPointGeneralPlan = loyaltyPlansState?.result?.find((loyal) => loyal.type === 'credit_point')
110
+ const loyalBusinessAvailable = creditPointGeneralPlan?.businesses?.filter((b) => b.accumulates) ?? []
111
+
112
+ const accumulationRateBusiness = (businessId) => {
113
+ const value = loyalBusinessAvailable?.find((loyal) => loyal.business_id === businessId)?.accumulation_rate ?? 0
114
+ return value || (creditPointGeneralPlan?.accumulation_rate ?? 0)
115
+ }
108
116
 
109
117
  const getIncludedTaxes = (cart) => {
110
118
  if (cart?.taxes === null || !cart?.taxes) {
@@ -116,12 +124,8 @@ const MultiCheckoutUI = (props) => {
116
124
  }
117
125
  }
118
126
 
119
- const subtotalAmount = openCarts.reduce((sum, cart) => sum + (cart?.subtotal + getIncludedTaxes(cart)), 0) *
120
- creditPointPlanOnBusiness?.accumulation_rate
121
-
122
- const loyaltyRewardValue = (creditPointPlanOnBusiness?.accumulation_rate
123
- ? (Math.trunc(subtotalAmount * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2)
124
- : 0)
127
+ const clearAmount = (value) => parseFloat((Math.trunc(value * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2))
128
+ const loyaltyRewardValue = openCarts.reduce((sum, cart) => sum + clearAmount((cart?.subtotal + getIncludedTaxes(cart)) * accumulationRateBusiness(cart?.business_id)), 0)
125
129
 
126
130
  const handlePlaceOrder = () => {
127
131
  if (!userErrors.length) {
@@ -210,6 +214,15 @@ const MultiCheckoutUI = (props) => {
210
214
  }
211
215
  }, [walletState.error])
212
216
 
217
+ useEffect(() => {
218
+ if (methodsPay.includes(paymethodSelected?.paymethod?.gateway) && typeof paymethodSelected?.paymethod_data === 'string') {
219
+ const hasSource = JSON.parse(paymethodSelected?.paymethod_data)?.source_id
220
+ if (hasSource) {
221
+ handlePlaceOrder()
222
+ }
223
+ }
224
+ }, [paymethodSelected])
225
+
213
226
  return (
214
227
  <>
215
228
  {((!cartGroup?.loading && openCarts.length === 0) || !cartUuid) ? (
@@ -261,7 +274,9 @@ const MultiCheckoutUI = (props) => {
261
274
  handlePaymethodDataChange={handlePaymethodDataChange}
262
275
  cartUuid={cartUuid}
263
276
  isCustomerMode={isCustomerMode}
277
+ cartGroup={cartGroup}
264
278
  setCardList={setCardList}
279
+ handlePlaceOrder={handlePlaceOrder}
265
280
  />
266
281
  </PaymentMethodContainer>
267
282
 
@@ -12,6 +12,7 @@ import AiFillExclamationCircle from '@meronex/icons/ai/AiFillExclamationCircle'
12
12
  import { Phone, Chat } from 'react-bootstrap-icons'
13
13
  import { Button } from '../../styles/Buttons'
14
14
  import { Modal } from '../Modal'
15
+ import { OrderEta } from '../OrderDetails/OrderEta'
15
16
 
16
17
  import {
17
18
  SingleOrderContainer,
@@ -47,6 +48,8 @@ const SingleOrderCardUI = (props) => {
47
48
  const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
48
49
  const hideIndividualButton = configs.multi_business_checkout_remove_individual_buttons?.value === '1'
49
50
 
51
+ const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
52
+
50
53
  const handleGoToOrderDetails = (uuid) => {
51
54
  events.emit('go_to_page', { page: 'order_detail', params: { orderId: uuid }, replace: !props.isMultiOrders })
52
55
  }
@@ -84,11 +87,11 @@ const SingleOrderCardUI = (props) => {
84
87
  {orderTypes?.find(type => order?.delivery_type === type?.value)?.text}:
85
88
  </p>
86
89
  <p className='date'>
87
- {
88
- order?.delivery_datetime_utc
89
- ? parseDate(order?.delivery_datetime_utc)
90
- : parseDate(order?.delivery_datetime, { utc: false })
91
- }
90
+ {activeStatus.includes(order?.status) ? (
91
+ <OrderEta order={order} />
92
+ ) : (
93
+ parseDate(order?.reporting_data?.at[`status:${order.status}`])
94
+ )}
92
95
  </p>
93
96
  </div>
94
97
  </div>
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { useLanguage, useOrderingTheme } from 'ordering-components-external'
2
+ import { useLanguage } from 'ordering-components-external'
3
3
  import { ProfileOptions } from '../../../../../components/UserProfileForm/ProfileOptions'
4
4
  import { OrdersOption } from '../OrdersOption'
5
5
  import { Button } from '../../styles/Buttons'
@@ -13,19 +13,20 @@ import {
13
13
  MyOrdersMenuContainer
14
14
  } from './styles'
15
15
  import { Tab, Tabs } from '../../styles/Tabs'
16
+ import { useTheme } from 'styled-components'
16
17
 
17
18
  export const MyOrders = (props) => {
18
19
  const {
19
20
  hideOrders,
21
+ isFromBusinessListingSearch,
20
22
  businessesSearchList,
21
23
  onProductRedirect
22
24
  } = props
23
25
 
24
26
  const [, t] = useLanguage()
25
27
  const history = useHistory()
26
-
27
- const [orderingTheme] = useOrderingTheme()
28
- const layout = orderingTheme?.theme?.orders?.components?.layout?.type || 'original'
28
+ const theme = useTheme()
29
+ const layout = theme?.orders?.components?.layout?.type || 'original'
29
30
 
30
31
  const [isEmptyActive, setIsEmptyActive] = useState(false)
31
32
  const [isEmptyPast, setIsEmptyPast] = useState(false)
@@ -34,10 +35,13 @@ export const MyOrders = (props) => {
34
35
  const [isEmptyBusinesses, setIsEmptyBusinesses] = useState(false)
35
36
  const [businessOrderIds, setBusinessOrderIds] = useState([])
36
37
 
38
+ const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
39
+ const hideBusinessTab = theme?.orders?.components?.business_tab?.hidden
40
+
37
41
  const MyOrdersMenu = [
38
- { key: 'orders', value: t('ORDERS', 'Orders') },
39
- { key: 'business', value: t('BUSINESS', 'Business') },
40
- { key: 'products', value: t('PRODUCTS', 'Products') }
42
+ { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false},
43
+ { key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
44
+ { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
41
45
  ]
42
46
 
43
47
  const notOrderOptions = ['business', 'products', 'professionals']
@@ -54,14 +58,14 @@ export const MyOrders = (props) => {
54
58
  {hideOrders && !allEmpty && (
55
59
  <h2>{t('PREVIOUSLY_ORDERED', 'Previously ordered')}</h2>
56
60
  )}
57
- <Container hideOrders={hideOrders}>
61
+ <Container hideOrders={hideOrders} initialHeight={isFromBusinessListingSearch}>
58
62
  {!hideOrders && (
59
63
  <h1>{layout === 'appointments' ? t('MY_APPOINTMENTS', 'My appointments') : t('MY_ORDERS', 'My orders')}</h1>
60
64
  )}
61
65
  {!allEmpty && (
62
66
  <MyOrdersMenuContainer className='category-lists'>
63
67
  <Tabs variant='primary'>
64
- {MyOrdersMenu.filter(option => !hideOrders || option.key !== 'orders').map(option => (
68
+ {MyOrdersMenu.filter(option => (!hideOrders || option.key !== 'orders') && !option.disabled).map(option => (
65
69
  <Tab
66
70
  key={option.key}
67
71
  onClick={() => setSelectedOption(option.key)}
@@ -7,7 +7,9 @@ export const Container = styled.div`
7
7
  width: 100%;
8
8
  box-sizing: border-box;
9
9
  position: relative;
10
- min-height: calc(100vh - 320px);
10
+ ${({ initialHeight }) => !initialHeight && css`
11
+ min-height: calc(100vh - 320px);
12
+ `}
11
13
 
12
14
  > h1 {
13
15
  font-weight: 600;