ordering-ui-external 1.4.4 → 1.5.0
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.a7a2180d81ab27bb0e20.js → 0.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{1.ordering-ui.a7a2180d81ab27bb0e20.js → 1.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{2.ordering-ui.a7a2180d81ab27bb0e20.js → 2.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{4.ordering-ui.a7a2180d81ab27bb0e20.js → 4.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{5.ordering-ui.a7a2180d81ab27bb0e20.js → 5.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{6.ordering-ui.a7a2180d81ab27bb0e20.js → 6.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{7.ordering-ui.a7a2180d81ab27bb0e20.js → 7.ordering-ui.b1e32f04828ea3f944e1.js} +2 -2
- package/_bundles/{7.ordering-ui.a7a2180d81ab27bb0e20.js.LICENSE.txt → 7.ordering-ui.b1e32f04828ea3f944e1.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a7a2180d81ab27bb0e20.js → 8.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/{9.ordering-ui.a7a2180d81ab27bb0e20.js → 9.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
- package/_bundles/ordering-ui.b1e32f04828ea3f944e1.js +2 -0
- package/_bundles/{ordering-ui.a7a2180d81ab27bb0e20.js.LICENSE.txt → ordering-ui.b1e32f04828ea3f944e1.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/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/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
- package/_bundles/ordering-ui.a7a2180d81ab27bb0e20.js +0 -2
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useOrderingTheme
|
|
10
10
|
} from 'ordering-components-external'
|
|
11
11
|
|
|
12
|
+
import { useWindowSize } from '../../hooks/useWindowSize'
|
|
12
13
|
import { UserFormDetailsUI } from '../UserFormDetails'
|
|
13
14
|
import { UserFormDetailsUI as UserFormDetailsFiveUI } from '../../themes/five/src/components/UserFormDetails'
|
|
14
15
|
import { AddressList } from '../AddressList'
|
|
@@ -35,6 +36,7 @@ import {
|
|
|
35
36
|
SkeletonWrapper,
|
|
36
37
|
WrapperForm
|
|
37
38
|
} from './styles'
|
|
39
|
+
import { LogoutButton } from '../LogoutButton'
|
|
38
40
|
|
|
39
41
|
const UserProfileFormUI = (props) => {
|
|
40
42
|
const {
|
|
@@ -53,6 +55,7 @@ const UserProfileFormUI = (props) => {
|
|
|
53
55
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
54
56
|
const inputRef = useRef(null)
|
|
55
57
|
const [orderingTheme] = useOrderingTheme()
|
|
58
|
+
const windowSize = useWindowSize()
|
|
56
59
|
|
|
57
60
|
const showCustomerPicture = !orderingTheme?.theme?.profile?.components?.picture?.hidden
|
|
58
61
|
const showCustomerName = !orderingTheme?.theme?.profile?.components?.name?.hidden
|
|
@@ -119,7 +122,7 @@ const UserProfileFormUI = (props) => {
|
|
|
119
122
|
</React.Fragment>))}
|
|
120
123
|
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
121
124
|
<BeforeComponent key={i} {...props} />))}
|
|
122
|
-
{!isHiddenAddress && (
|
|
125
|
+
{!isHiddenAddress && !props.hideOptions && (
|
|
123
126
|
<ProfileOptions value='account' />
|
|
124
127
|
)}
|
|
125
128
|
<Container>
|
|
@@ -141,7 +144,7 @@ const UserProfileFormUI = (props) => {
|
|
|
141
144
|
</UploadImageIcon>
|
|
142
145
|
)
|
|
143
146
|
: formState?.changes?.photo && formState.result.error &&
|
|
144
|
-
|
|
147
|
+
<img src={formState?.changes?.photo} alt='user image' loading='lazy' />
|
|
145
148
|
)}
|
|
146
149
|
</DragAndDrop>
|
|
147
150
|
</ExamineClick>
|
|
@@ -177,6 +180,13 @@ const UserProfileFormUI = (props) => {
|
|
|
177
180
|
{t('EDIT', 'Edit')}
|
|
178
181
|
</Button>
|
|
179
182
|
)}
|
|
183
|
+
{windowSize.width <= 576 && props.showLogout && (
|
|
184
|
+
<LogoutButton
|
|
185
|
+
hideText
|
|
186
|
+
styleContainer={{ margin: 'auto', width: 24 }}
|
|
187
|
+
styleWrappContent={{ paddingRight: 0, paddingLeft: 0 }}
|
|
188
|
+
/>
|
|
189
|
+
)}
|
|
180
190
|
</UserData>
|
|
181
191
|
)
|
|
182
192
|
) : (
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { useConfig, useLanguage, useToast, ToastType } from 'ordering-components-external'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook to mangage Recaptcha version
|
|
6
|
+
* @param {boolean} enableRecaptcha
|
|
7
|
+
*/
|
|
8
|
+
export const useRecaptcha = (enableRecaptcha) => {
|
|
9
|
+
const [{ configs }] = useConfig()
|
|
10
|
+
const [reCaptchaConfig, setRecaptchaConfig] = useState({ version: 'v3', siteKey: '' })
|
|
11
|
+
const [, { showToast }] = useToast()
|
|
12
|
+
const [, t] = useLanguage()
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (configs && Object.keys(configs).length > 0 && enableRecaptcha && reCaptchaConfig?.siteKey === '') {
|
|
16
|
+
if (configs?.security_recaptcha_type?.value === 'v3' &&
|
|
17
|
+
configs?.security_recaptcha_score_v3?.value > 0 &&
|
|
18
|
+
configs?.security_recaptcha_site_key_v3?.value
|
|
19
|
+
) {
|
|
20
|
+
setRecaptchaConfig({
|
|
21
|
+
version: 'v3',
|
|
22
|
+
siteKey: configs?.security_recaptcha_site_key_v3?.value,
|
|
23
|
+
error: false
|
|
24
|
+
})
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
if (configs?.security_recaptcha_site_key?.value) {
|
|
28
|
+
setRecaptchaConfig({
|
|
29
|
+
version: 'v2',
|
|
30
|
+
siteKey: configs?.security_recaptcha_site_key?.value,
|
|
31
|
+
error: false
|
|
32
|
+
})
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
showToast(ToastType.Error, t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key'))
|
|
36
|
+
}
|
|
37
|
+
}, [configs, enableRecaptcha])
|
|
38
|
+
|
|
39
|
+
return [reCaptchaConfig]
|
|
40
|
+
}
|
|
@@ -26,7 +26,7 @@ export const FormControl = styled.form`
|
|
|
26
26
|
input {
|
|
27
27
|
box-sizing: border-box;
|
|
28
28
|
margin: 10px 0px;
|
|
29
|
-
height:
|
|
29
|
+
height: 50px;
|
|
30
30
|
width: 100%;
|
|
31
31
|
&.internal_number,
|
|
32
32
|
&.zipcode {
|
|
@@ -106,6 +106,7 @@ export const AddressWrap = styled.div`
|
|
|
106
106
|
justify-content: space-between;
|
|
107
107
|
align-items: center;
|
|
108
108
|
position: relative;
|
|
109
|
+
margin-top: -11px;
|
|
109
110
|
|
|
110
111
|
button {
|
|
111
112
|
height: 41px;
|
|
@@ -204,7 +205,7 @@ export const WrapperMap = styled.div`
|
|
|
204
205
|
export const WrapperSkeleton = styled.div`
|
|
205
206
|
display: flex;
|
|
206
207
|
flex-direction: column;
|
|
207
|
-
padding: 10px;
|
|
208
|
+
padding: 9px 10px;
|
|
208
209
|
|
|
209
210
|
span {
|
|
210
211
|
width: 100%;
|
|
@@ -79,7 +79,7 @@ const AddressListUI = (props) => {
|
|
|
79
79
|
const { width } = useWindowSize()
|
|
80
80
|
const isCompletedLayout = width < 769 || isProfile
|
|
81
81
|
const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
|
|
82
|
-
(address, i, self) =>
|
|
82
|
+
(address, i, self) => address.address &&
|
|
83
83
|
i === self.findIndex(obj => (
|
|
84
84
|
address.address === obj.address &&
|
|
85
85
|
address.address_notes === obj.address_notes &&
|
|
@@ -33,7 +33,8 @@ import {
|
|
|
33
33
|
SearchIconWrapper,
|
|
34
34
|
SearchComponentContainer,
|
|
35
35
|
SocialList,
|
|
36
|
-
IconWrapper
|
|
36
|
+
IconWrapper,
|
|
37
|
+
BusinessInfoWrapper
|
|
37
38
|
} from './styles'
|
|
38
39
|
import { BusinessPreorder } from '../BusinessPreorder'
|
|
39
40
|
|
|
@@ -377,81 +378,83 @@ export const BusinessBasicInformation = (props) => {
|
|
|
377
378
|
business={businessState.business}
|
|
378
379
|
/>
|
|
379
380
|
)}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
)}
|
|
383
|
-
<BusinessContainer bgimage={business?.header} isSkeleton={isSkeleton} id='container' isClosed={!business?.open}>
|
|
384
|
-
{(!loading && !business?.open) && <h1>{t('CLOSED', 'Closed')}</h1>}
|
|
385
|
-
{showLogo && (
|
|
386
|
-
<BusinessContent>
|
|
387
|
-
<WrapperBusinessLogo>
|
|
388
|
-
{!loading ? (
|
|
389
|
-
<BusinessLogo bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_200,c_limit')} />
|
|
390
|
-
) : (
|
|
391
|
-
<Skeleton height={70} width={70} />
|
|
392
|
-
)}
|
|
393
|
-
</WrapperBusinessLogo>
|
|
394
|
-
</BusinessContent>
|
|
395
|
-
)}
|
|
396
|
-
{isInfoShrunken && (
|
|
381
|
+
<BusinessInfoWrapper>
|
|
382
|
+
{!isInfoShrunken && (
|
|
397
383
|
<BusinessInfoComponent />
|
|
398
384
|
)}
|
|
399
|
-
{
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
385
|
+
<BusinessContainer bgimage={business?.header || theme?.images?.dummies?.businessHeader} isSkeleton={isSkeleton} id='container' isClosed={!business?.open}>
|
|
386
|
+
{(!loading && !business?.open) && <h1>{t('CLOSED', 'Closed')}</h1>}
|
|
387
|
+
{showLogo && (
|
|
388
|
+
<BusinessContent>
|
|
389
|
+
<WrapperBusinessLogo>
|
|
390
|
+
{!loading ? (
|
|
391
|
+
<BusinessLogo bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_200,c_limit')} />
|
|
392
|
+
) : (
|
|
393
|
+
<Skeleton height={70} width={70} />
|
|
394
|
+
)}
|
|
395
|
+
</WrapperBusinessLogo>
|
|
396
|
+
</BusinessContent>
|
|
397
|
+
)}
|
|
398
|
+
{isInfoShrunken && (
|
|
399
|
+
<BusinessInfoComponent />
|
|
400
|
+
)}
|
|
401
|
+
{!loading && (
|
|
402
|
+
<>
|
|
403
|
+
{isInfoShrunken && (
|
|
404
|
+
<SearchComponentContainer>
|
|
405
|
+
<SearchComponent />
|
|
406
|
+
</SearchComponentContainer>
|
|
407
|
+
)}
|
|
408
|
+
<BusinessMoreDetail>
|
|
409
|
+
<BsInfoCircle onClick={() => setOpenBusinessInformation(true)} />
|
|
410
|
+
</BusinessMoreDetail>
|
|
411
|
+
</>
|
|
412
|
+
)}
|
|
413
|
+
<Modal
|
|
414
|
+
width='70%'
|
|
415
|
+
open={openBusinessInformation}
|
|
423
416
|
onClose={setOpenBusinessInformation}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
onClose={() => setIsBusinessReviews(false)}
|
|
430
|
-
padding='20px'
|
|
431
|
-
>
|
|
432
|
-
<BusinessReviews
|
|
433
|
-
businessId={business.id}
|
|
434
|
-
reviews={business.reviews?.reviews}
|
|
435
|
-
businessName={business.name}
|
|
436
|
-
stars={business.reviews?.total}
|
|
437
|
-
/>
|
|
438
|
-
</Modal>
|
|
439
|
-
<Modal
|
|
440
|
-
open={isPreOrder}
|
|
441
|
-
width={isCustomerMode ? '700px' : '760px'}
|
|
442
|
-
onClose={() => setIsPreOrder(false)}
|
|
443
|
-
padding={isCustomerMode && '20px'}
|
|
444
|
-
>
|
|
445
|
-
{isCustomerMode ? (
|
|
446
|
-
<MomentContent onClose={() => setIsPreOrder(false)} />
|
|
447
|
-
) : (
|
|
448
|
-
<BusinessPreorder
|
|
417
|
+
padding='0'
|
|
418
|
+
hideCloseDefault
|
|
419
|
+
isTransparent
|
|
420
|
+
>
|
|
421
|
+
<BusinessInformation
|
|
449
422
|
business={business}
|
|
450
|
-
|
|
423
|
+
getBusinessType={getBusinessType}
|
|
424
|
+
optimizeImage={optimizeImage}
|
|
425
|
+
onClose={setOpenBusinessInformation}
|
|
451
426
|
/>
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
427
|
+
</Modal>
|
|
428
|
+
<Modal
|
|
429
|
+
width='70%'
|
|
430
|
+
open={isBusinessReviews}
|
|
431
|
+
onClose={() => setIsBusinessReviews(false)}
|
|
432
|
+
padding='20px'
|
|
433
|
+
>
|
|
434
|
+
<BusinessReviews
|
|
435
|
+
businessId={business.id}
|
|
436
|
+
reviews={business.reviews?.reviews}
|
|
437
|
+
businessName={business.name}
|
|
438
|
+
stars={business.reviews?.total}
|
|
439
|
+
/>
|
|
440
|
+
</Modal>
|
|
441
|
+
<Modal
|
|
442
|
+
open={isPreOrder}
|
|
443
|
+
width={isCustomerMode ? '700px' : '760px'}
|
|
444
|
+
onClose={() => setIsPreOrder(false)}
|
|
445
|
+
padding={isCustomerMode && '20px'}
|
|
446
|
+
>
|
|
447
|
+
{isCustomerMode ? (
|
|
448
|
+
<MomentContent onClose={() => setIsPreOrder(false)} />
|
|
449
|
+
) : (
|
|
450
|
+
<BusinessPreorder
|
|
451
|
+
business={business}
|
|
452
|
+
handleClick={() => setIsPreOrder(false)}
|
|
453
|
+
/>
|
|
454
|
+
)}
|
|
455
|
+
</Modal>
|
|
456
|
+
</BusinessContainer>
|
|
457
|
+
</BusinessInfoWrapper>
|
|
455
458
|
{props.afterComponents?.map((AfterComponent, i) => (
|
|
456
459
|
<AfterComponent key={i} {...props} />))}
|
|
457
460
|
{props.afterElements?.map((AfterElement, i) => (
|
|
@@ -14,9 +14,8 @@ export const BusinessContainer = styled.div`
|
|
|
14
14
|
object-fit: cover;
|
|
15
15
|
background-position: center;
|
|
16
16
|
min-height: 200px;
|
|
17
|
-
justify-content:
|
|
17
|
+
justify-content: start;
|
|
18
18
|
align-items: flex-end;
|
|
19
|
-
border-radius: 7.6px;
|
|
20
19
|
|
|
21
20
|
${props => props.isSkeleton && css`
|
|
22
21
|
background-color: #cccccc;
|
|
@@ -40,27 +39,45 @@ export const BusinessContainer = styled.div`
|
|
|
40
39
|
padding: 0;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
@media (min-width:
|
|
44
|
-
|
|
42
|
+
@media (min-width: 576px) {
|
|
43
|
+
border-radius: 7.6px;
|
|
45
44
|
}
|
|
45
|
+
|
|
46
|
+
|
|
46
47
|
`
|
|
47
48
|
|
|
48
49
|
export const BusinessContent = styled.div`
|
|
49
|
-
|
|
50
|
-
margin:
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
margin: 0;
|
|
51
|
+
margin-left: 35px;
|
|
52
|
+
margin-bottom: -35px;
|
|
53
|
+
max-height: 80px;
|
|
54
|
+
width: 80px;
|
|
55
|
+
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
|
|
56
|
+
|
|
57
|
+
@media (min-width: 576px) {
|
|
58
|
+
border-radius: 10px;
|
|
59
|
+
margin: 10px;
|
|
60
|
+
max-height: 124px;
|
|
61
|
+
width: 124px;
|
|
62
|
+
}
|
|
53
63
|
|
|
54
|
-
@media (min-width:
|
|
64
|
+
@media (min-width: 768px) {
|
|
55
65
|
margin: 25px;
|
|
56
66
|
}
|
|
57
67
|
`
|
|
58
68
|
|
|
59
69
|
export const WrapperBusinessLogo = styled.div`
|
|
60
|
-
max-width:
|
|
61
|
-
max-height:
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
max-width: 80px;
|
|
71
|
+
max-height: 80px;
|
|
72
|
+
width: 80px;
|
|
73
|
+
height: 80px;
|
|
74
|
+
|
|
75
|
+
@media (min-width: 576px) {
|
|
76
|
+
max-width: 124px;
|
|
77
|
+
max-height: 124px;
|
|
78
|
+
height: 124px;
|
|
79
|
+
width: 124px;
|
|
80
|
+
}
|
|
64
81
|
`
|
|
65
82
|
|
|
66
83
|
const BusinessLogoStyled = styled.div`
|
|
@@ -73,8 +90,11 @@ const BusinessLogoStyled = styled.div`
|
|
|
73
90
|
background-size: cover;
|
|
74
91
|
object-fit: cover;
|
|
75
92
|
background-position: center;
|
|
76
|
-
min-height:
|
|
93
|
+
min-height: 80px;
|
|
77
94
|
border-radius: 7.6px;
|
|
95
|
+
@media (min-width: 576px) {
|
|
96
|
+
min-height: 124px;
|
|
97
|
+
}
|
|
78
98
|
`
|
|
79
99
|
export const BusinessLogo = (props) => {
|
|
80
100
|
const style = {}
|
|
@@ -141,18 +161,31 @@ export const BusinessInfoItem = styled.div`
|
|
|
141
161
|
`
|
|
142
162
|
|
|
143
163
|
export const BusinessInfoContainer = styled.div`
|
|
144
|
-
padding:
|
|
145
|
-
|
|
164
|
+
padding-top: 40px;
|
|
165
|
+
padding-left: 5px;
|
|
166
|
+
padding-right: 5px;
|
|
146
167
|
display: flex;
|
|
147
168
|
justify-content: space-between;
|
|
148
169
|
flex-direction: column;
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
align-items: flex-end;
|
|
172
|
+
|
|
173
|
+
@media (min-width: 576px) {
|
|
174
|
+
padding-top: 0px;
|
|
175
|
+
padding-left: 0px;
|
|
176
|
+
padding-right: 0px;
|
|
177
|
+
margin-top: 10px;
|
|
178
|
+
}
|
|
149
179
|
|
|
150
|
-
@media (min-width:
|
|
180
|
+
@media (min-width: 768px) {
|
|
151
181
|
flex-direction: row;
|
|
182
|
+
margin-bottom: 25px;
|
|
152
183
|
}
|
|
153
184
|
`
|
|
154
185
|
|
|
155
|
-
export const BusinessInfoContent = styled.div
|
|
186
|
+
export const BusinessInfoContent = styled.div`
|
|
187
|
+
width: 100%;
|
|
188
|
+
`
|
|
156
189
|
|
|
157
190
|
export const WrapperSearch = styled.div`
|
|
158
191
|
margin: 15px 0px 0px;
|
|
@@ -296,9 +329,17 @@ export const TitleWrapper = styled.div`
|
|
|
296
329
|
flex-wrap: wrap;
|
|
297
330
|
|
|
298
331
|
h2 {
|
|
299
|
-
font-
|
|
300
|
-
|
|
332
|
+
font-size: 24px;
|
|
333
|
+
line-height: 36px;
|
|
301
334
|
margin: 0 0 10px 0;
|
|
335
|
+
font-weight: 600;
|
|
336
|
+
width: 100%;
|
|
337
|
+
overflow: hidden;
|
|
338
|
+
white-space: nowrap;
|
|
339
|
+
text-overflow: ellipsis;
|
|
340
|
+
@media (min-width: 768px) {
|
|
341
|
+
font-size: 32px;
|
|
342
|
+
}
|
|
302
343
|
}
|
|
303
344
|
`
|
|
304
345
|
|
|
@@ -404,3 +445,11 @@ export const IconWrapper = styled.a`
|
|
|
404
445
|
}
|
|
405
446
|
}
|
|
406
447
|
`
|
|
448
|
+
|
|
449
|
+
export const BusinessInfoWrapper = styled.div`
|
|
450
|
+
display: flex;
|
|
451
|
+
flex-direction: column-reverse;
|
|
452
|
+
@media (min-width: 768px) {
|
|
453
|
+
flex-direction: column;
|
|
454
|
+
}
|
|
455
|
+
`
|
|
@@ -8,7 +8,7 @@ import { Modal } from '../Modal'
|
|
|
8
8
|
import { LoginForm } from '../LoginForm'
|
|
9
9
|
import { SignUpForm } from '../SignUpForm'
|
|
10
10
|
import { ForgotPasswordForm } from '../ForgotPasswordForm'
|
|
11
|
-
import { convertHoursToMinutes, shape } from '../../../../../utils'
|
|
11
|
+
import { convertHoursToMinutes, LightenDarkenColor, shape } from '../../../../../utils'
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
ContainerCard,
|
|
@@ -145,6 +145,8 @@ const BusinessControllerUI = (props) => {
|
|
|
145
145
|
{business?.ribbon?.enabled && (
|
|
146
146
|
<RibbonBox
|
|
147
147
|
bgColor={business?.ribbon?.color}
|
|
148
|
+
colorText={LightenDarkenColor(business?.ribbon?.color, -200)}
|
|
149
|
+
borderRibbon={LightenDarkenColor(business?.ribbon?.color, -200)}
|
|
148
150
|
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
149
151
|
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
150
152
|
>
|
|
@@ -449,6 +449,14 @@ export const RibbonBox = styled.div`
|
|
|
449
449
|
${({ isCapsule }) => isCapsule && css`
|
|
450
450
|
border-radius: 50px;
|
|
451
451
|
`}
|
|
452
|
+
|
|
453
|
+
${({ colorText }) => colorText && css`
|
|
454
|
+
color: ${colorText};
|
|
455
|
+
`}
|
|
456
|
+
|
|
457
|
+
${({ borderRibbon }) => borderRibbon && css`
|
|
458
|
+
border: 1px solid ${borderRibbon};
|
|
459
|
+
`}
|
|
452
460
|
`
|
|
453
461
|
|
|
454
462
|
export const FavoriteWrapper = styled.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
BusinessListingSearchContainer,
|
|
4
4
|
FiltersContainer,
|
|
@@ -55,6 +55,8 @@ import { Modal } from '../Modal'
|
|
|
55
55
|
import { ProductForm } from '../ProductForm'
|
|
56
56
|
import { MaxSectionItem } from './MaxSectionItem'
|
|
57
57
|
|
|
58
|
+
const PIXELS_TO_SCROLL = 300
|
|
59
|
+
|
|
58
60
|
export const BusinessListingSearchUI = (props) => {
|
|
59
61
|
const {
|
|
60
62
|
businessesSearchList,
|
|
@@ -99,6 +101,14 @@ export const BusinessListingSearchUI = (props) => {
|
|
|
99
101
|
|
|
100
102
|
const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
|
|
101
103
|
|
|
104
|
+
const handleScroll = useCallback(() => {
|
|
105
|
+
const innerHeightScrolltop = window.innerHeight + document.documentElement?.scrollTop + PIXELS_TO_SCROLL
|
|
106
|
+
const badScrollPosition = innerHeightScrolltop < document.documentElement?.offsetHeight
|
|
107
|
+
const hasMore = !(paginationProps?.totalPages === paginationProps?.currentPage)
|
|
108
|
+
if (badScrollPosition || businessesSearchList?.loading || businessesSearchList.error?.length > 0 || !hasMore) return
|
|
109
|
+
handleSearchbusinessAndProducts()
|
|
110
|
+
}, [businessesSearchList.loading, paginationProps])
|
|
111
|
+
|
|
102
112
|
const handleChangeBrandFilter = (brandId) => {
|
|
103
113
|
let franchiseIds = [...filters?.franchise_ids]
|
|
104
114
|
if (filters?.franchise_ids?.includes(brandId)) franchiseIds = filters?.franchise_ids?.filter(item => item !== brandId)
|
|
@@ -124,6 +134,11 @@ export const BusinessListingSearchUI = (props) => {
|
|
|
124
134
|
setCurProduct({ business: null, product: null })
|
|
125
135
|
}
|
|
126
136
|
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
window.addEventListener('scroll', handleScroll)
|
|
139
|
+
return () => window.removeEventListener('scroll', handleScroll)
|
|
140
|
+
}, [handleScroll])
|
|
141
|
+
|
|
127
142
|
return (
|
|
128
143
|
<BusinessListingSearchContainer>
|
|
129
144
|
<BusinessesTitle>
|
|
@@ -100,7 +100,6 @@ const BusinessProductsCategoriesUI = (props) => {
|
|
|
100
100
|
})
|
|
101
101
|
|
|
102
102
|
const navbar = document.getElementById('category-lists')
|
|
103
|
-
const cart = document.getElementById('BusinessCartContainer')
|
|
104
103
|
const search = document.getElementById('WrapperSearchAbsolute')
|
|
105
104
|
const wrapperCategories = document.getElementById('wrapper-categories')
|
|
106
105
|
const limit = window.pageYOffset >= wrapperCategories?.offsetTop && window.pageYOffset > 0
|
|
@@ -109,12 +108,10 @@ const BusinessProductsCategoriesUI = (props) => {
|
|
|
109
108
|
const classAdded = navbar.classList.contains('sticky-prod-cat')
|
|
110
109
|
if (!classAdded) {
|
|
111
110
|
navbar && navbar.classList.add('sticky-prod-cat')
|
|
112
|
-
cart && cart.classList.add('sticky-prod-cart')
|
|
113
111
|
search && search.classList.add('sticky-search')
|
|
114
112
|
}
|
|
115
113
|
} else {
|
|
116
114
|
navbar && navbar.classList.remove('sticky-prod-cat')
|
|
117
|
-
cart && cart.classList.remove('sticky-prod-cart')
|
|
118
115
|
search && search.classList.remove('sticky-search')
|
|
119
116
|
}
|
|
120
117
|
}
|
|
@@ -131,26 +128,17 @@ const BusinessProductsCategoriesUI = (props) => {
|
|
|
131
128
|
style0 += `width: calc(100% - ${useKioskApp ? '50px' : '155px'}) !important;`
|
|
132
129
|
style0 += '}'
|
|
133
130
|
|
|
134
|
-
let style1 = '.sticky-
|
|
131
|
+
let style1 = '.sticky-search {'
|
|
135
132
|
style1 += 'position: fixed !important;'
|
|
136
|
-
style1 += 'top:
|
|
137
|
-
style1 += 'right:
|
|
138
|
-
style1 += '
|
|
139
|
-
style1 += '
|
|
133
|
+
style1 += 'top: 0px !important;'
|
|
134
|
+
style1 += 'right: 0% !important;'
|
|
135
|
+
style1 += 'z-index: 9999 !important;'
|
|
136
|
+
style1 += 'width: 50px !important;'
|
|
137
|
+
style1 += `background-color: ${theme.colors.backgroundPage} !important;`
|
|
140
138
|
style1 += '}'
|
|
141
139
|
|
|
142
|
-
let style2 = '.sticky-search {'
|
|
143
|
-
style2 += 'position: fixed !important;'
|
|
144
|
-
style2 += 'top: 0px !important;'
|
|
145
|
-
style2 += 'right: 0% !important;'
|
|
146
|
-
style2 += 'z-index: 9999 !important;'
|
|
147
|
-
style2 += 'width: 50px !important;'
|
|
148
|
-
style2 += `background-color: ${theme.colors.backgroundPage} !important;`
|
|
149
|
-
style2 += '}'
|
|
150
|
-
|
|
151
140
|
styleSheet.insertRule(style0, 0)
|
|
152
141
|
styleSheet.insertRule(style1, 1)
|
|
153
|
-
styleSheet.insertRule(style2, 2)
|
|
154
142
|
|
|
155
143
|
window.addEventListener('scroll', handleScroll)
|
|
156
144
|
return () => window.removeEventListener('scroll', handleScroll)
|
|
@@ -430,6 +430,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
430
430
|
professionalList={business?.professionals}
|
|
431
431
|
professionalSelected={professionalSelected}
|
|
432
432
|
handleChangeProfessional={handleChangeProfessionalSelected}
|
|
433
|
+
productAddedToCartLength={currentCart?.products?.reduce((productsLength, Cproduct) => { return productsLength + (Cproduct?.id === (productModal.product || curProduct)?.id ? Cproduct?.quantity : 0) }, 0) || 0}
|
|
433
434
|
/>
|
|
434
435
|
) : (
|
|
435
436
|
<ProductForm
|
|
@@ -438,6 +439,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
438
439
|
product={productModal.product || curProduct}
|
|
439
440
|
businessId={business?.id}
|
|
440
441
|
onSave={handlerProductAction}
|
|
442
|
+
productAddedToCartLength={currentCart?.products?.reduce((productsLength, Cproduct) => { return productsLength + (Cproduct?.id === (productModal.product || curProduct)?.id ? Cproduct?.quantity : 0) }, 0) || 0}
|
|
441
443
|
/>
|
|
442
444
|
)}
|
|
443
445
|
</>
|
|
@@ -3,7 +3,6 @@ import styled, { css } from 'styled-components'
|
|
|
3
3
|
export const ProductsContainer = styled.div`
|
|
4
4
|
width: 95%;
|
|
5
5
|
margin: 20px auto 0px;
|
|
6
|
-
overflow-x: hidden;
|
|
7
6
|
> svg {
|
|
8
7
|
color: ${props => props.theme.colors.headingColor};
|
|
9
8
|
font-size: 24px;
|
|
@@ -32,12 +31,12 @@ export const MobileCartViewWrapper = styled.div`
|
|
|
32
31
|
left: 0;
|
|
33
32
|
bottom: 0;
|
|
34
33
|
background-color: white;
|
|
35
|
-
padding:
|
|
34
|
+
padding: 15px 25px;
|
|
36
35
|
display: flex;
|
|
37
36
|
align-items: center;
|
|
38
37
|
justify-content: space-between;
|
|
39
38
|
box-sizing: border-box;
|
|
40
|
-
z-index:
|
|
39
|
+
z-index: 1006;
|
|
41
40
|
box-shadow: 0px 4px 10px rgb(0 0 0 / 12%);
|
|
42
41
|
|
|
43
42
|
span {
|