ordering-ui-external 1.4.5 → 1.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.
- package/_bundles/{0.ordering-ui.9c913f613f7ccfd32dd9.js → 0.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{1.ordering-ui.9c913f613f7ccfd32dd9.js → 1.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{2.ordering-ui.9c913f613f7ccfd32dd9.js → 2.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{4.ordering-ui.9c913f613f7ccfd32dd9.js → 4.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{5.ordering-ui.9c913f613f7ccfd32dd9.js → 5.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{6.ordering-ui.9c913f613f7ccfd32dd9.js → 6.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js → 7.ordering-ui.5de718771fdf8a9bc402.js} +2 -2
- package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → 7.ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.9c913f613f7ccfd32dd9.js → 8.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{9.ordering-ui.9c913f613f7ccfd32dd9.js → 9.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js → ordering-ui.5de718771fdf8a9bc402.js} +2 -2
- package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt} +0 -0
- package/_modules/components/LogoutButton/index.js +9 -4
- package/_modules/components/PaymentOptions/index.js +14 -7
- package/_modules/components/SpinnerLoader/styles.js +1 -1
- package/_modules/components/UserProfileForm/index.js +15 -2
- package/_modules/components/UserProfileForm/styles.js +1 -1
- package/_modules/hooks/useRecaptcha.js +62 -0
- package/_modules/themes/five/src/components/AddressForm/styles.js +3 -3
- package/_modules/themes/five/src/components/AddressList/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +5 -5
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +12 -10
- package/_modules/themes/five/src/components/BusinessController/index.js +6 -4
- package/_modules/themes/five/src/components/BusinessController/styles.js +10 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +21 -6
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +6 -17
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +3 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -3
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessReviews/index.js +16 -8
- package/_modules/themes/five/src/components/BusinessReviews/styles.js +6 -4
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +58 -34
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -23
- package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
- package/_modules/themes/five/src/components/Footer/index.js +2 -1
- package/_modules/themes/five/src/components/Footer/styles.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +18 -11
- package/_modules/themes/five/src/components/Header/styles.js +7 -7
- package/_modules/themes/five/src/components/HomeHero/index.js +0 -15
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +116 -31
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +36 -37
- package/_modules/themes/five/src/components/LoginForm/index.js +62 -21
- package/_modules/themes/five/src/components/LoginForm/styles.js +1 -1
- package/_modules/themes/five/src/components/Messages/index.js +19 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +6 -6
- package/_modules/themes/five/src/components/MyOrders/index.js +4 -4
- package/_modules/themes/five/src/components/NavigationBar/index.js +145 -34
- package/_modules/themes/five/src/components/NavigationBar/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/index.js +46 -7
- package/_modules/themes/five/src/components/OrderDetails/styles.js +11 -3
- package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
- package/_modules/themes/five/src/components/PaymentOptions/index.js +23 -16
- package/_modules/themes/five/src/components/PaymentOptions/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +9 -7
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +10 -4
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +11 -3
- package/_modules/themes/five/src/components/ProductShare/ProductCopyURL.js +61 -0
- package/_modules/themes/five/src/components/ProductShare/index.js +107 -0
- package/_modules/themes/five/src/components/ProductShare/styles.js +40 -0
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +18 -16
- package/_modules/themes/five/src/components/ReviewProduct/index.js +5 -3
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +19 -3
- package/_modules/themes/five/src/components/SearchProducts/index.js +13 -2
- package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpForm/index.js +60 -20
- package/_modules/themes/five/src/components/SignUpForm/styles.js +2 -2
- package/_modules/themes/five/src/components/SingleProductCard/index.js +36 -2
- package/_modules/themes/five/src/components/UserProfileForm/index.js +105 -8
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +30 -17
- package/_modules/utils/index.js +26 -11
- package/index-template.js +11 -1
- package/package.json +2 -2
- package/src/components/LogoutButton/index.js +10 -8
- package/src/components/PaymentOptions/index.js +16 -11
- package/src/components/SpinnerLoader/styles.js +1 -0
- package/src/components/UserProfileForm/index.js +12 -2
- package/src/components/UserProfileForm/styles.js +1 -1
- package/src/hooks/useRecaptcha.js +40 -0
- package/src/themes/five/src/components/AddressForm/styles.js +3 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -1
- package/src/themes/five/src/components/AddressList/styles.js +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +74 -71
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +69 -20
- package/src/themes/five/src/components/BusinessController/index.js +3 -1
- package/src/themes/five/src/components/BusinessController/styles.js +8 -0
- package/src/themes/five/src/components/BusinessListingSearch/index.js +16 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +6 -18
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +2 -3
- package/src/themes/five/src/components/BusinessReviews/index.js +17 -10
- package/src/themes/five/src/components/BusinessReviews/styles.js +7 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +64 -19
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +99 -1
- package/src/themes/five/src/components/DriverTips/styles.js +1 -1
- package/src/themes/five/src/components/Footer/index.js +9 -5
- package/src/themes/five/src/components/Footer/styles.js +2 -6
- package/src/themes/five/src/components/Header/index.js +16 -8
- package/src/themes/five/src/components/Header/styles.js +49 -8
- package/src/themes/five/src/components/HomeHero/index.js +0 -6
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +163 -60
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +145 -82
- package/src/themes/five/src/components/LoginForm/index.js +30 -4
- package/src/themes/five/src/components/LoginForm/styles.js +8 -0
- package/src/themes/five/src/components/Messages/index.js +8 -2
- package/src/themes/five/src/components/MultiOrdersDetails/styles.js +34 -1
- package/src/themes/five/src/components/MyOrders/index.js +4 -4
- package/src/themes/five/src/components/NavigationBar/index.js +153 -39
- package/src/themes/five/src/components/NavigationBar/styles.js +2 -2
- package/src/themes/five/src/components/OrderDetails/index.js +45 -8
- package/src/themes/five/src/components/OrderDetails/styles.js +50 -0
- package/src/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
- package/src/themes/five/src/components/PaymentOptions/index.js +13 -7
- package/src/themes/five/src/components/PaymentOptions/styles.js +5 -0
- package/src/themes/five/src/components/ProductForm/index.js +9 -7
- package/src/themes/five/src/components/ProductItemAccordion/index.js +67 -53
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +26 -0
- package/src/themes/five/src/components/ProductShare/ProductCopyURL.js +53 -0
- package/src/themes/five/src/components/ProductShare/index.js +104 -0
- package/src/themes/five/src/components/ProductShare/styles.js +165 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +2 -8
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +5 -0
- package/src/themes/five/src/components/ReviewProduct/index.js +10 -3
- package/src/themes/five/src/components/ReviewProduct/styles.js +43 -0
- package/src/themes/five/src/components/SearchProducts/index.js +16 -3
- package/src/themes/five/src/components/SignUpApproval/index.js +8 -7
- package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +26 -2
- package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +26 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +26 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +26 -2
- package/src/themes/five/src/components/SignUpForm/index.js +26 -1
- package/src/themes/five/src/components/SignUpForm/styles.js +9 -2
- package/src/themes/five/src/components/SingleProductCard/index.js +26 -1
- package/src/themes/five/src/components/UserPopover/index.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/index.js +83 -5
- package/src/themes/five/src/components/UserProfileForm/styles.js +49 -0
- package/src/utils/index.js +36 -9
- package/template/app.js +12 -11
- package/template/assets/images/amex.svg +30 -0
- package/template/assets/images/diners.svg +16 -0
- package/template/assets/images/discover.svg +17 -0
- package/template/assets/images/jcb.svg +33 -0
- package/template/assets/images/unionpay.svg +25 -0
- package/template/components/HelmetTags/index.js +1 -1
- package/template/components/ScrollToTop/index.js +7 -5
- package/template/pages/BusinessProductsList/index.js +8 -4
- package/template/pages/MyOrders/index.js +4 -1
- package/template/pages/OrderDetails/index.js +11 -2
- package/template/pages/Profile/index.js +8 -2
|
@@ -25,7 +25,9 @@ import {
|
|
|
25
25
|
ProductSelect,
|
|
26
26
|
ProductOptionsList,
|
|
27
27
|
ProductQuantity,
|
|
28
|
-
ProductSelectWrapper
|
|
28
|
+
ProductSelectWrapper,
|
|
29
|
+
ScheduleInfoWrapper,
|
|
30
|
+
ScheduleInfo
|
|
29
31
|
} from './styles'
|
|
30
32
|
|
|
31
33
|
export const ProductItemAccordion = (props) => {
|
|
@@ -44,7 +46,7 @@ export const ProductItemAccordion = (props) => {
|
|
|
44
46
|
} = props
|
|
45
47
|
const [, t] = useLanguage()
|
|
46
48
|
const [orderState] = useOrder()
|
|
47
|
-
const [{ parsePrice }] = useUtils()
|
|
49
|
+
const [{ parsePrice, parseDate }] = useUtils()
|
|
48
50
|
const windowSize = useWindowSize()
|
|
49
51
|
const [orderingTheme] = useOrderingTheme()
|
|
50
52
|
const [setActive, setActiveState] = useState('')
|
|
@@ -122,61 +124,73 @@ export const ProductItemAccordion = (props) => {
|
|
|
122
124
|
<ProductImage bgimage={product?.images} />
|
|
123
125
|
</WrapperProductImage>
|
|
124
126
|
)}
|
|
125
|
-
{
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
onChange={(e) => handleChangeQuantity(Number(e.target.value))}
|
|
133
|
-
>
|
|
134
|
-
{[...Array(getProductMax(product) + 1)].map((v, i) => (
|
|
135
|
-
<option
|
|
136
|
-
key={i}
|
|
137
|
-
value={i}
|
|
138
|
-
disabled={offsetDisabled(product) < i && i !== 0}
|
|
139
|
-
>
|
|
140
|
-
{i === 0 ? t('REMOVE', 'Remove') : i}
|
|
141
|
-
</option>
|
|
142
|
-
))}
|
|
143
|
-
</ProductSelect>
|
|
144
|
-
</ProductSelectWrapper>
|
|
127
|
+
{product?.calendar_event ? (
|
|
128
|
+
<ScheduleInfoWrapper>
|
|
129
|
+
<h3>{product.name}</h3>
|
|
130
|
+
<ScheduleInfo>
|
|
131
|
+
<span>{parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}</span>
|
|
132
|
+
</ScheduleInfo>
|
|
133
|
+
</ScheduleInfoWrapper>
|
|
145
134
|
) : (
|
|
146
|
-
|
|
147
|
-
{
|
|
148
|
-
|
|
149
|
-
|
|
135
|
+
<>
|
|
136
|
+
{isCartProduct && !isCartPending && getProductMax ? (
|
|
137
|
+
<ProductSelectWrapper>
|
|
138
|
+
<IosArrowDown />
|
|
139
|
+
<ProductSelect
|
|
140
|
+
ref={productSelect}
|
|
141
|
+
value={product.quantity}
|
|
142
|
+
isCheckout={isCheckout}
|
|
143
|
+
onChange={(e) => handleChangeQuantity(Number(e.target.value))}
|
|
144
|
+
>
|
|
145
|
+
{[...Array(getProductMax(product) + 1)].map((v, i) => (
|
|
146
|
+
<option
|
|
147
|
+
key={i}
|
|
148
|
+
value={i}
|
|
149
|
+
disabled={offsetDisabled(product) < i && i !== 0}
|
|
150
|
+
>
|
|
151
|
+
{i === 0 ? t('REMOVE', 'Remove') : i}
|
|
152
|
+
</option>
|
|
153
|
+
))}
|
|
154
|
+
</ProductSelect>
|
|
155
|
+
</ProductSelectWrapper>
|
|
156
|
+
) : (
|
|
157
|
+
<ProductQuantity>
|
|
158
|
+
{product?.quantity}
|
|
159
|
+
</ProductQuantity>
|
|
160
|
+
)}
|
|
150
161
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
162
|
+
<ContentInfo>
|
|
163
|
+
<div>
|
|
164
|
+
<h3>{product.name}</h3>
|
|
165
|
+
{
|
|
166
|
+
product?.comment && (
|
|
167
|
+
<p>{product?.comment}</p>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
</div>
|
|
171
|
+
{windowSize.width <= 410 && (
|
|
172
|
+
<span>
|
|
173
|
+
<p>{parsePrice(product.total || product.price)}</p>
|
|
174
|
+
{isCartProduct && !isCartPending && (
|
|
175
|
+
<div>
|
|
176
|
+
{onEditProduct && (
|
|
177
|
+
<span ref={productActionsEdit}>
|
|
178
|
+
<Pencil color='#B1BCCC' onClick={() => onEditProduct(product)} />
|
|
179
|
+
</span>
|
|
180
|
+
)}
|
|
181
|
+
{onDeleteProduct && (
|
|
182
|
+
<span ref={productActionsDelete}>
|
|
183
|
+
<Trash color='#B1BCCC' onClick={() => onDeleteProduct(product)} />
|
|
184
|
+
</span>
|
|
185
|
+
)}
|
|
186
|
+
</div>
|
|
174
187
|
)}
|
|
175
|
-
</
|
|
188
|
+
</span>
|
|
176
189
|
)}
|
|
177
|
-
</
|
|
178
|
-
|
|
179
|
-
|
|
190
|
+
</ContentInfo>
|
|
191
|
+
</>
|
|
192
|
+
)}
|
|
193
|
+
|
|
180
194
|
</ProductInfo>
|
|
181
195
|
|
|
182
196
|
{(product?.valid || !isCartProduct) && windowSize.width > 410 && (
|
|
@@ -387,3 +387,29 @@ export const ProductOptionsList = styled.ul`
|
|
|
387
387
|
export const ProductQuantity = styled.span`
|
|
388
388
|
margin: 0 5px;
|
|
389
389
|
`
|
|
390
|
+
|
|
391
|
+
export const ScheduleInfoWrapper = styled.div`
|
|
392
|
+
width: calc(100% - 65px);
|
|
393
|
+
box-sizing: border-box;
|
|
394
|
+
h3 {
|
|
395
|
+
margin: 0px;
|
|
396
|
+
font-size: 14px;
|
|
397
|
+
overflow: hidden;
|
|
398
|
+
text-overflow: ellipsis;
|
|
399
|
+
white-space: nowrap;
|
|
400
|
+
}
|
|
401
|
+
padding-left: 10px;
|
|
402
|
+
${props => props.theme.rtl && css`
|
|
403
|
+
padding-left: 0px;
|
|
404
|
+
padding-right: 10px;
|
|
405
|
+
`}
|
|
406
|
+
`
|
|
407
|
+
|
|
408
|
+
export const ScheduleInfo = styled.div`
|
|
409
|
+
span {
|
|
410
|
+
font-weight: 400;
|
|
411
|
+
font-size: 12px;
|
|
412
|
+
line-height: 15px;
|
|
413
|
+
color: ${props => props.theme.colors.darkGray};
|
|
414
|
+
}
|
|
415
|
+
`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useUtils, useLanguage } from 'ordering-components-external'
|
|
3
|
+
import { useTheme } from 'styled-components'
|
|
4
|
+
import { Button } from '../../styles/Buttons'
|
|
5
|
+
import BsCheck from '@meronex/icons/bs/BsCheck'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
ProductCopyURLContainer,
|
|
9
|
+
ProductImageWrapper
|
|
10
|
+
} from './styles'
|
|
11
|
+
|
|
12
|
+
export const ProductCopyURL = (props) => {
|
|
13
|
+
const {
|
|
14
|
+
urlToShare,
|
|
15
|
+
product
|
|
16
|
+
} = props
|
|
17
|
+
|
|
18
|
+
const theme = useTheme()
|
|
19
|
+
const [, t] = useLanguage()
|
|
20
|
+
const [{ optimizeImage }] = useUtils()
|
|
21
|
+
const [copiedToClipboard, setcopiedToClipboard] = useState(false)
|
|
22
|
+
|
|
23
|
+
const handleCopyToClipboard = () => {
|
|
24
|
+
navigator.clipboard.writeText(urlToShare)
|
|
25
|
+
setcopiedToClipboard(true)
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
props.onClose && props.onClose()
|
|
28
|
+
}, 1000)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<ProductCopyURLContainer>
|
|
33
|
+
<ProductImageWrapper>
|
|
34
|
+
<img
|
|
35
|
+
src={optimizeImage(product?.images || theme.images?.dummies?.product, 'h_200,c_limit')}
|
|
36
|
+
loading='lazy'
|
|
37
|
+
alt='product image'
|
|
38
|
+
/>
|
|
39
|
+
</ProductImageWrapper>
|
|
40
|
+
<p className='name'>{product?.name}</p>
|
|
41
|
+
{product?.description && (
|
|
42
|
+
<p className='description'>{product?.description}</p>
|
|
43
|
+
)}
|
|
44
|
+
<Button
|
|
45
|
+
outline={!copiedToClipboard}
|
|
46
|
+
color='primary'
|
|
47
|
+
onClick={() => handleCopyToClipboard()}
|
|
48
|
+
>
|
|
49
|
+
{copiedToClipboard ? <BsCheck /> : t('COPY_URL', 'Copy URL')}
|
|
50
|
+
</Button>
|
|
51
|
+
</ProductCopyURLContainer>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import FiShare2 from '@meronex/icons/fi/FiShare2'
|
|
3
|
+
import { ProductShare as ProductShareController } from 'ordering-components-external'
|
|
4
|
+
import HiLink from '@meronex/icons/hi/HiLink'
|
|
5
|
+
import { Modal } from '../Modal'
|
|
6
|
+
import { ProductCopyURL } from './ProductCopyURL'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
IconShare,
|
|
10
|
+
ShareButtons,
|
|
11
|
+
CopyButton
|
|
12
|
+
} from './styles'
|
|
13
|
+
|
|
14
|
+
import { Button } from '../../styles/Buttons'
|
|
15
|
+
|
|
16
|
+
const ProductShareUI = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
updateShowValue,
|
|
19
|
+
showShareButton,
|
|
20
|
+
urlToShare,
|
|
21
|
+
btnText,
|
|
22
|
+
withBtn,
|
|
23
|
+
product
|
|
24
|
+
} = props
|
|
25
|
+
|
|
26
|
+
const iconElement = useRef()
|
|
27
|
+
const contentElement = useRef()
|
|
28
|
+
const [openCopyUrlModal, setOpenCopyUrlModal] = useState(false)
|
|
29
|
+
|
|
30
|
+
const handleClickOutside = (e) => {
|
|
31
|
+
const outsideIcon = !iconElement.current?.contains(e.target)
|
|
32
|
+
const outsideButtonsShare = !contentElement.current?.contains(e.target)
|
|
33
|
+
if (outsideIcon && outsideButtonsShare) {
|
|
34
|
+
updateShowValue && updateShowValue(false)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
window.addEventListener('mouseup', handleClickOutside)
|
|
40
|
+
return () => window.removeEventListener('mouseup', handleClickOutside)
|
|
41
|
+
}, [])
|
|
42
|
+
|
|
43
|
+
const handleClickShare = () => {
|
|
44
|
+
updateShowValue(!showShareButton)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
<IconShare ref={iconElement} name='icon-share'>
|
|
50
|
+
{withBtn ? (
|
|
51
|
+
<Button
|
|
52
|
+
outline
|
|
53
|
+
color='primary'
|
|
54
|
+
onClick={handleClickShare}
|
|
55
|
+
>
|
|
56
|
+
<FiShare2 />
|
|
57
|
+
{btnText}
|
|
58
|
+
</Button>
|
|
59
|
+
) : (
|
|
60
|
+
<FiShare2 onClick={handleClickShare} />
|
|
61
|
+
)}
|
|
62
|
+
<ShareButtons
|
|
63
|
+
ref={contentElement}
|
|
64
|
+
className='a2a_kit a2a_kit_size_32 a2a_floating_style a2a_vertical_style'
|
|
65
|
+
data-a2a-url={urlToShare}
|
|
66
|
+
showShareButton={showShareButton}
|
|
67
|
+
>
|
|
68
|
+
<CopyButton onClick={() => setOpenCopyUrlModal(true)}>
|
|
69
|
+
<span>
|
|
70
|
+
<HiLink />
|
|
71
|
+
</span>
|
|
72
|
+
</CopyButton>
|
|
73
|
+
<a className='a2a_button_facebook' />
|
|
74
|
+
<a className='a2a_button_whatsapp' />
|
|
75
|
+
<a className='a2a_button_twitter' />
|
|
76
|
+
<a className='a2a_button_email' />
|
|
77
|
+
<a className='a2a_dd' href='https://www.addtoany.com/share' />
|
|
78
|
+
</ShareButtons>
|
|
79
|
+
</IconShare>
|
|
80
|
+
|
|
81
|
+
<Modal
|
|
82
|
+
width='650px'
|
|
83
|
+
open={openCopyUrlModal}
|
|
84
|
+
onClose={() => setOpenCopyUrlModal(false)}
|
|
85
|
+
>
|
|
86
|
+
<ProductCopyURL
|
|
87
|
+
urlToShare={urlToShare}
|
|
88
|
+
product={product}
|
|
89
|
+
onClose={() => setOpenCopyUrlModal(false)}
|
|
90
|
+
/>
|
|
91
|
+
</Modal>
|
|
92
|
+
</>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const ProductShare = (props) => {
|
|
97
|
+
const productShareProps = {
|
|
98
|
+
...props,
|
|
99
|
+
UIComponent: ProductShareUI
|
|
100
|
+
}
|
|
101
|
+
return (
|
|
102
|
+
<ProductShareController {...productShareProps} />
|
|
103
|
+
)
|
|
104
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const IconShare = styled.div`
|
|
4
|
+
position: fixed;
|
|
5
|
+
margin: 0px;
|
|
6
|
+
top: 10px;
|
|
7
|
+
font-size: 22px;
|
|
8
|
+
right: 16px;
|
|
9
|
+
left: 10px;
|
|
10
|
+
z-index: 9999995;
|
|
11
|
+
background: rgba(255,255,255,0.5);
|
|
12
|
+
height: 30px;
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
width: 30px;
|
|
15
|
+
svg {
|
|
16
|
+
position: relative;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
color: #333;
|
|
19
|
+
left: 3px;
|
|
20
|
+
${props => props.theme?.rtl && css`
|
|
21
|
+
left: 0;
|
|
22
|
+
right: 5px;
|
|
23
|
+
`}
|
|
24
|
+
}
|
|
25
|
+
${props => props.theme?.rtl && css`
|
|
26
|
+
left: 16px;
|
|
27
|
+
right: 10px;
|
|
28
|
+
`}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@media(min-width: 769px){
|
|
32
|
+
position: relative;
|
|
33
|
+
left: 5px;
|
|
34
|
+
top: 0;
|
|
35
|
+
|
|
36
|
+
svg{
|
|
37
|
+
position: static;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
${props => props.theme?.rtl && css`
|
|
41
|
+
left: 0;
|
|
42
|
+
right: 5px;
|
|
43
|
+
`}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (min-width: 1201px) {
|
|
47
|
+
position: sticky;
|
|
48
|
+
width: 0;
|
|
49
|
+
|
|
50
|
+
&:nth-child(1) > svg {
|
|
51
|
+
background-color: white;
|
|
52
|
+
padding: 5px;
|
|
53
|
+
border-radius: 9px;
|
|
54
|
+
margin: 5px 0px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
${props => props.theme?.rtl && css`
|
|
58
|
+
right: 0;
|
|
59
|
+
left: initial;
|
|
60
|
+
`}
|
|
61
|
+
}
|
|
62
|
+
`
|
|
63
|
+
|
|
64
|
+
export const ShareButtons = styled.div`
|
|
65
|
+
visibility: ${({ showShareButton }) => showShareButton ? 'visible' : 'hidden'};
|
|
66
|
+
top: 28px;
|
|
67
|
+
width: 40px;
|
|
68
|
+
position: absolute !important;
|
|
69
|
+
|
|
70
|
+
${props => props.theme?.rtl ? css`
|
|
71
|
+
right: -12px;
|
|
72
|
+
` : css`
|
|
73
|
+
left: -12px;
|
|
74
|
+
`}
|
|
75
|
+
|
|
76
|
+
@media (min-width: 1201px) {
|
|
77
|
+
top: 35px;
|
|
78
|
+
left: 0px;
|
|
79
|
+
right: 0px;
|
|
80
|
+
}
|
|
81
|
+
`
|
|
82
|
+
export const CopyButton = styled.a`
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
&:hover {
|
|
87
|
+
> span {
|
|
88
|
+
opacity: 0.7;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
> span {
|
|
92
|
+
background-color: #0166ff;
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
width: 32px;
|
|
98
|
+
height: 32px;
|
|
99
|
+
|
|
100
|
+
svg {
|
|
101
|
+
font-size: 24px;
|
|
102
|
+
color: #FFF;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`
|
|
106
|
+
export const ProductCopyURLContainer = styled.div`
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
align-items: center;
|
|
110
|
+
padding-top: 30px;
|
|
111
|
+
|
|
112
|
+
p {
|
|
113
|
+
text-align: center;
|
|
114
|
+
&.name {
|
|
115
|
+
font-size: 20px;
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
line-height: 30px;
|
|
118
|
+
margin-bottom: 0;
|
|
119
|
+
margin-top: 15px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.description {
|
|
123
|
+
font-size: 14px;
|
|
124
|
+
line-height: 24px;
|
|
125
|
+
margin: 0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
button {
|
|
130
|
+
margin-top: 50px;
|
|
131
|
+
height: 44px;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
min-width: 100px;
|
|
136
|
+
|
|
137
|
+
svg {
|
|
138
|
+
font-size: 24px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@media (min-width: 768px) {
|
|
143
|
+
button {
|
|
144
|
+
width: 100%;
|
|
145
|
+
margin-top: 115px;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
`
|
|
149
|
+
export const ProductImageWrapper = styled.div`
|
|
150
|
+
width: 95px;
|
|
151
|
+
height: 95px;
|
|
152
|
+
|
|
153
|
+
img {
|
|
154
|
+
width: 100%;
|
|
155
|
+
height: 100%;
|
|
156
|
+
object-fit: contain;
|
|
157
|
+
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
|
|
158
|
+
border-radius: 8px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (min-width: 768px) {
|
|
162
|
+
width: 200px;
|
|
163
|
+
height: 200px;
|
|
164
|
+
}
|
|
165
|
+
`
|
|
@@ -243,12 +243,6 @@ export const RenderProductsLayout = (props) => {
|
|
|
243
243
|
</WrapperSearchAbsolute>
|
|
244
244
|
)}
|
|
245
245
|
</div>
|
|
246
|
-
{/* {windowSize.width < 500 && (
|
|
247
|
-
<MobileCartViewWrapper>
|
|
248
|
-
<span>{currentCart?.products?.length > 0 ? parsePrice(currentCart?.total) : parsePrice(0)}</span>
|
|
249
|
-
<Button color='primary' onClick={() => setisCartModal(true)}>{t('VIEW_CART', 'View cart')}</Button>
|
|
250
|
-
</MobileCartViewWrapper>
|
|
251
|
-
)} */}
|
|
252
246
|
<WrapContent id='businessProductList'>
|
|
253
247
|
{!business?.loading && business?.previously_products?.length > 0 && (
|
|
254
248
|
<OrderItAgain
|
|
@@ -288,7 +282,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
288
282
|
</WrapContent>
|
|
289
283
|
</BusinessCategoryProductWrapper>
|
|
290
284
|
{showCartOnProductList && (
|
|
291
|
-
<BusinessCartContainer
|
|
285
|
+
<BusinessCartContainer isProfessional={business?.professionals?.length > 0 && !useKioskApp}>
|
|
292
286
|
<BusinessCartContent maxHeight={window.innerHeight - 100}>
|
|
293
287
|
{currentCart?.products?.length > 0 ? (
|
|
294
288
|
<>
|
|
@@ -335,7 +329,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
335
329
|
</ProfessionalFilterWrapper>
|
|
336
330
|
)}
|
|
337
331
|
<BusinessContent>
|
|
338
|
-
<BusinessCategoriesContainer>
|
|
332
|
+
<BusinessCategoriesContainer offSticky>
|
|
339
333
|
{!(business?.categories?.length === 0 && !categoryId) && (
|
|
340
334
|
<BusinessLayoutCategories
|
|
341
335
|
component='categories'
|
|
@@ -62,6 +62,10 @@ export const BusinessCategoriesContainer = styled.div`
|
|
|
62
62
|
margin: 0;
|
|
63
63
|
margin-right: 10px;
|
|
64
64
|
width: 100%;
|
|
65
|
+
${(props) => !props.offSticky && css`
|
|
66
|
+
top: 65px;
|
|
67
|
+
position: sticky;
|
|
68
|
+
`}
|
|
65
69
|
@media (min-width: 993px) {
|
|
66
70
|
width: calc(31% - 25px);
|
|
67
71
|
}
|
|
@@ -71,6 +75,7 @@ export const BusinessCartContainer = styled(BusinessCategoriesContainer)`
|
|
|
71
75
|
display: none;
|
|
72
76
|
margin-top: 70px;
|
|
73
77
|
min-width: 325px;
|
|
78
|
+
height: fit-content;
|
|
74
79
|
@media (min-width: 769px) {
|
|
75
80
|
${({ isProfessional }) => isProfessional && css`
|
|
76
81
|
margin-top: 0px;
|
|
@@ -13,7 +13,9 @@ import {
|
|
|
13
13
|
AdditionCommentsWrapper,
|
|
14
14
|
AddCommentHideShow,
|
|
15
15
|
Comments,
|
|
16
|
-
CommentsList
|
|
16
|
+
CommentsList,
|
|
17
|
+
WrapperProductLogo,
|
|
18
|
+
ProductLogo,
|
|
17
19
|
} from './styles'
|
|
18
20
|
import AiOutlineLike from '@meronex/icons/ai/AiOutlineLike'
|
|
19
21
|
import AiOutlineDislike from '@meronex/icons/ai/AiOutlineDislike'
|
|
@@ -89,7 +91,12 @@ const SingleProductReview = (props) => {
|
|
|
89
91
|
|
|
90
92
|
return (
|
|
91
93
|
<SingleProductReviewContainer>
|
|
92
|
-
|
|
94
|
+
{(product?.images || theme.images?.dummies?.businessLogo) && (
|
|
95
|
+
<WrapperProductLogo>
|
|
96
|
+
<ProductLogo bgimage={product?.images || theme.images?.dummies?.businessLogo} />
|
|
97
|
+
</WrapperProductLogo>
|
|
98
|
+
)}
|
|
99
|
+
<HandReviewWrapper>
|
|
93
100
|
<p>{product?.name}</p>
|
|
94
101
|
<HandReviewContent>
|
|
95
102
|
<HandIconWrapper onClick={() => setIsLike(true)} active={isLike}>
|
|
@@ -201,7 +208,7 @@ const ReviewProductUI = (props) => {
|
|
|
201
208
|
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
202
209
|
<BeforeComponent key={i} {...props} />))}
|
|
203
210
|
<ReviewProductContainer onSubmit={handleSubmit(onSubmit)}>
|
|
204
|
-
{order?.products && order.products.length > 0 && order.products.map((product, i) => (
|
|
211
|
+
{order?.products && order.products.length > 0 && order.products.map((product, i) => !product?.deleted && (
|
|
205
212
|
<SingleProductReview
|
|
206
213
|
{...props}
|
|
207
214
|
key={i}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import styled, { css } from 'styled-components'
|
|
2
3
|
import { Button } from '../../styles/Buttons'
|
|
3
4
|
|
|
@@ -156,3 +157,45 @@ export const ButtonCustomized = styled(Button)`
|
|
|
156
157
|
color: white;
|
|
157
158
|
`}
|
|
158
159
|
`
|
|
160
|
+
export const WrapperProductLogo = styled.div`
|
|
161
|
+
width: 124px;
|
|
162
|
+
height: 124px;
|
|
163
|
+
min-height: 124px;
|
|
164
|
+
max-width: 124px;
|
|
165
|
+
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
|
|
166
|
+
border-radius: 7.6px;
|
|
167
|
+
margin: 0 auto;
|
|
168
|
+
`
|
|
169
|
+
|
|
170
|
+
const ProductLogoStyled = styled.div`
|
|
171
|
+
display: flex;
|
|
172
|
+
width: 124px;
|
|
173
|
+
height: 124px;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
position: relative;
|
|
176
|
+
background-repeat: no-repeat, repeat;
|
|
177
|
+
background-size: cover;
|
|
178
|
+
object-fit: cover;
|
|
179
|
+
background-position: center;
|
|
180
|
+
min-height: 124px;
|
|
181
|
+
border-radius: 7.6px;
|
|
182
|
+
|
|
183
|
+
@media (min-width: 481px){
|
|
184
|
+
width: 100%;
|
|
185
|
+
height: 100%;
|
|
186
|
+
min-height: 124px;
|
|
187
|
+
}
|
|
188
|
+
`
|
|
189
|
+
|
|
190
|
+
export const ProductLogo = (props) => {
|
|
191
|
+
const style = {}
|
|
192
|
+
if (props.bgimage) {
|
|
193
|
+
style.backgroundImage = `url(${props.bgimage})`
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<ProductLogoStyled {...props} style={style}>
|
|
198
|
+
{props.children}
|
|
199
|
+
</ProductLogoStyled>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react'
|
|
2
|
-
import { useLanguage, useEvent } from 'ordering-components-external'
|
|
3
|
-
// import { Input } from '../../styles/Inputs'
|
|
2
|
+
import { useLanguage, useEvent, useConfig } from 'ordering-components-external'
|
|
4
3
|
import { SearchBar } from '../SearchBar'
|
|
5
4
|
import { useTheme } from 'styled-components'
|
|
6
5
|
import { BusinessProductsList } from '../BusinessProductsList'
|
|
6
|
+
import { BusinessProductsList as ProductListLayoutGroceries } from '../BusinessProductsList/layouts/groceries'
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Container,
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
BusinessProductsListWrapper
|
|
18
18
|
} from './styles'
|
|
19
19
|
|
|
20
|
+
const layoutOne = 'groceries'
|
|
21
|
+
|
|
20
22
|
export const SearchProducts = (props) => {
|
|
21
23
|
const {
|
|
22
24
|
onClose,
|
|
@@ -30,13 +32,24 @@ export const SearchProducts = (props) => {
|
|
|
30
32
|
const theme = useTheme()
|
|
31
33
|
const [, t] = useLanguage()
|
|
32
34
|
const [events] = useEvent()
|
|
35
|
+
const [{ configs }] = useConfig()
|
|
33
36
|
const searchRef = useRef()
|
|
34
37
|
|
|
38
|
+
const isUseParentCategory = (configs?.use_parent_category?.value === 'true' || configs?.use_parent_category?.value === '1')
|
|
39
|
+
const frontLayout = business?.front_layout
|
|
40
|
+
const businessLayout = {
|
|
41
|
+
layoutOne: frontLayout === layoutOne && isUseParentCategory
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
const handleGoToPage = (data) => {
|
|
36
45
|
events.emit('go_to_page', data)
|
|
37
46
|
document.body.style.overflowY = 'auto'
|
|
38
47
|
}
|
|
39
48
|
|
|
49
|
+
const BusinessLayoutProductsList = businessLayout.layoutOne
|
|
50
|
+
? ProductListLayoutGroceries
|
|
51
|
+
: BusinessProductsList
|
|
52
|
+
|
|
40
53
|
useEffect(() => {
|
|
41
54
|
searchRef?.current?.focus && searchRef.current.focus()
|
|
42
55
|
}, [searchRef?.current])
|
|
@@ -70,7 +83,7 @@ export const SearchProducts = (props) => {
|
|
|
70
83
|
{searchValue && (
|
|
71
84
|
<BusinessProductsListContainer>
|
|
72
85
|
<BusinessProductsListWrapper>
|
|
73
|
-
<
|
|
86
|
+
<BusinessLayoutProductsList
|
|
74
87
|
{...props}
|
|
75
88
|
categories={[
|
|
76
89
|
{ id: null, name: t('ALL', theme?.defaultLanguages?.ALL || 'All') },
|