ordering-ui-external 2.1.4 → 2.2.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.95882a524750766186cd.js +1 -0
- package/_bundles/{1.ordering-ui.28ae84b35994ed466773.js → 1.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{2.ordering-ui.28ae84b35994ed466773.js → 2.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/4.ordering-ui.95882a524750766186cd.js +1 -0
- package/_bundles/{5.ordering-ui.28ae84b35994ed466773.js → 5.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{6.ordering-ui.28ae84b35994ed466773.js → 6.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{7.ordering-ui.28ae84b35994ed466773.js → 7.ordering-ui.95882a524750766186cd.js} +2 -2
- package/_bundles/{7.ordering-ui.28ae84b35994ed466773.js.LICENSE.txt → 7.ordering-ui.95882a524750766186cd.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.28ae84b35994ed466773.js → 8.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{9.ordering-ui.28ae84b35994ed466773.js → 9.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{ordering-ui.28ae84b35994ed466773.js → ordering-ui.95882a524750766186cd.js} +2 -2
- package/_bundles/{ordering-ui.28ae84b35994ed466773.js.LICENSE.txt → ordering-ui.95882a524750766186cd.js.LICENSE.txt} +0 -0
- package/_modules/hooks/useIntersectionObserver.js +6 -5
- package/_modules/styles/Toast/index.js +4 -3
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +1 -1
- package/_modules/themes/five/src/components/AddressDetails/index.js +1 -1
- package/_modules/themes/five/src/components/AddressDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessListingSearch/Accordion/index.js +43 -0
- package/_modules/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +16 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +26 -13
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +43 -41
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +23 -4
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +38 -22
- package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +23 -17
- package/_modules/themes/five/src/components/Cart/index.js +2 -1
- package/_modules/themes/five/src/components/Cart/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +23 -18
- package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
- package/_modules/themes/five/src/components/DriverTips/index.js +6 -2
- package/_modules/themes/five/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/Help/index.js +1 -1
- package/_modules/themes/five/src/components/LastOrders/index.js +3 -8
- package/_modules/themes/five/src/components/MessagesListing/index.js +2 -2
- package/_modules/themes/five/src/components/MessagesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/index.js +20 -8
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +15 -13
- package/_modules/themes/five/src/components/MyOrders/index.js +1 -3
- package/_modules/themes/five/src/components/NotFoundSource/index.js +3 -11
- package/_modules/themes/five/src/components/NotFoundSource/styles.js +2 -2
- package/_modules/themes/five/src/components/OrderContextUI/index.js +2 -1
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +14 -11
- package/_modules/themes/five/src/components/OrderProgress/index.js +4 -3
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/PaymentOptions/index.js +1 -1
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +1 -1
- package/_modules/themes/five/src/components/ServiceForm/index.js +16 -11
- package/_modules/themes/five/src/components/ServiceForm/styles.js +16 -5
- package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserPopover/index.js +6 -0
- package/_modules/themes/five/src/components/UserProfileForm/index.js +0 -2
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +1 -1
- package/_modules/themes/five/src/components/WalletTransactionItem/index.js +4 -2
- package/_modules/themes/five/src/components/Wallets/index.js +4 -4
- package/_modules/themes/five/src/components/Wallets/styles.js +33 -12
- package/_modules/themes/five/src/styles/Buttons/index.js +3 -1
- package/_modules/themes/pwa/src/components/MomentControl/index.js +7 -9
- package/_modules/utils/index.js +28 -2
- package/package.json +2 -2
- package/src/hooks/useIntersectionObserver.js +7 -6
- package/src/styles/Toast/index.js +4 -2
- package/src/themes/callcenterOriginal/src/components/Header/index.js +1 -2
- package/src/themes/five/src/components/AddressDetails/index.js +1 -1
- package/src/themes/five/src/components/AddressDetails/styles.js +4 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +3 -1
- package/src/themes/five/src/components/BusinessItemAccordion/styles.js +9 -3
- package/src/themes/five/src/components/BusinessListingSearch/Accordion/index.js +23 -0
- package/src/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +28 -17
- package/src/themes/five/src/components/BusinessListingSearch/index.js +65 -66
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +21 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +24 -0
- package/src/themes/five/src/components/BusinessPreorder/styles.js +11 -1
- package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +7 -3
- package/src/themes/five/src/components/BusinessProductsList/styles.js +3 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +11 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +11 -1
- package/src/themes/five/src/components/Cart/index.js +5 -1
- package/src/themes/five/src/components/Cart/styles.js +3 -1
- package/src/themes/five/src/components/Checkout/index.js +48 -61
- package/src/themes/five/src/components/Checkout/styles.js +3 -1
- package/src/themes/five/src/components/DriverTips/index.js +7 -2
- package/src/themes/five/src/components/Header/styles.js +4 -2
- package/src/themes/five/src/components/Help/index.js +0 -1
- package/src/themes/five/src/components/LastOrders/index.js +25 -28
- package/src/themes/five/src/components/MessagesListing/index.js +2 -2
- package/src/themes/five/src/components/MessagesListing/styles.js +3 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +34 -14
- package/src/themes/five/src/components/MultiCheckout/styles.js +9 -0
- package/src/themes/five/src/components/MyOrders/index.js +0 -3
- package/src/themes/five/src/components/NotFoundSource/index.js +5 -10
- package/src/themes/five/src/components/NotFoundSource/styles.js +7 -2
- package/src/themes/five/src/components/OrderContextUI/index.js +1 -1
- package/src/themes/five/src/components/OrderContextUI/styles.js +4 -2
- package/src/themes/five/src/components/OrderProgress/index.js +8 -2
- package/src/themes/five/src/components/PageBanner/styles.js +1 -0
- package/src/themes/five/src/components/PaymentOptions/index.js +1 -1
- package/src/themes/five/src/components/ReviewProduct/styles.js +3 -3
- package/src/themes/five/src/components/ServiceForm/index.js +20 -14
- package/src/themes/five/src/components/ServiceForm/styles.js +11 -3
- package/src/themes/five/src/components/UserDetails/index.js +2 -2
- package/src/themes/five/src/components/UserDetails/styles.js +3 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +0 -1
- package/src/themes/five/src/components/UserPopover/index.js +2 -0
- package/src/themes/five/src/components/UserProfileForm/index.js +0 -3
- package/src/themes/five/src/components/UserProfileForm/styles.js +0 -5
- package/src/themes/five/src/components/WalletTransactionItem/index.js +4 -1
- package/src/themes/five/src/components/Wallets/index.js +101 -95
- package/src/themes/five/src/components/Wallets/styles.js +37 -17
- package/src/themes/five/src/styles/Buttons/index.js +4 -0
- package/src/themes/pwa/src/components/MomentControl/index.js +6 -11
- package/src/utils/index.js +38 -12
- package/template/pages/Home/index.js +3 -0
- package/_bundles/0.ordering-ui.28ae84b35994ed466773.js +0 -1
- package/_bundles/4.ordering-ui.28ae84b35994ed466773.js +0 -1
|
@@ -139,7 +139,6 @@ export const BusinessInfoItem = styled.div`
|
|
|
139
139
|
cursor: pointer;
|
|
140
140
|
font-size: 14px;
|
|
141
141
|
color: ${props => props.theme?.colors.primary};
|
|
142
|
-
text-decoration: underline;
|
|
143
142
|
&:not(:last-child) {
|
|
144
143
|
margin-right: 5px;
|
|
145
144
|
${props => props.theme?.rtl && css`
|
|
@@ -147,6 +146,9 @@ export const BusinessInfoItem = styled.div`
|
|
|
147
146
|
margin-right: 0;
|
|
148
147
|
`}
|
|
149
148
|
}
|
|
149
|
+
&:hover {
|
|
150
|
+
text-decoration: underline;
|
|
151
|
+
}
|
|
150
152
|
|
|
151
153
|
&.dot {
|
|
152
154
|
font-size: 12px;
|
|
@@ -54,18 +54,19 @@ export const ContentInfo = styled.div`
|
|
|
54
54
|
|
|
55
55
|
.go-store {
|
|
56
56
|
user-select: none;
|
|
57
|
-
text-decoration: underline;
|
|
58
57
|
color: ${props => props.theme.colors.primary};
|
|
59
58
|
margin-right: 5px;
|
|
60
59
|
${props => props.theme?.rtl && css`
|
|
61
60
|
margin-left: 5px;
|
|
62
61
|
margin-right: 0;
|
|
63
62
|
`}
|
|
63
|
+
&:hover {
|
|
64
|
+
text-decoration: underline;
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
.clear-cart {
|
|
67
69
|
user-select: none;
|
|
68
|
-
text-decoration: underline;
|
|
69
70
|
color: #d81212;
|
|
70
71
|
margin-left: 5px;
|
|
71
72
|
${props => props.theme?.rtl && css`
|
|
@@ -75,6 +76,9 @@ export const ContentInfo = styled.div`
|
|
|
75
76
|
&:first-letter {
|
|
76
77
|
text-transform: uppercase;
|
|
77
78
|
}
|
|
79
|
+
&:hover {
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
}
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
${({ isStore }) => isStore && css`
|
|
@@ -85,12 +89,14 @@ export const ContentInfo = styled.div`
|
|
|
85
89
|
}
|
|
86
90
|
.change-store {
|
|
87
91
|
cursor: pointer;
|
|
88
|
-
text-decoration: underline;
|
|
89
92
|
color: ${props => props.theme.colors.primary};
|
|
90
93
|
font-size: 12px;
|
|
91
94
|
&:first-letter {
|
|
92
95
|
text-transform: uppercase;
|
|
93
96
|
}
|
|
97
|
+
&:hover {
|
|
98
|
+
text-decoration: underline;
|
|
99
|
+
}
|
|
94
100
|
}
|
|
95
101
|
${props => props.theme?.rtl && css`
|
|
96
102
|
margin-right: 10px;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { Title } from "../styles"
|
|
3
|
+
import BisUpArrow from "@meronex/icons/bi/BisUpArrow"
|
|
4
|
+
|
|
5
|
+
export const FilterAccordion = ({ title, children }) => {
|
|
6
|
+
const [open, setOpen] = useState(false)
|
|
7
|
+
const [setRotate, setRotateState] = useState("accordion__icon")
|
|
8
|
+
|
|
9
|
+
const activeAccordion = (value) => {
|
|
10
|
+
setRotateState(value ? 'accordion__icon rotate' : 'accordion__icon')
|
|
11
|
+
setOpen(value)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Title onClick={() => activeAccordion(!open)}>
|
|
17
|
+
<h3>{title}</h3>
|
|
18
|
+
<BisUpArrow className={`${setRotate}`} />
|
|
19
|
+
</Title>
|
|
20
|
+
{open && children}
|
|
21
|
+
</>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { useLanguage, useUtils } from 'ordering-components-external'
|
|
1
|
+
import { useConfig, useLanguage, useUtils } from 'ordering-components-external'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { MaxFilterContainer, MaxItem, MaxItemContainer, ProgressBar, ProgressContentWrapper } from '../styles'
|
|
4
|
+
import { capitalize } from '../../../../../../utils'
|
|
5
|
+
import { FilterAccordion } from '../Accordion'
|
|
4
6
|
|
|
5
7
|
export const MaxSectionItem = (props) => {
|
|
6
8
|
const {
|
|
@@ -13,10 +15,18 @@ export const MaxSectionItem = (props) => {
|
|
|
13
15
|
|
|
14
16
|
const [, t] = useLanguage()
|
|
15
17
|
const [{ parsePrice }] = useUtils()
|
|
18
|
+
const [{ configs }] = useConfig()
|
|
19
|
+
|
|
20
|
+
const distanceUnit = configs?.distance_unit?.value
|
|
21
|
+
|
|
22
|
+
const units = {
|
|
23
|
+
mi: 1609,
|
|
24
|
+
km: 1000
|
|
25
|
+
}
|
|
16
26
|
|
|
17
27
|
const parseValue = (option) => {
|
|
18
28
|
return filter === 'max_distance'
|
|
19
|
-
? `${option /
|
|
29
|
+
? `${(option / units[distanceUnit]).toFixed(0)} ${t(`${distanceUnit?.toUpperCase()}`, capitalize(distanceUnit))}`
|
|
20
30
|
: filter === 'max_eta'
|
|
21
31
|
? `${option} ${t('MIN', 'min')}`
|
|
22
32
|
: parsePrice(option)
|
|
@@ -24,21 +34,22 @@ export const MaxSectionItem = (props) => {
|
|
|
24
34
|
|
|
25
35
|
return (
|
|
26
36
|
<MaxFilterContainer>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
<FilterAccordion title={title}>
|
|
38
|
+
<ProgressContentWrapper>
|
|
39
|
+
<ProgressBar style={{ width: `${((options.indexOf(filters?.[filter]) / 3) * 100) ?? 100}%` }} />
|
|
40
|
+
</ProgressContentWrapper>
|
|
41
|
+
<MaxItemContainer>
|
|
42
|
+
{options.map((option, i) => (
|
|
43
|
+
<MaxItem
|
|
44
|
+
key={option}
|
|
45
|
+
active={filters?.[filter] === option || (option === 'default' && (filters?.[filter] === 'default' || !filters?.[filter]))}
|
|
46
|
+
onClick={() => handleChangeFilters(filter, option)}
|
|
47
|
+
>
|
|
48
|
+
{option === 'default' ? `${parseValue(options[i - 1])}+` : parseValue(option)}
|
|
49
|
+
</MaxItem>
|
|
50
|
+
))}
|
|
51
|
+
</MaxItemContainer>
|
|
52
|
+
</FilterAccordion>
|
|
42
53
|
</MaxFilterContainer>
|
|
43
54
|
)
|
|
44
55
|
}
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
import Skeleton from 'react-loading-skeleton'
|
|
38
38
|
import { Check2, XLg as Close } from 'react-bootstrap-icons'
|
|
39
39
|
import { SearchBar } from '../SearchBar'
|
|
40
|
-
import { useLanguage, useOrder, useUtils, useSession, BusinessSearchList } from 'ordering-components-external'
|
|
40
|
+
import { useLanguage, useOrder, useUtils, useSession, BusinessSearchList, useConfig } from 'ordering-components-external'
|
|
41
41
|
import { BusinessController } from '../BusinessController'
|
|
42
42
|
import { AutoScroll } from '../AutoScroll'
|
|
43
43
|
import { BusinessTypeFilter } from '../BusinessTypeFilter'
|
|
@@ -54,6 +54,7 @@ import BisUpArrow from '@meronex/icons/bi/BisUpArrow'
|
|
|
54
54
|
import { Modal } from '../Modal'
|
|
55
55
|
import { ProductForm } from '../ProductForm'
|
|
56
56
|
import { MaxSectionItem } from './MaxSectionItem'
|
|
57
|
+
import { FilterAccordion } from './Accordion'
|
|
57
58
|
|
|
58
59
|
const PIXELS_TO_SCROLL = 300
|
|
59
60
|
|
|
@@ -81,9 +82,11 @@ export const BusinessListingSearchUI = (props) => {
|
|
|
81
82
|
const [{ parsePrice, optimizeImage, parseDistance }] = useUtils()
|
|
82
83
|
const [{ auth }] = useSession()
|
|
83
84
|
const { width } = useWindowSize()
|
|
85
|
+
const [{ configs }] = useConfig()
|
|
84
86
|
const maxDeliveryFeeOptions = [15, 25, 35, 'default']
|
|
85
87
|
// const maxProductPriceOptions = [5, 10, 15, 'default']
|
|
86
|
-
const
|
|
88
|
+
const currency = configs.format_number_currency?.value
|
|
89
|
+
const maxDistanceOptions = configs?.distance_unit?.value === 'km' ? [1000, 2000, 5000, 'default'] : [1609, 3218, 8046, 'default']
|
|
87
90
|
const maxTimeOptions = [5, 15, 30, 'default']
|
|
88
91
|
const sortItems = [
|
|
89
92
|
{ text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'distance' },
|
|
@@ -92,11 +95,11 @@ export const BusinessListingSearchUI = (props) => {
|
|
|
92
95
|
]
|
|
93
96
|
|
|
94
97
|
const priceList = [
|
|
95
|
-
{ level: '1', content:
|
|
96
|
-
{ level: '2', content: '
|
|
97
|
-
{ level: '3', content: '
|
|
98
|
-
{ level: '4', content: '
|
|
99
|
-
{ level: '5', content: '
|
|
98
|
+
{ level: '1', content: `${currency}` },
|
|
99
|
+
{ level: '2', content: `${Array(2).fill(currency).join('')}` },
|
|
100
|
+
{ level: '3', content: `${Array(3).fill(currency).join('')}` },
|
|
101
|
+
{ level: '4', content: `${Array(4).fill(currency).join('')}` },
|
|
102
|
+
{ level: '5', content: `${Array(5).fill(currency).join('')}` }
|
|
100
103
|
]
|
|
101
104
|
|
|
102
105
|
const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
|
|
@@ -157,58 +160,58 @@ export const BusinessListingSearchUI = (props) => {
|
|
|
157
160
|
<FiltersContainer>
|
|
158
161
|
<Filters>
|
|
159
162
|
<SortContainer>
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
<SortItem onClick={() => handleChangeFilters('orderBy', 'default')}>{t('RATING', 'Rating')}</SortItem> */}
|
|
172
|
-
|
|
163
|
+
<FilterAccordion title={t('SORT', 'Sort')}>
|
|
164
|
+
{sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
|
|
165
|
+
<SortItem
|
|
166
|
+
key={item?.value}
|
|
167
|
+
onClick={() => handleChangeFilters('orderBy', item?.value)}
|
|
168
|
+
active={filters?.orderBy?.includes(item?.value)}
|
|
169
|
+
>
|
|
170
|
+
{item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <BisUpArrow /> : <BisDownArrow />}</>}
|
|
171
|
+
</SortItem>
|
|
172
|
+
))}
|
|
173
|
+
</FilterAccordion>
|
|
173
174
|
</SortContainer>
|
|
174
175
|
<BrandContainer>
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
176
|
+
<FilterAccordion title={t('BRANDS', 'Brands')}>
|
|
177
|
+
<BrandListWrapper>
|
|
178
|
+
{brandList?.loading && (
|
|
179
|
+
<>
|
|
180
|
+
{[...Array(5).keys()].map(index => (
|
|
181
|
+
<BrandItem key={index}>
|
|
182
|
+
<Skeleton width={120} height={15} />
|
|
183
|
+
<Skeleton width={16} height={16} />
|
|
184
|
+
</BrandItem>
|
|
185
|
+
))}
|
|
186
|
+
</>
|
|
187
|
+
)}
|
|
188
|
+
{!brandList?.loading && brandList?.brands.map((brand, i) => brand?.enabled && (
|
|
189
|
+
<BrandItem key={i} onClick={() => handleChangeBrandFilter(brand?.id)}>
|
|
190
|
+
<span>{brand?.name}</span>
|
|
191
|
+
{filters?.franchise_ids?.includes(brand?.id) && <Check2 />}
|
|
192
|
+
</BrandItem>
|
|
193
|
+
))}
|
|
194
|
+
{!brandList?.loading && ((brandList?.brands?.filter(brand => brand?.enabled))?.length === 0) && (
|
|
195
|
+
<NoResult>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</NoResult>
|
|
196
|
+
)}
|
|
197
|
+
</BrandListWrapper>
|
|
198
|
+
</FilterAccordion>
|
|
197
199
|
</BrandContainer>
|
|
198
200
|
<PriceFilterWrapper>
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
201
|
+
<FilterAccordion title={t('PRICE_RANGE', 'Price range')}>
|
|
202
|
+
<PriceFilterListWrapper>
|
|
203
|
+
{priceList.map((price, i) => (
|
|
204
|
+
<Button
|
|
205
|
+
key={i}
|
|
206
|
+
color={(filters?.price_level === price?.level) ? 'primary' : 'lightGray'}
|
|
207
|
+
onClick={() => handleChangePriceRange(price?.level)}
|
|
208
|
+
>
|
|
209
|
+
{price.content}
|
|
210
|
+
{(filters?.price_level === price?.level) && <Close />}
|
|
211
|
+
</Button>
|
|
212
|
+
))}
|
|
213
|
+
</PriceFilterListWrapper>
|
|
214
|
+
</FilterAccordion>
|
|
212
215
|
</PriceFilterWrapper>
|
|
213
216
|
{orderState?.options?.type === 1 && (
|
|
214
217
|
<MaxSectionItem
|
|
@@ -235,18 +238,14 @@ export const BusinessListingSearchUI = (props) => {
|
|
|
235
238
|
filters={filters}
|
|
236
239
|
handleChangeFilters={handleChangeFilters}
|
|
237
240
|
/>
|
|
238
|
-
{/* <MaxSectionItem
|
|
239
|
-
title={t('MAX_PRODUCT_PRICE', 'Max product price')}
|
|
240
|
-
options={maxProductPriceOptions}
|
|
241
|
-
filter='max_product_price'
|
|
242
|
-
/> */}
|
|
243
241
|
<TagsContainer>
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
242
|
+
<FilterAccordion title={t('BUSINESS_CATEGORIES', 'Business categories')}>
|
|
243
|
+
<BusinessTypeFilter
|
|
244
|
+
isSearchMode
|
|
245
|
+
filters={filters}
|
|
246
|
+
handleChangeFilters={handleChangeFilters}
|
|
247
|
+
/>
|
|
248
|
+
</FilterAccordion>
|
|
250
249
|
</TagsContainer>
|
|
251
250
|
</Filters>
|
|
252
251
|
<FiltersResultContainer>
|
|
@@ -16,8 +16,27 @@ export const BusinessListingSearchContainer = styled.div`
|
|
|
16
16
|
}
|
|
17
17
|
`
|
|
18
18
|
|
|
19
|
+
export const Title = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
margin: 20px 0;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
h3 {
|
|
27
|
+
margin: 0 10px 0 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rotate {
|
|
31
|
+
transform: rotate(180deg);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.accordion__icon {
|
|
35
|
+
transition: transform 0.6s ease;
|
|
36
|
+
}
|
|
37
|
+
`
|
|
38
|
+
|
|
19
39
|
export const FiltersContainer = styled.div`
|
|
20
|
-
|
|
21
40
|
flex-direction: column;
|
|
22
41
|
@media (min-width: 993px){
|
|
23
42
|
flex-direction: row;
|
|
@@ -32,7 +51,7 @@ export const Filters = styled.div`
|
|
|
32
51
|
@media (min-width: 993px){
|
|
33
52
|
width: 25%;
|
|
34
53
|
max-width: 25%;
|
|
35
|
-
margin-right:
|
|
54
|
+
margin-right: 70px;
|
|
36
55
|
}
|
|
37
56
|
`
|
|
38
57
|
|
|
@@ -93,6 +93,28 @@ const BusinessPreorderUI = (props) => {
|
|
|
93
93
|
setIsEnabled(menu.schedule[day].enabled || false)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
const getMomentTime = (time) => {
|
|
97
|
+
const _moment = moment(`${moment(dateSelected).format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm').toDate()
|
|
98
|
+
return _moment
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const isBusyTime = (professional, selectedMoment) => {
|
|
102
|
+
if (!selectedMoment) return false
|
|
103
|
+
const startDay = moment(selectedMoment).utc().format('d')
|
|
104
|
+
const isStartScheduleEnabled = professional?.schedule?.[startDay]?.enabled
|
|
105
|
+
if (!isStartScheduleEnabled) return true
|
|
106
|
+
|
|
107
|
+
if (professional?.busy_times?.length === 0) return false
|
|
108
|
+
|
|
109
|
+
const busyTimes = professional?.busy_times
|
|
110
|
+
|
|
111
|
+
const valid = busyTimes.some(item => {
|
|
112
|
+
return (moment.utc(item?.start).local().valueOf() <= moment(selectedMoment).valueOf() &&
|
|
113
|
+
moment(selectedMoment).valueOf() < moment.utc(item?.end).local().valueOf())
|
|
114
|
+
})
|
|
115
|
+
return valid
|
|
116
|
+
}
|
|
117
|
+
|
|
96
118
|
const getTimeList = (curdate, menu) => {
|
|
97
119
|
validateSelectedDate(curdate, menu)
|
|
98
120
|
const dateParts = curdate.split('-')
|
|
@@ -208,6 +230,8 @@ const BusinessPreorderUI = (props) => {
|
|
|
208
230
|
active={timeSelected === time.value}
|
|
209
231
|
onClick={() => handleChangeTime(time.value)}
|
|
210
232
|
isDisabled={isDisabled}
|
|
233
|
+
isProfessional={isProfessional}
|
|
234
|
+
busyTime={isProfessional && isBusyTime(business, getMomentTime(time.value))}
|
|
211
235
|
>
|
|
212
236
|
<span>{time.text}</span>
|
|
213
237
|
</TimeItem>
|
|
@@ -155,7 +155,12 @@ export const TimeItem = styled.div`
|
|
|
155
155
|
display: flex;
|
|
156
156
|
justify-content: center;
|
|
157
157
|
align-items: center;
|
|
158
|
-
|
|
158
|
+
${({ isProfessional }) => isProfessional ? css`
|
|
159
|
+
background: ${props => props.theme.colors.primaryContrast};
|
|
160
|
+
color: ${props => props.theme.colors.primary};
|
|
161
|
+
` : css`
|
|
162
|
+
background: ${props => props.theme.colors.gray200};
|
|
163
|
+
`}
|
|
159
164
|
border-radius: 7.6px;
|
|
160
165
|
padding: 5px 15px;
|
|
161
166
|
margin: 12px;
|
|
@@ -172,6 +177,11 @@ export const TimeItem = styled.div`
|
|
|
172
177
|
${({ isDisabled }) => isDisabled && css`
|
|
173
178
|
pointer-events: none;
|
|
174
179
|
`}
|
|
180
|
+
|
|
181
|
+
${({ busyTime }) => busyTime && css`
|
|
182
|
+
background: ${props => props.theme.colors.gray200};
|
|
183
|
+
color: ${props => props.theme.colors.lightGray};
|
|
184
|
+
`}
|
|
175
185
|
|
|
176
186
|
span {
|
|
177
187
|
font-size: 14px;
|
|
@@ -47,10 +47,12 @@ export const WrapAllCategories = styled.div`
|
|
|
47
47
|
white-space: pre;
|
|
48
48
|
}
|
|
49
49
|
span {
|
|
50
|
-
color: ${props => props.theme.colors.primary}
|
|
51
|
-
text-decoration: underline;
|
|
50
|
+
color: ${props => props.theme.colors.primary};=
|
|
52
51
|
margin-left: 10px;
|
|
53
52
|
cursor: pointer;
|
|
53
|
+
&:hover {
|
|
54
|
+
text-decoration: underline;
|
|
55
|
+
}
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -150,11 +152,13 @@ export const CategoryDescripion = styled.div`
|
|
|
150
152
|
}
|
|
151
153
|
span {
|
|
152
154
|
color: ${props => props.theme.colors.primary};
|
|
153
|
-
text-decoration: underline;
|
|
154
155
|
margin-left: 10px;
|
|
155
156
|
cursor: pointer;
|
|
156
157
|
white-space: nowrap;
|
|
157
158
|
overflow: visible;
|
|
159
|
+
&:hover {
|
|
160
|
+
text-decoration: underline;
|
|
161
|
+
}
|
|
158
162
|
}
|
|
159
163
|
`
|
|
160
164
|
|
|
@@ -80,10 +80,12 @@ export const CategoryDescription = styled.div`
|
|
|
80
80
|
}
|
|
81
81
|
span {
|
|
82
82
|
color: ${props => props.theme.colors.primary};
|
|
83
|
-
text-decoration: underline;
|
|
84
83
|
margin-left: 10px;
|
|
85
84
|
cursor: pointer;
|
|
86
85
|
white-space: nowrap;
|
|
86
|
+
&:hover {
|
|
87
|
+
text-decoration: underline;
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
`
|
|
89
91
|
|
|
@@ -243,6 +243,16 @@ const BusinessProductsListingUI = (props) => {
|
|
|
243
243
|
events.emit('get_current_view')
|
|
244
244
|
}, [])
|
|
245
245
|
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
const handleClickedBannerProduct = () => {
|
|
248
|
+
handleUpdateInitialRender(true)
|
|
249
|
+
}
|
|
250
|
+
events.on('product_banner_clicked', handleClickedBannerProduct)
|
|
251
|
+
return () => {
|
|
252
|
+
events.off('product_banner_clicked', handleClickedBannerProduct)
|
|
253
|
+
}
|
|
254
|
+
}, [])
|
|
255
|
+
|
|
246
256
|
useEffect(() => {
|
|
247
257
|
if (loading) return
|
|
248
258
|
if (openProduct) {
|
|
@@ -442,7 +452,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
442
452
|
disableOverflowX
|
|
443
453
|
>
|
|
444
454
|
|
|
445
|
-
{productModal.loading && !productModal.error && (
|
|
455
|
+
{productModal.loading && !productModal.error && !productModal.product && (
|
|
446
456
|
<ProductLoading>
|
|
447
457
|
<SkeletonItem>
|
|
448
458
|
<Skeleton height={45} count={props.useKioskApp ? 12 : 8} />
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -47,6 +47,7 @@ import { AutoScroll } from '../../../AutoScroll'
|
|
|
47
47
|
import { CitiesControl } from '../../../CitiesControl'
|
|
48
48
|
import { OrderContextUI } from '../../../OrderContextUI'
|
|
49
49
|
import { OrdersSection } from './OrdersSection'
|
|
50
|
+
import { getCateringValues } from '../../../../../../../utils'
|
|
50
51
|
|
|
51
52
|
const PIXELS_TO_SCROLL = 300
|
|
52
53
|
|
|
@@ -97,6 +98,13 @@ const BusinessesListingUI = (props) => {
|
|
|
97
98
|
const businessesIds = businessesList.businesses &&
|
|
98
99
|
businessesList.businesses?.map(business => business.id)
|
|
99
100
|
const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
101
|
+
const cateringTypeString = orderState?.options?.type === 7
|
|
102
|
+
? 'catering_delivery'
|
|
103
|
+
: orderState?.options?.type === 8
|
|
104
|
+
? 'catering_pickup'
|
|
105
|
+
: null
|
|
106
|
+
|
|
107
|
+
const cateringValues = preorderBusiness?.configs && getCateringValues(cateringTypeString, preorderBusiness?.configs)
|
|
100
108
|
|
|
101
109
|
const handleScroll = useCallback(() => {
|
|
102
110
|
const innerHeightScrolltop = window.innerHeight + document.documentElement?.scrollTop + PIXELS_TO_SCROLL
|
|
@@ -210,7 +218,7 @@ const BusinessesListingUI = (props) => {
|
|
|
210
218
|
{(windowSize.width < 576 || (configs?.business_listing_hide_image?.value !== '1' && !isChew)) && (
|
|
211
219
|
<BusinessBanner>
|
|
212
220
|
{windowSize.width < 576 && (
|
|
213
|
-
<OrderContextUI isBusinessList />
|
|
221
|
+
<OrderContextUI isBusinessList hideHero={!hideHero} />
|
|
214
222
|
)}
|
|
215
223
|
{(configs?.business_listing_hide_image?.value !== '1' && !isChew) && !hideHero && (
|
|
216
224
|
<BusinessHeroImg
|
|
@@ -415,6 +423,8 @@ const BusinessesListingUI = (props) => {
|
|
|
415
423
|
business={preorderBusiness}
|
|
416
424
|
handleClick={handleBusinessClick}
|
|
417
425
|
showButton
|
|
426
|
+
cateringPreorder={!!cateringTypeString}
|
|
427
|
+
{...cateringValues}
|
|
418
428
|
/>
|
|
419
429
|
</Modal>
|
|
420
430
|
<Modal
|
|
@@ -70,6 +70,7 @@ const CartUI = (props) => {
|
|
|
70
70
|
cart: cartMulticart,
|
|
71
71
|
hideDeliveryFee,
|
|
72
72
|
hideDriverTip,
|
|
73
|
+
hideCouponInput,
|
|
73
74
|
businessConfigs
|
|
74
75
|
} = props
|
|
75
76
|
|
|
@@ -467,7 +468,10 @@ const CartUI = (props) => {
|
|
|
467
468
|
)}
|
|
468
469
|
</tbody>
|
|
469
470
|
</table>
|
|
470
|
-
{isCouponEnabled && !isCartPending &&
|
|
471
|
+
{isCouponEnabled && !isCartPending &&
|
|
472
|
+
((isCheckout || isCartPopover || isMultiCheckout) &&
|
|
473
|
+
!(isCheckout && isCartPopover)) && !hideCartDiscount && !hideCouponInput &&
|
|
474
|
+
(
|
|
471
475
|
<CouponContainer>
|
|
472
476
|
<CouponControl
|
|
473
477
|
businessId={cart?.business_id}
|