ordering-ui-external 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/_bundles/0.ordering-ui.9ce64e14904d222c0020.js +1 -0
  2. package/_bundles/{1.ordering-ui.8e20ae6af39ad738a29e.js → 1.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  3. package/_bundles/{2.ordering-ui.8e20ae6af39ad738a29e.js → 2.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  4. package/_bundles/{4.ordering-ui.8e20ae6af39ad738a29e.js → 4.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  5. package/_bundles/{5.ordering-ui.8e20ae6af39ad738a29e.js → 5.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  6. package/_bundles/{6.ordering-ui.8e20ae6af39ad738a29e.js → 6.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  7. package/_bundles/{7.ordering-ui.8e20ae6af39ad738a29e.js → 7.ordering-ui.9ce64e14904d222c0020.js} +2 -2
  8. package/_bundles/{7.ordering-ui.8e20ae6af39ad738a29e.js.LICENSE.txt → 7.ordering-ui.9ce64e14904d222c0020.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.8e20ae6af39ad738a29e.js → 8.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  10. package/_bundles/{9.ordering-ui.8e20ae6af39ad738a29e.js → 9.ordering-ui.9ce64e14904d222c0020.js} +1 -1
  11. package/_bundles/ordering-ui.9ce64e14904d222c0020.js +2 -0
  12. package/_bundles/{ordering-ui.8e20ae6af39ad738a29e.js.LICENSE.txt → ordering-ui.9ce64e14904d222c0020.js.LICENSE.txt} +0 -0
  13. package/_modules/components/BusinessesListing/index.js +1 -3
  14. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +26 -12
  15. package/_modules/components/VerticalOrdersLayout/styles.js +1 -1
  16. package/_modules/themes/five/index.js +7 -0
  17. package/_modules/themes/five/src/components/AddressList/index.js +3 -2
  18. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -2
  19. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +14 -6
  20. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
  21. package/_modules/themes/five/src/components/BusinessProductsList/index.js +50 -14
  22. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +9 -2
  23. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +10 -6
  24. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +55 -186
  25. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +29 -40
  26. package/_modules/themes/five/src/components/Cart/index.js +56 -97
  27. package/_modules/themes/five/src/components/CartContent/index.js +50 -2
  28. package/_modules/themes/five/src/components/CartContent/styles.js +6 -4
  29. package/_modules/themes/five/src/components/Checkout/index.js +8 -2
  30. package/_modules/themes/five/src/components/Checkout/styles.js +10 -4
  31. package/_modules/themes/five/src/components/Header/index.js +26 -34
  32. package/_modules/themes/five/src/components/Header/styles.js +46 -35
  33. package/_modules/themes/five/src/components/HeaderOption/index.js +3 -2
  34. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +3 -2
  35. package/_modules/themes/five/src/components/MultiCheckout/index.js +22 -13
  36. package/_modules/themes/five/src/components/MultiCheckout/styles.js +11 -8
  37. package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +9 -1
  38. package/_modules/themes/five/src/components/OrderContextUI/index.js +192 -0
  39. package/_modules/themes/five/src/components/OrderContextUI/styles.js +41 -0
  40. package/_modules/themes/five/src/components/OrderDetails/index.js +3 -0
  41. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -2
  42. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +8 -2
  43. package/_modules/themes/five/src/components/OrdersOption/index.js +2 -1
  44. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +17 -8
  45. package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +27 -27
  46. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +7 -2
  47. package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +17 -14
  48. package/_modules/themes/five/src/components/SingleOrderCard/index.js +16 -16
  49. package/_modules/themes/five/src/components/SingleOrderCard/styles.js +49 -41
  50. package/package.json +3 -2
  51. package/src/components/BusinessesListing/index.js +1 -3
  52. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +25 -14
  53. package/src/components/VerticalOrdersLayout/styles.js +8 -0
  54. package/src/themes/five/index.js +2 -0
  55. package/src/themes/five/src/components/AddressList/index.js +3 -2
  56. package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -1
  57. package/src/themes/five/src/components/BusinessListingSearch/index.js +4 -0
  58. package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
  59. package/src/themes/five/src/components/BusinessProductsList/index.js +54 -18
  60. package/src/themes/five/src/components/BusinessProductsListing/index.js +14 -2
  61. package/src/themes/five/src/components/BusinessProductsListing/styles.js +18 -6
  62. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +219 -345
  63. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -77
  64. package/src/themes/five/src/components/Cart/index.js +50 -57
  65. package/src/themes/five/src/components/CartContent/index.js +43 -3
  66. package/src/themes/five/src/components/CartContent/styles.js +6 -0
  67. package/src/themes/five/src/components/Checkout/index.js +16 -2
  68. package/src/themes/five/src/components/Checkout/styles.js +19 -6
  69. package/src/themes/five/src/components/Header/index.js +281 -277
  70. package/src/themes/five/src/components/Header/styles.js +20 -51
  71. package/src/themes/five/src/components/HeaderOption/index.js +3 -2
  72. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +2 -1
  73. package/src/themes/five/src/components/MultiCheckout/index.js +27 -13
  74. package/src/themes/five/src/components/MultiCheckout/styles.js +8 -13
  75. package/src/themes/five/src/components/MultiOrdersDetails/index.js +21 -13
  76. package/src/themes/five/src/components/OrderContextUI/index.js +133 -0
  77. package/src/themes/five/src/components/OrderContextUI/styles.js +86 -0
  78. package/src/themes/five/src/components/OrderDetails/index.js +4 -0
  79. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +5 -2
  80. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +4 -0
  81. package/src/themes/five/src/components/OrdersOption/index.js +2 -1
  82. package/src/themes/five/src/components/ProductItemAccordion/index.js +58 -40
  83. package/src/themes/five/src/components/ProductItemAccordion/styles.js +4 -3
  84. package/src/themes/five/src/components/ProductOptionSubOption/index.js +8 -1
  85. package/src/themes/five/src/components/ProductOptionSubOption/styles.js +6 -0
  86. package/src/themes/five/src/components/SingleOrderCard/index.js +12 -13
  87. package/src/themes/five/src/components/SingleOrderCard/styles.js +26 -7
  88. package/template/app.js +179 -66
  89. package/template/components/ListenPageChanges/index.js +3 -2
  90. package/template/components/OrderingThemeUpdated/index.js +41 -0
  91. package/template/helmetdata.json +7 -0
  92. package/template/pages/MessagesList/index.js +2 -0
  93. package/template/pages/MultiCart/index.js +30 -0
  94. package/template/pages/MultiCheckout/index.js +86 -10
  95. package/template/pages/MultiOrdersDetails/index.js +9 -4
  96. package/_bundles/0.ordering-ui.8e20ae6af39ad738a29e.js +0 -1
  97. package/_bundles/ordering-ui.8e20ae6af39ad738a29e.js +0 -2
@@ -0,0 +1,133 @@
1
+ import React, { useState } from 'react'
2
+ import { useLanguage, useOrder, useConfig, useSession } from 'ordering-components-external'
3
+ import { MomentPopover } from '../../../../pwa/src/components/MomentPopover'
4
+ import { OrderTypeSelectorHeader } from '../../../../../components/OrderTypeSelectorHeader'
5
+ import FaMapMarkerAlt from '@meronex/icons/fa/FaMapMarkerAlt'
6
+ import { Modal } from '../Modal'
7
+ import { AddressForm } from '../AddressForm'
8
+ import { AddressList } from '../AddressList'
9
+ import { Alert } from '../Confirm'
10
+ import {
11
+ Container,
12
+ AddressMenu,
13
+ FeatureItems,
14
+ ItemInline
15
+ } from './styles'
16
+
17
+ export const OrderContextUI = (props) => {
18
+ const { isCheckOut, setMapErrors, isCustomerMode, isBusinessList } = props
19
+
20
+ const [, t] = useLanguage()
21
+ const [orderState] = useOrder()
22
+ const [configState] = useConfig()
23
+ const [{ auth }] = useSession()
24
+
25
+ const [openPopover, setOpenPopover] = useState({})
26
+ const [modals, setModals] = useState({ listOpen: false, formOpen: false, citiesOpen: false })
27
+ const [alertState, setAlertState] = useState({ open: false, content: [] })
28
+
29
+ const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
30
+
31
+ const configTypes = configState?.configs?.order_types_allowed?.value.split('|').map(value => Number(value)) || []
32
+
33
+ const handleTogglePopover = (type) => {
34
+ setOpenPopover({
35
+ ...openPopover,
36
+ [type]: !openPopover[type]
37
+ })
38
+ }
39
+
40
+ const handleClosePopover = (type) => {
41
+ setOpenPopover({
42
+ ...openPopover,
43
+ [type]: false
44
+ })
45
+ }
46
+
47
+ const handleFindBusinesses = () => {
48
+ if (!orderState?.options?.address?.location) {
49
+ setAlertState({ open: true, content: [t('SELECT_AN_ADDRESS_TO_SEARCH', 'Select or add an address to search')] })
50
+ return
51
+ }
52
+ setModals({ listOpen: false, formOpen: false })
53
+ }
54
+
55
+ const handleCloseAlerts = () => {
56
+ setAlertState({ open: false, content: [] })
57
+ setMapErrors && setMapErrors('')
58
+ }
59
+
60
+ const handleClickAddress = (e) => {
61
+ if (auth) {
62
+ setModals({ ...modals, listOpen: true })
63
+ } else {
64
+ setModals({ ...modals, formOpen: true })
65
+ }
66
+ }
67
+
68
+ return (
69
+ <>
70
+ <Container isBusinessList={isBusinessList}>
71
+ <AddressMenu
72
+ onClick={() => handleClickAddress()}
73
+ isCheckOut={isCheckOut}
74
+ >
75
+ <FaMapMarkerAlt />
76
+ <span>{orderState.options?.address?.address || t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?')}</span>
77
+ </AddressMenu>
78
+ <FeatureItems>
79
+ <ItemInline>
80
+ <OrderTypeSelectorHeader configTypes={configTypes} />
81
+ </ItemInline>
82
+ <ItemInline>
83
+ <MomentPopover
84
+ open={openPopover.moment}
85
+ onClick={() => handleTogglePopover('moment')}
86
+ onClose={() => handleClosePopover('moment')}
87
+ isBanner
88
+ />
89
+ </ItemInline>
90
+ </FeatureItems>
91
+ </Container>
92
+ <Modal
93
+ title={t('ADDRESS_FORM', 'Address Form')}
94
+ open={modals.formOpen}
95
+ onClose={() => setModals({ ...modals, formOpen: false })}
96
+ >
97
+ <AddressForm
98
+ useValidationFileds
99
+ address={orderState?.options?.address || {}}
100
+ onClose={() => setModals({ ...modals, formOpen: false })}
101
+ onCancel={() => setModals({ ...modals, formOpen: false })}
102
+ onSaveAddress={() => setModals({ ...modals, formOpen: false })}
103
+ />
104
+ </Modal>
105
+
106
+ <Modal
107
+ title={t('ADDRESSES', 'Address List')}
108
+ open={modals.listOpen}
109
+ width='70%'
110
+ onClose={() => setModals({ ...modals, listOpen: false })}
111
+ >
112
+ <AddressList
113
+ isModal
114
+ changeOrderAddressWithDefault
115
+ userId={isNaN(userCustomer?.id) ? null : userCustomer?.id}
116
+ onCancel={() => setModals({ ...modals, listOpen: false })}
117
+ onAccept={() => handleFindBusinesses()}
118
+ isCustomerMode={isCustomerMode}
119
+ isMobile
120
+ />
121
+ </Modal>
122
+ <Alert
123
+ title={t('ORDERING', 'Ordering')}
124
+ content={alertState.content}
125
+ acceptText={t('ACCEPT', 'Accept')}
126
+ open={alertState.open}
127
+ onClose={() => handleCloseAlerts()}
128
+ onAccept={() => handleCloseAlerts()}
129
+ closeOnBackdrop={false}
130
+ />
131
+ </>
132
+ )
133
+ }
@@ -0,0 +1,86 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const Container = styled.div`
4
+ ${({ isBusinessList }) => isBusinessList && css`
5
+ position: absolute;
6
+ top: 10%;
7
+ width: 100%;
8
+ padding: 0 15px;
9
+ box-sizing: border-box;
10
+ `}
11
+ margin-top: 10px;
12
+ `
13
+
14
+ export const AddressMenu = styled.div`
15
+ cursor: pointer;
16
+ font-size: 14px;
17
+ display: flex;
18
+ align-items: center;
19
+ background-color: ${props => props.theme.colors.backgroundPage};
20
+ font-weight: 600;
21
+ border-radius: 50px;
22
+ padding: 13px 19px;
23
+ margin-bottom: 10px;
24
+ ${({ isCheckOut }) => isCheckOut && css`
25
+ background-color: ${props => props.theme.colors.grayDividerColor};
26
+ `}
27
+
28
+ span {
29
+ width: 100%;
30
+ overflow: hidden;
31
+ text-overflow: ellipsis;
32
+ white-space: nowrap;
33
+ }
34
+ svg {
35
+ margin-right: 5px;
36
+ color: ${props => props.theme.colors.lightGray};
37
+ ${props => props.theme?.rtl && css`
38
+ margin-left: 5px;
39
+ margin-right: 0;
40
+ `}
41
+ }
42
+ `
43
+
44
+ export const FeatureItems = styled.div`
45
+ width: 100%;
46
+ display: flex;
47
+ justify-content: space-between;
48
+ `
49
+
50
+ export const ItemInline = styled.div`
51
+ > span #select-input {
52
+ background-color: ${props => props.theme.colors.grayDividerColor} !important;
53
+ border: none;
54
+ border-radius: 7.6px;
55
+ svg {
56
+ font-size: 14px;
57
+ }
58
+ #list {
59
+ background-color: ${props => props.theme.colors.backgroundPage};
60
+ border: none;
61
+ border-radius: 7.6px;
62
+
63
+ left: 0px;
64
+ right: initial;
65
+
66
+ ${props => props.theme.rtl && css`
67
+ left: initial;
68
+ right: 0px;
69
+ `}
70
+ }
71
+
72
+ > div:first-child {
73
+ font-size: 11px;
74
+ }
75
+ }
76
+
77
+ .moment-popover {
78
+ > div:first-child {
79
+ font-size: 11px;
80
+ padding: 4px 7px;
81
+ svg {
82
+ font-size: 14px;
83
+ }
84
+ }
85
+ }
86
+ `
@@ -400,6 +400,10 @@ const OrderDetailsUI = (props) => {
400
400
  businessLogoUrlValidation()
401
401
  }, [order])
402
402
 
403
+ useEffect(() => {
404
+ window.scrollTo(0, 0)
405
+ }, [])
406
+
403
407
  const disableLeftButton = [1, 2, 5, 15, 16, 17, 20, 21]
404
408
  const disableRightButton = [1, 2, 5, 15, 16, 17, 21]
405
409
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { useOrder } from 'ordering-components-external'
2
+ import { useOrder, useOrderingTheme } from 'ordering-components-external'
3
3
  import { BusinessController } from '../../BusinessController'
4
4
  import { AutoScroll } from '../../AutoScroll'
5
5
  import { BusinessList, BusinessListWrapper } from './styles'
@@ -15,14 +15,17 @@ export const PreviousBusinessOrdered = (props) => {
15
15
  } = props
16
16
 
17
17
  const [orderState] = useOrder()
18
+ const [orderingTheme] = useOrderingTheme()
18
19
  const { width } = useWindowSize()
20
+ const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
21
+
19
22
  const onBusinessClick = (business) => {
20
23
  onRedirectPage({ page: 'business', params: { store: business.slug } })
21
24
  }
22
25
 
23
26
  return (
24
27
  <BusinessListWrapper isLoading={businesses?.loading}>
25
- <BusinessList>
28
+ <BusinessList marginCard={isChew && '0 20px 0 0'}>
26
29
  <AutoScroll scrollId='searchlistorder'>
27
30
  {
28
31
  businesses?.result?.map((business, i) => (
@@ -33,6 +33,10 @@ export const BusinessList = styled.div`
33
33
  width: calc(100vw - 40px);
34
34
  min-width: calc(100vw - 40px);
35
35
 
36
+ ${({ marginCard }) => marginCard && css`
37
+ margin: ${({ marginCard }) => marginCard} !important;
38
+ `}
39
+
36
40
  @media (min-width: 681px) {
37
41
  width: calc(50vw - 40px);
38
42
  min-width: calc(50vw - 40px);
@@ -368,6 +368,7 @@ const OrdersOptionUI = (props) => {
368
368
  reorderLoading={reorderState?.loading}
369
369
  orders={orders.filter(order => orderStatus.includes(order.status)).sort((a, b) => moment(b?.delivery_datetime_utc).valueOf() - moment(a?.delivery_datetime_utc).valueOf())}
370
370
  pagination={pagination}
371
+ customArray={customArray}
371
372
  loadMoreOrders={loadMoreOrders}
372
373
  onRedirectPage={onRedirectPage}
373
374
  getOrderStatus={getOrderStatus}
@@ -409,7 +410,7 @@ export const OrdersOption = (props) => {
409
410
  useDefualtSessionManager: true,
410
411
  paginationSettings: {
411
412
  initialPage: 1,
412
- pageSize: 3,
413
+ pageSize: (getAllOrders || props.activeOrders) ? 30 : 10,
413
414
  controlType: 'infinity'
414
415
  }
415
416
  }
@@ -33,6 +33,7 @@ import { useTheme } from 'styled-components'
33
33
 
34
34
  export const ProductItemAccordion = (props) => {
35
35
  const {
36
+ isDisabledEdit,
36
37
  isCartPending,
37
38
  isCartProduct,
38
39
  product,
@@ -117,11 +118,10 @@ export const ProductItemAccordion = (props) => {
117
118
  <BeforeComponent key={i} {...props} />))}
118
119
  <AccordionSection isCheckout={isCheckout}>
119
120
  <Accordion
120
- isValid={product?.valid ?? true}
121
121
  className={`product accordion ${setActive}`}
122
122
  onClick={(e) => toggleAccordion(e)}
123
123
  >
124
- <ProductInfo className='info'>
124
+ <ProductInfo className='info' isValid={product?.valid ?? true}>
125
125
  {(product?.images || theme?.images?.dummies?.product) && showProductImage && (
126
126
  <WrapperProductImage>
127
127
  <ProductImage bgimage={product?.images || theme?.images?.dummies?.product} />
@@ -140,7 +140,7 @@ export const ProductItemAccordion = (props) => {
140
140
  </ScheduleInfoWrapper>
141
141
  ) : (
142
142
  <>
143
- {isCartProduct && !isCartPending && getProductMax ? (
143
+ {!isDisabledEdit && isCartProduct && !isCartPending && getProductMax ? (
144
144
  <ProductSelectWrapper>
145
145
  <IosArrowDown />
146
146
  <ProductSelect
@@ -180,7 +180,7 @@ export const ProductItemAccordion = (props) => {
180
180
  <p>{parsePrice(product.total || product.price)}</p>
181
181
  {isCartProduct && !isCartPending && (
182
182
  <div>
183
- {onEditProduct && (
183
+ {onEditProduct && !isDisabledEdit && (
184
184
  <span ref={productActionsEdit}>
185
185
  <Pencil color='#B1BCCC' onClick={() => onEditProduct(product)} />
186
186
  </span>
@@ -199,20 +199,59 @@ export const ProductItemAccordion = (props) => {
199
199
  )}
200
200
  </ProductInfo>
201
201
 
202
- {(product?.valid || !isCartProduct) && windowSize.width > 410 && (
203
- <ProductPriceSection>
204
- <ProductPrice className='prod-price'>
205
- <span>
206
- {parsePrice(product.total || product.price)}
207
- </span>
208
- {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
209
- <p>
210
- <IosArrowDown className={`${setRotate}`} />
211
- </p>
212
- )}
213
- </ProductPrice>
214
- {isCartProduct && !isCartPending && (
215
- <ProductActions>
202
+ {product.valid ? (
203
+ <>
204
+ {(product?.valid || !isCartProduct) && windowSize.width > 410 && (
205
+ <ProductPriceSection>
206
+ <ProductPrice className='prod-price'>
207
+ <span>
208
+ {parsePrice(product.total || product.price)}
209
+ </span>
210
+ {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
211
+ <p>
212
+ <IosArrowDown className={`${setRotate}`} />
213
+ </p>
214
+ )}
215
+ </ProductPrice>
216
+ {isCartProduct && !isCartPending && (
217
+ <ProductActions>
218
+ {!isDisabledEdit && (
219
+ <ProductActionsEdit
220
+ ref={productActionsEdit}
221
+ onClick={() => onEditProduct(product)}
222
+ disabled={orderState.loading}
223
+ >
224
+ <Pencil color='#B1BCCC' />
225
+ </ProductActionsEdit>
226
+ )}
227
+ <ProductActionsDelete
228
+ ref={productActionsDelete}
229
+ onClick={() => onDeleteProduct(product)}
230
+ disabled={orderState.loading}
231
+ >
232
+ <Trash color='#B1BCCC' />
233
+ </ProductActionsDelete>
234
+ </ProductActions>
235
+ )}
236
+ </ProductPriceSection>
237
+ )}
238
+ </>
239
+ ) : (
240
+ <ProductActions>
241
+ <ProductActionsDelete
242
+ ref={productActionsDelete}
243
+ onClick={() => onDeleteProduct(product)}
244
+ disabled={orderState.loading}
245
+ >
246
+ <Trash color='#B1BCCC' />
247
+ </ProductActionsDelete>
248
+ </ProductActions>
249
+ )}
250
+
251
+ {isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity && (
252
+ <ProductError>
253
+ <ProductActions>
254
+ {!isDisabledEdit && (
216
255
  <ProductActionsEdit
217
256
  ref={productActionsEdit}
218
257
  onClick={() => onEditProduct(product)}
@@ -220,28 +259,7 @@ export const ProductItemAccordion = (props) => {
220
259
  >
221
260
  <Pencil color='#B1BCCC' />
222
261
  </ProductActionsEdit>
223
- <ProductActionsDelete
224
- ref={productActionsDelete}
225
- onClick={() => onDeleteProduct(product)}
226
- disabled={orderState.loading}
227
- >
228
- <Trash color='#B1BCCC' />
229
- </ProductActionsDelete>
230
- </ProductActions>
231
- )}
232
- </ProductPriceSection>
233
- )}
234
-
235
- {isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity && (
236
- <ProductError>
237
- <ProductActions>
238
- <ProductActionsEdit
239
- ref={productActionsEdit}
240
- onClick={() => onEditProduct(product)}
241
- disabled={orderState.loading}
242
- >
243
- <Pencil color='#B1BCCC' />
244
- </ProductActionsEdit>
262
+ )}
245
263
  <ProductActionsDelete
246
264
  ref={productActionsDelete}
247
265
  onClick={() => onDeleteProduct(product)}
@@ -41,9 +41,6 @@ const AccordionStyled = styled.div`
41
41
 
42
42
  export const Accordion = (props) => {
43
43
  const style = {}
44
- if (!props.isValid) {
45
- style.opacity = '0.5'
46
- }
47
44
  return (
48
45
  <AccordionStyled
49
46
  {...props}
@@ -217,6 +214,10 @@ export const ProductInfo = styled.div`
217
214
  margin: 0px 5px;
218
215
  }
219
216
 
217
+ ${({ isValid }) => !isValid && css`
218
+ opacity: 0.5;
219
+ `}
220
+
220
221
  @media (min-width: 411px) {
221
222
  width: 80%;
222
223
  }
@@ -8,6 +8,7 @@ import BsCircleFill from '@meronex/icons/bs/BsCircleFill'
8
8
  import BsCircleHalf from '@meronex/icons/bs/BsCircleHalf'
9
9
  import BsDashCircle from '@meronex/icons/bs/BsDashCircle'
10
10
  import BsPlusCircle from '@meronex/icons/bs/BsPlusCircle'
11
+ import { useWindowSize } from '../../../../../hooks/useWindowSize'
11
12
 
12
13
  import {
13
14
  Container,
@@ -43,6 +44,7 @@ const ProductOptionSubOptionUI = (props) => {
43
44
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
44
45
  const [, t] = useLanguage()
45
46
  const [{ parsePrice }] = useUtils()
47
+ const { width } = useWindowSize()
46
48
  const [showMessage, setShowMessage] = useState(false)
47
49
  const [isDirty, setIsDirty] = useState(false)
48
50
 
@@ -112,7 +114,7 @@ const ProductOptionSubOptionUI = (props) => {
112
114
  )}
113
115
  <Text>
114
116
  <div>{suboption?.name}</div>
115
- {showMessage && <span>{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}</span>}
117
+ {showMessage && width > 576 && <span>{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}</span>}
116
118
  </Text>
117
119
  </LeftOptionContainer>
118
120
  <RightOptionContainer>
@@ -159,6 +161,11 @@ const ProductOptionSubOptionUI = (props) => {
159
161
  )}
160
162
  </SuboptionPrice>
161
163
  </Container>
164
+ {showMessage && width < 576 && (
165
+ <Text noMargin>
166
+ <span>{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}</span>
167
+ </Text>
168
+ )}
162
169
  {props.afterComponents?.map((AfterComponent, i) => (
163
170
  <AfterComponent key={i} {...props} />))}
164
171
  {props.afterElements?.map((AfterElement, i) => (
@@ -59,6 +59,12 @@ export const Text = styled.div`
59
59
  margin-right: 10px;
60
60
  `}
61
61
  }
62
+
63
+ ${({ noMargin }) => noMargin && css`
64
+ span {
65
+ margin: 0;
66
+ }
67
+ `}
62
68
  `
63
69
 
64
70
  export const SubOptionThumbnail = styled.div`
@@ -142,6 +142,7 @@ const SingleOrderCardUI = (props) => {
142
142
  <BeforeComponent key={i} {...props} />))}
143
143
  <Container
144
144
  id='order-card'
145
+ w={screen.width - (screen.width < 411 ? -60 : 60)}
145
146
  isBusinessesPage={isBusinessesPage}
146
147
  isCustomerMode={isCustomerMode}
147
148
  onClick={(e) => handleClickCard(e, order)}
@@ -155,20 +156,18 @@ const SingleOrderCardUI = (props) => {
155
156
  <>
156
157
  {order?.business?.length > 1 ? (
157
158
  <MultiLogosContainer>
158
- {order?.business?.map((business, i) => (
159
- <React.Fragment key={business?.id}>
160
- {i > 1 ? (
161
- <p>
162
- + {order?.business?.length - 2}
163
- </p>
164
- ) : (
165
- <BusinessLogoWrapper
166
- bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_400,c_limit')}
167
- isMulti
168
- />
169
- )}
170
- </React.Fragment>
159
+ {order?.business?.map((business, i) => i < 2 && (
160
+ <BusinessLogoWrapper
161
+ key={business?.id}
162
+ bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_400,c_limit')}
163
+ isMulti
164
+ />
171
165
  ))}
166
+ {order?.business?.length > 1 && (order?.business?.length - 2) > 0 && (
167
+ <p>
168
+ + {order?.business?.length - 2}
169
+ </p>
170
+ )}
172
171
  </MultiLogosContainer>
173
172
  ) : (
174
173
  <BusinessLogoWrapper bgimage={optimizeImage(order?.business?.logo || theme.images?.dummies?.businessLogo, 'h_400,c_limit')} />
@@ -3,7 +3,7 @@ import React from 'react'
3
3
 
4
4
  export const Container = styled.div`
5
5
  cursor: pointer;
6
- margin: 10px;
6
+ margin: 10px 0;
7
7
  position: relative;
8
8
  background: white;
9
9
  border-radius: 16px;
@@ -20,8 +20,8 @@ export const Container = styled.div`
20
20
  width: 300px;
21
21
  display: inline-block;
22
22
  ` : css`
23
- min-width: 380px;
24
- width: 380px;
23
+ min-width: ${({ w }) => w ?? 380}px;
24
+ width: ${({ w }) => w ?? 380}px;
25
25
  height: ${({ isBusinessesPage }) => isBusinessesPage && '300px'};
26
26
  max-height: ${({ isBusinessesPage }) => isBusinessesPage ? '300px' : '220px'};
27
27
  `}
@@ -54,6 +54,10 @@ export const Container = styled.div`
54
54
  width: 430px;
55
55
  }
56
56
 
57
+ @media (min-width: 768px) {
58
+ margin: 10px;
59
+ }
60
+
57
61
  @media(min-width: 993px){
58
62
  ${({ isBusinessesPage }) => isBusinessesPage && css`
59
63
  margin: 30px 20px;
@@ -66,13 +70,17 @@ export const Content = styled.div`
66
70
  display: flex;
67
71
  position: relative;
68
72
  border-radius: 16px;
69
- padding: 10px;
73
+ padding: 0;
70
74
  ${({ isCustomerMode }) => isCustomerMode ? css`
71
75
  align-items: center;
72
76
  ` : css`
73
77
  align-items: flex-start;
74
78
  flex: 1;
75
79
  `}
80
+
81
+ @media (min-width: 768px) {
82
+ padding: 10px;
83
+ }
76
84
  `
77
85
 
78
86
  export const Price = styled.div`
@@ -135,13 +143,24 @@ const BusinessLogoWrapperStyled = styled.div`
135
143
  border-radius: 7.6px;
136
144
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
137
145
 
138
- margin-left: 8px;
146
+ margin-right: 8px;
147
+ margin-left: 0px;
139
148
 
140
149
  ${props => props.theme.rtl && css`
141
- margin-left: 0px;
142
- margin-right: 8px;
150
+ margin-left: 8px;
151
+ margin-right: 0px;
143
152
  `}
144
153
 
154
+ @media (min-width: 768px) {
155
+ margin-right: 0px;
156
+ margin-left: 8px;
157
+
158
+ ${props => props.theme.rtl && css`
159
+ margin-left: 0px;
160
+ margin-right: 8px;
161
+ `}
162
+ }
163
+
145
164
  @media (min-width: 576px) {
146
165
  width: 86px;
147
166
  min-width: 86px;