ordering-ui-external 10.1.0 → 10.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.e9827c5566d8cce0eaa4.js → 0.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +2 -2
- package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/ordering-ui.d1a8d1fbf5b112d5d9a9.js +2 -0
- package/_modules/components/BusinessBasicInformation/index.js +7 -10
- package/_modules/components/OrderDetails/index.js +14 -17
- package/_modules/components/ProductItemAccordion/index.js +4 -5
- package/_modules/components/RenderProductsLayout/SearchProducts/index.js +2 -5
- package/_modules/components/UserFormDetails/index.js +7 -8
- package/_modules/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/components/UserProfileForm/index.js +10 -11
- package/_modules/contexts/ThemeContext/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/index.js +0 -3
- package/_modules/themes/five/src/components/BusinessController/index.js +14 -17
- package/_modules/themes/five/src/components/BusinessController/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +22 -3
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
- package/_modules/themes/five/src/components/Cart/index.js +17 -9
- package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
- package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
- package/_modules/themes/five/src/components/Checkout/index.js +8 -8
- package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
- package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
- package/_modules/themes/five/src/components/Favorite/index.js +4 -5
- package/_modules/themes/five/src/components/Footer/index.js +2 -3
- package/_modules/themes/five/src/components/Header/index.js +5 -8
- package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/Modal/styles.js +4 -2
- package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
- package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
- package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
- package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
- package/_modules/themes/five/src/components/OrderProgress/index.js +5 -1
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
- package/_modules/themes/five/src/components/OrdersOption/index.js +7 -22
- package/_modules/themes/five/src/components/OrdersOption/styles.js +38 -35
- package/_modules/themes/five/src/components/PageBanner/index.js +79 -58
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +2 -1
- package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
- package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
- package/_modules/themes/five/src/components/SignUpForm/index.js +5 -5
- package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
- 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 +3 -6
- package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
- package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
- package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
- package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
- package/package.json +2 -2
- package/src/components/BusinessBasicInformation/index.js +7 -8
- package/src/components/OrderDetails/index.js +14 -16
- package/src/components/ProductItemAccordion/index.js +4 -3
- package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
- package/src/components/UserFormDetails/index.js +6 -5
- package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
- package/src/components/UserProfileForm/index.js +10 -10
- package/src/contexts/ThemeContext/index.js +1 -1
- package/src/themes/five/src/components/AddressForm/index.js +1 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -3
- package/src/themes/five/src/components/BusinessController/index.js +5 -7
- package/src/themes/five/src/components/BusinessController/styles.js +1 -1
- package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
- package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
- package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +17 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
- package/src/themes/five/src/components/Cart/index.js +11 -4
- package/src/themes/five/src/components/CartPopover/index.js +2 -3
- package/src/themes/five/src/components/CartPopover/styles.js +1 -1
- package/src/themes/five/src/components/Checkout/index.js +5 -6
- package/src/themes/five/src/components/Confirm/styles.js +1 -1
- package/src/themes/five/src/components/DatePicker/index.js +1 -0
- package/src/themes/five/src/components/Favorite/index.js +4 -3
- package/src/themes/five/src/components/Footer/index.js +3 -2
- package/src/themes/five/src/components/Header/index.js +4 -5
- package/src/themes/five/src/components/HeaderOption/index.js +4 -3
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
- package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
- package/src/themes/five/src/components/Modal/styles.js +1 -1
- package/src/themes/five/src/components/MomentContent/index.js +17 -8
- package/src/themes/five/src/components/MomentControl/index.js +83 -45
- package/src/themes/five/src/components/MomentControl/styles.js +137 -34
- package/src/themes/five/src/components/MyOrders/index.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +50 -21
- package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
- package/src/themes/five/src/components/OrderProgress/index.js +5 -1
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
- package/src/themes/five/src/components/OrdersOption/index.js +3 -17
- package/src/themes/five/src/components/OrdersOption/styles.js +3 -4
- package/src/themes/five/src/components/PageBanner/index.js +65 -51
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -0
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
- package/src/themes/five/src/components/ProductOption/styles.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
- package/src/themes/five/src/components/SignUpForm/index.js +6 -6
- package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
- package/src/themes/five/src/components/UserDetails/index.js +1 -1
- package/src/themes/five/src/components/UserDetails/styles.js +3 -0
- package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/styles.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
- package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
- package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
- package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
- package/template/app.js +15 -10
- package/template/components/HelmetTags/index.js +3 -2
- package/template/pages/AddressList/index.js +4 -3
- package/template/pages/BusinessProductsList/index.js +5 -4
- package/template/pages/BusinessesList/index.js +6 -6
- package/template/pages/Checkout/index.js +6 -4
- package/template/pages/Home/index.js +4 -2
- package/template/pages/MessagesList/index.js +5 -4
- package/template/pages/MyOrders/index.js +6 -5
- package/template/pages/OrderDetails/index.js +4 -3
- package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
- package/template/components/OrderingThemeUpdated/index.js +0 -41
- /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useOrder
|
|
2
|
+
import { useOrder } from 'ordering-components-external'
|
|
3
3
|
import { BusinessController } from '../../BusinessController'
|
|
4
4
|
import { AutoScroll } from '../../AutoScroll'
|
|
5
5
|
import { BusinessList, BusinessListWrapper } from './styles'
|
|
6
6
|
import { useWindowSize } from '../../../../../../hooks/useWindowSize'
|
|
7
|
+
import { useTheme } from 'styled-components'
|
|
7
8
|
|
|
8
9
|
export const PreviousBusinessOrdered = (props) => {
|
|
9
10
|
const {
|
|
@@ -15,9 +16,9 @@ export const PreviousBusinessOrdered = (props) => {
|
|
|
15
16
|
} = props
|
|
16
17
|
|
|
17
18
|
const [orderState] = useOrder()
|
|
18
|
-
const
|
|
19
|
+
const theme = useTheme()
|
|
19
20
|
const { width } = useWindowSize()
|
|
20
|
-
const isChew =
|
|
21
|
+
const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
21
22
|
|
|
22
23
|
const onBusinessClick = (business) => {
|
|
23
24
|
onRedirectPage({ page: 'business', params: { store: business.slug } })
|
|
@@ -109,7 +109,6 @@ const OrdersOptionUI = (props) => {
|
|
|
109
109
|
? orders && orders.length > 0 && !orders.map(order => businessesIds && businessesIds.includes(order.business_id)).every(i => !i)
|
|
110
110
|
: orders.length > 0
|
|
111
111
|
|
|
112
|
-
const [loadingOrders, setLoadingOrders] = useState(true)
|
|
113
112
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
114
113
|
const closeOrderModal = (e) => {
|
|
115
114
|
const outsideModal = !window.document.getElementById('app-modals') ||
|
|
@@ -142,18 +141,6 @@ const OrdersOptionUI = (props) => {
|
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
|
|
145
|
-
useEffect(() => {
|
|
146
|
-
let timeout
|
|
147
|
-
if (isCustomLayout) {
|
|
148
|
-
timeout = setTimeout(() => {
|
|
149
|
-
setLoadingOrders(false)
|
|
150
|
-
}, 2000)
|
|
151
|
-
}
|
|
152
|
-
return () => {
|
|
153
|
-
typeof timeout === 'number' && clearTimeout(timeout)
|
|
154
|
-
}
|
|
155
|
-
}, [])
|
|
156
|
-
|
|
157
144
|
useEffect(() => {
|
|
158
145
|
if (loading) return
|
|
159
146
|
|
|
@@ -203,7 +190,7 @@ const OrdersOptionUI = (props) => {
|
|
|
203
190
|
</React.Fragment>))}
|
|
204
191
|
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
205
192
|
<BeforeComponent key={i} {...props} />))}
|
|
206
|
-
{(isCustomLayout ? ((isShowTitles || !isBusinessesPage) && !
|
|
193
|
+
{(isCustomLayout ? ((isShowTitles || !isBusinessesPage) && !loading && !isBusinessesLoading) : ((isShowTitles || !isBusinessesPage) && !hideOrders)) && (
|
|
207
194
|
<>
|
|
208
195
|
{orders.length > 0 && (
|
|
209
196
|
<OptionTitle isBusinessesPage={isBusinessesPage}>
|
|
@@ -241,7 +228,7 @@ const OrdersOptionUI = (props) => {
|
|
|
241
228
|
/>
|
|
242
229
|
)}
|
|
243
230
|
|
|
244
|
-
{(isCustomLayout ? (
|
|
231
|
+
{(isCustomLayout ? (loading || businesses?.loading) : showSkeletons) && (
|
|
245
232
|
<>
|
|
246
233
|
{(businesses?.loading && isBusiness) ? (
|
|
247
234
|
<BusinessControllerSkeleton>
|
|
@@ -316,8 +303,7 @@ const OrdersOptionUI = (props) => {
|
|
|
316
303
|
)}
|
|
317
304
|
</>
|
|
318
305
|
)}
|
|
319
|
-
|
|
320
|
-
{(isCustomLayout ? !loadingOrders && !loading && !error && orders.length > 0 && !isBusinessesLoading && !hideOrders : !loading && !error && orders.length > 0 && !hideOrders) && (
|
|
306
|
+
{(isCustomLayout ? !loading && !error && orders.length > 0 && !isBusinessesLoading && !hideOrders : !loading && !error && orders.length > 0 && !hideOrders) && (
|
|
321
307
|
horizontal ? (
|
|
322
308
|
<HorizontalOrdersLayout
|
|
323
309
|
businessesIds={businessesIds}
|
|
@@ -2,9 +2,8 @@ import styled, { css } from 'styled-components'
|
|
|
2
2
|
|
|
3
3
|
export const OptionTitle = styled.div`
|
|
4
4
|
width: 100%;
|
|
5
|
-
margin: ${({ isBusinessesPage }) => isBusinessesPage ? '
|
|
6
|
-
padding: ${({ isBusinessesPage }) =>
|
|
7
|
-
|
|
5
|
+
margin: ${({ isBusinessesPage }) => isBusinessesPage ? '0' : '0 auto'};
|
|
6
|
+
padding: ${({ isBusinessesPage }) => isBusinessesPage ? '10px 20px 0' : '0 15px'};
|
|
8
7
|
h1{
|
|
9
8
|
text-transform: capitalize;
|
|
10
9
|
font-size: 18px;
|
|
@@ -12,7 +11,7 @@ export const OptionTitle = styled.div`
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
@media (min-width: 768px){
|
|
15
|
-
padding: 0;
|
|
14
|
+
padding: ${({ isBusinessesPage }) => isBusinessesPage ? '10px 20px 0' : '0'};
|
|
16
15
|
width: 100%;
|
|
17
16
|
}
|
|
18
17
|
`
|
|
@@ -22,7 +22,8 @@ SwiperCore.use([Navigation])
|
|
|
22
22
|
|
|
23
23
|
const PageBannerUI = (props) => {
|
|
24
24
|
const {
|
|
25
|
-
pageBannerState
|
|
25
|
+
pageBannerState,
|
|
26
|
+
isCustomerMode
|
|
26
27
|
} = props
|
|
27
28
|
|
|
28
29
|
const [{ site }] = useSite()
|
|
@@ -33,61 +34,74 @@ const PageBannerUI = (props) => {
|
|
|
33
34
|
|
|
34
35
|
const onProductRedirect = ({ slug, category, product }) => {
|
|
35
36
|
if (!category && !product) {
|
|
36
|
-
if (
|
|
37
|
-
return events.emit('go_to_page', { page: 'business', params: {
|
|
37
|
+
if (isCustomerMode) {
|
|
38
|
+
return events.emit('go_to_page', { page: 'business', params: { store: slug } })
|
|
38
39
|
} else {
|
|
39
|
-
|
|
40
|
+
if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
|
|
41
|
+
return events.emit('go_to_page', { page: 'business', params: { business_slug: slug }, replace: false })
|
|
42
|
+
} else {
|
|
43
|
+
return events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${slug}`, replace: false })
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
events.emit('product_banner_clicked')
|
|
43
|
-
if (
|
|
48
|
+
if (isCustomerMode) {
|
|
44
49
|
return events.emit('go_to_page', {
|
|
45
|
-
page: '
|
|
46
|
-
params: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
product_slug: product
|
|
50
|
-
},
|
|
51
|
-
replace: false
|
|
52
|
-
})
|
|
53
|
-
}
|
|
54
|
-
if (productUrlTemplate.includes('/store/:category_slug/:product_slug')) {
|
|
55
|
-
const businessParameter = businessUrlTemplate.replace('/store?', '').replace('=:business_slug', '')
|
|
56
|
-
return events.emit('go_to_page', {
|
|
57
|
-
page: 'product',
|
|
58
|
-
params: {
|
|
59
|
-
category_slug: category,
|
|
60
|
-
product_slug: product
|
|
61
|
-
},
|
|
62
|
-
search: `?${businessParameter}=${slug}`,
|
|
63
|
-
replace: false
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
if (productUrlTemplate.includes('/store/:business_slug') && productUrlTemplate.includes('category_id')) {
|
|
67
|
-
const ids = productUrlTemplate.split('?')[1].split('&')
|
|
68
|
-
const categoryParameter = ids[0].replace('=:category_id', '')
|
|
69
|
-
const productParameter = ids[1].replace('=:product_id', '')
|
|
70
|
-
return events.emit('go_to_page', {
|
|
71
|
-
page: 'product',
|
|
72
|
-
params: {
|
|
73
|
-
business_slug: slug
|
|
74
|
-
},
|
|
75
|
-
search: `?${categoryParameter}=${category}&${productParameter}=${product}`,
|
|
76
|
-
replace: false
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
if (productUrlTemplate.includes('/:business_slug') && !productUrlTemplate.includes('store')) {
|
|
80
|
-
const ids = productUrlTemplate.split('?')[1].split('&')
|
|
81
|
-
const categoryParameter = ids[0].replace('=:category_id', '')
|
|
82
|
-
const productParameter = ids[1].replace('=:product_id', '')
|
|
83
|
-
return events.emit('go_to_page', {
|
|
84
|
-
page: 'product',
|
|
85
|
-
params: {
|
|
86
|
-
business_slug: slug
|
|
87
|
-
},
|
|
88
|
-
search: `?${categoryParameter}=${category}&${productParameter}=${product}`,
|
|
89
|
-
replace: false
|
|
50
|
+
page: 'business',
|
|
51
|
+
params: { store: slug },
|
|
52
|
+
search: `?category=${category}&product=${product}`,
|
|
53
|
+
replace: true
|
|
90
54
|
})
|
|
55
|
+
} else {
|
|
56
|
+
if (productUrlTemplate === '/store/:business_slug/:category_slug/:product_slug' || productUrlTemplate === '/:business_slug/:category_slug/:product_slug') {
|
|
57
|
+
return events.emit('go_to_page', {
|
|
58
|
+
page: 'product',
|
|
59
|
+
params: {
|
|
60
|
+
business_slug: slug,
|
|
61
|
+
category_slug: category,
|
|
62
|
+
product_slug: product
|
|
63
|
+
},
|
|
64
|
+
replace: false
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
if (productUrlTemplate.includes('/store/:category_slug/:product_slug')) {
|
|
68
|
+
const businessParameter = businessUrlTemplate.replace('/store?', '').replace('=:business_slug', '')
|
|
69
|
+
return events.emit('go_to_page', {
|
|
70
|
+
page: 'product',
|
|
71
|
+
params: {
|
|
72
|
+
category_slug: category,
|
|
73
|
+
product_slug: product
|
|
74
|
+
},
|
|
75
|
+
search: `?${businessParameter}=${slug}`,
|
|
76
|
+
replace: false
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
if (productUrlTemplate.includes('/store/:business_slug') && productUrlTemplate.includes('category_id')) {
|
|
80
|
+
const ids = productUrlTemplate.split('?')[1].split('&')
|
|
81
|
+
const categoryParameter = ids[0].replace('=:category_id', '')
|
|
82
|
+
const productParameter = ids[1].replace('=:product_id', '')
|
|
83
|
+
return events.emit('go_to_page', {
|
|
84
|
+
page: 'product',
|
|
85
|
+
params: {
|
|
86
|
+
business_slug: slug
|
|
87
|
+
},
|
|
88
|
+
search: `?${categoryParameter}=${category}&${productParameter}=${product}`,
|
|
89
|
+
replace: false
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
if (productUrlTemplate.includes('/:business_slug') && !productUrlTemplate.includes('store')) {
|
|
93
|
+
const ids = productUrlTemplate.split('?')[1].split('&')
|
|
94
|
+
const categoryParameter = ids[0].replace('=:category_id', '')
|
|
95
|
+
const productParameter = ids[1].replace('=:product_id', '')
|
|
96
|
+
return events.emit('go_to_page', {
|
|
97
|
+
page: 'product',
|
|
98
|
+
params: {
|
|
99
|
+
business_slug: slug
|
|
100
|
+
},
|
|
101
|
+
search: `?${categoryParameter}=${category}&${productParameter}=${product}`,
|
|
102
|
+
replace: false
|
|
103
|
+
})
|
|
104
|
+
}
|
|
91
105
|
}
|
|
92
106
|
}
|
|
93
107
|
|
|
@@ -118,7 +132,7 @@ const PageBannerUI = (props) => {
|
|
|
118
132
|
pageBannerState.banner?.items?.length > 0 && (
|
|
119
133
|
<BannerContainer>
|
|
120
134
|
<Swiper
|
|
121
|
-
navigation
|
|
135
|
+
navigation={pageBannerState.banner?.items?.length > 1}
|
|
122
136
|
spaceBetween={0}
|
|
123
137
|
shortSwipes={false}
|
|
124
138
|
loop={pageBannerState.banner?.items.length > 1}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Pencil,
|
|
5
5
|
Trash
|
|
6
6
|
} from 'react-bootstrap-icons'
|
|
7
|
-
import { useUtils, useLanguage, useOrder, useConfig
|
|
7
|
+
import { useUtils, useLanguage, useOrder, useConfig } from 'ordering-components-external'
|
|
8
8
|
import { useWindowSize } from '../../../../../hooks/useWindowSize'
|
|
9
9
|
import {
|
|
10
10
|
AccordionSection,
|
|
@@ -52,7 +52,6 @@ export const ProductItemAccordion = (props) => {
|
|
|
52
52
|
const [{ parsePrice, parseDate }] = useUtils()
|
|
53
53
|
const windowSize = useWindowSize()
|
|
54
54
|
const [{ configs }] = useConfig()
|
|
55
|
-
const [orderingTheme] = useOrderingTheme()
|
|
56
55
|
const [setActive, setActiveState] = useState('')
|
|
57
56
|
const [setHeight, setHeightState] = useState('0px')
|
|
58
57
|
const [setRotate, setRotateState] = useState('accordion__icon')
|
|
@@ -12,7 +12,7 @@ export const WrapHeader = styled.div`
|
|
|
12
12
|
display: flex;
|
|
13
13
|
justify-content: space-between;
|
|
14
14
|
align-items: center;
|
|
15
|
-
background-color:
|
|
15
|
+
background-color: ${(props) => props.theme?.colors?.backgroundPage};
|
|
16
16
|
`
|
|
17
17
|
|
|
18
18
|
export const TitleContainer = styled.div`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useTheme } from 'styled-components'
|
|
3
|
-
import { useLanguage, useConfig, useUtils
|
|
3
|
+
import { useLanguage, useConfig, useUtils } from 'ordering-components-external'
|
|
4
4
|
import CgSearch from '@meronex/icons/cg/CgSearch'
|
|
5
5
|
import { Cart3, ArrowLeft } from 'react-bootstrap-icons'
|
|
6
6
|
import { BusinessBasicInformation } from '../BusinessBasicInformation'
|
|
@@ -88,14 +88,13 @@ export const RenderProductsLayout = (props) => {
|
|
|
88
88
|
handleChangePriceFilterValues,
|
|
89
89
|
priceFilterValues,
|
|
90
90
|
handleUpdateProfessionals,
|
|
91
|
-
isCustomerMode
|
|
91
|
+
isCustomerMode
|
|
92
92
|
} = props
|
|
93
93
|
|
|
94
94
|
const theme = useTheme()
|
|
95
95
|
const [, t] = useLanguage()
|
|
96
96
|
const [{ configs }] = useConfig()
|
|
97
97
|
const [{ parsePrice }] = useUtils()
|
|
98
|
-
const [orderingTheme] = useOrderingTheme()
|
|
99
98
|
const windowSize = useWindowSize()
|
|
100
99
|
const [isCartModal, setisCartModal] = useState(false)
|
|
101
100
|
const [openSearchProducts, setOpenSearchProducts] = useState(false)
|
|
@@ -121,7 +120,7 @@ export const RenderProductsLayout = (props) => {
|
|
|
121
120
|
const businessLayout = {
|
|
122
121
|
layoutOne: frontLayout === layoutOne && isUseParentCategory
|
|
123
122
|
}
|
|
124
|
-
const showCartOnProductList = !
|
|
123
|
+
const showCartOnProductList = !theme?.business_view?.components?.cart?.components?.hidden
|
|
125
124
|
const hideBusinessNearCity = theme?.business_view?.components?.near_business?.hidden ?? true
|
|
126
125
|
const hidePreviousOrdered = theme?.business_view?.components?.products_ordered?.hidden
|
|
127
126
|
|
|
@@ -193,9 +192,13 @@ export const RenderProductsLayout = (props) => {
|
|
|
193
192
|
/>
|
|
194
193
|
)}
|
|
195
194
|
|
|
196
|
-
{
|
|
195
|
+
{businessState?.business?.id && (
|
|
197
196
|
<PageBannerWrapper>
|
|
198
|
-
<PageBanner
|
|
197
|
+
<PageBanner
|
|
198
|
+
position='web_business_page'
|
|
199
|
+
businessId={businessState?.business?.id}
|
|
200
|
+
isCustomerMode={isCustomerMode}
|
|
201
|
+
/>
|
|
199
202
|
</PageBannerWrapper>
|
|
200
203
|
)}
|
|
201
204
|
|
|
@@ -420,13 +420,13 @@ const SignUpFormUI = (props) => {
|
|
|
420
420
|
placeholder={t(field.code.toUpperCase(), field.name)}
|
|
421
421
|
onChange={handleChangeInputEmail}
|
|
422
422
|
ref={formMethods.register({
|
|
423
|
-
required: isRequiredField(field.code)
|
|
423
|
+
required: !isCustomerMode && isRequiredField(field.code)
|
|
424
424
|
? t('VALIDATION_ERROR_EMAIL_REQUIRED', 'The field Email is required').replace('_attribute_', t('EMAIL', 'Email'))
|
|
425
425
|
: null,
|
|
426
426
|
pattern: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i
|
|
427
427
|
})}
|
|
428
428
|
onKeyDown={preventWhiteSpaceOnKeyDown}
|
|
429
|
-
required={!!field.required}
|
|
429
|
+
required={!!field.required && !isCustomerMode}
|
|
430
430
|
autoComplete='on'
|
|
431
431
|
isError={formMethods.errors?.email && !notValidationFields.includes(field.code)}
|
|
432
432
|
/>
|
|
@@ -551,7 +551,7 @@ const SignUpFormUI = (props) => {
|
|
|
551
551
|
)}
|
|
552
552
|
|
|
553
553
|
<CheckboxArea>
|
|
554
|
-
{(signUpTab === 'default') && (
|
|
554
|
+
{(signUpTab === 'default') && !isCustomerMode && (
|
|
555
555
|
<PromotionsWrapper>
|
|
556
556
|
<Checkbox
|
|
557
557
|
name='promotions'
|
|
@@ -566,7 +566,7 @@ const SignUpFormUI = (props) => {
|
|
|
566
566
|
</PromotionsWrapper>
|
|
567
567
|
)}
|
|
568
568
|
|
|
569
|
-
{configs?.terms_and_conditions?.value === 'true' && (
|
|
569
|
+
{configs?.terms_and_conditions?.value === 'true' && !isCustomerMode && (
|
|
570
570
|
<>
|
|
571
571
|
{formMethods.errors?.acceptTerms && (
|
|
572
572
|
<ValidationText>
|
|
@@ -672,14 +672,14 @@ const SignUpFormUI = (props) => {
|
|
|
672
672
|
)}
|
|
673
673
|
</BussinessAndDriverSignUp>
|
|
674
674
|
)}
|
|
675
|
-
{hasSocialLogin && hasSocialEnabled && (
|
|
675
|
+
{hasSocialLogin && hasSocialEnabled && !isCustomerMode && (
|
|
676
676
|
<LoginDivider>
|
|
677
677
|
<DividerLine />
|
|
678
678
|
<p>{t('OR', 'or')}</p>
|
|
679
679
|
<DividerLine />
|
|
680
680
|
</LoginDivider>
|
|
681
681
|
)}
|
|
682
|
-
{!externalPhoneNumber && (
|
|
682
|
+
{!externalPhoneNumber && !isCustomerMode && (
|
|
683
683
|
<>
|
|
684
684
|
{Object.keys(configs).length > 0 ? (
|
|
685
685
|
<SocialButtons isPopup={isPopup}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useState } from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
|
-
import { useLanguage, useConfig, useOrder, useUtils, useSession,
|
|
3
|
+
import { useLanguage, useConfig, useOrder, useUtils, useSession, SingleProductCard as SingleProductCardController } from 'ordering-components-external'
|
|
4
4
|
import { shape } from '../../../../../../../utils'
|
|
5
5
|
import { useIntersectionObserver } from '../../../../../../../hooks/useIntersectionObserver'
|
|
6
6
|
import { Heart as DisLike, HeartFill as Like } from 'react-bootstrap-icons'
|
|
@@ -52,7 +52,6 @@ const SingleProductCardUI = (props) => {
|
|
|
52
52
|
const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
|
|
53
53
|
const [orderState] = useOrder()
|
|
54
54
|
const [{ auth }, { login }] = useSession()
|
|
55
|
-
const [orderingTheme] = useOrderingTheme()
|
|
56
55
|
const theme = useTheme()
|
|
57
56
|
const favoriteRef = useRef(null)
|
|
58
57
|
|
|
@@ -127,7 +127,7 @@ const UserDetailsUI = (props) => {
|
|
|
127
127
|
}, [willVerifyOtpState])
|
|
128
128
|
|
|
129
129
|
useEffect(() => {
|
|
130
|
-
if (isCheckoutPlace && requiredFields?.length === 0) {
|
|
130
|
+
if (isCheckoutPlace && requiredFields?.length === 0 && !formState?.loading) {
|
|
131
131
|
setIsSuccess && setIsSuccess(true)
|
|
132
132
|
onClose && onClose()
|
|
133
133
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
|
-
import { useSession, useLanguage, useCustomer, useConfig
|
|
3
|
+
import { useSession, useLanguage, useCustomer, useConfig } from 'ordering-components-external'
|
|
4
4
|
import { useForm } from 'react-hook-form'
|
|
5
5
|
import parsePhoneNumber from 'libphonenumber-js'
|
|
6
6
|
import { useTheme } from 'styled-components'
|
|
@@ -59,7 +59,6 @@ export const UserFormDetailsUI = (props) => {
|
|
|
59
59
|
const [{ configs }] = useConfig()
|
|
60
60
|
const theme = useTheme()
|
|
61
61
|
const [{ user: userSession }, { login }] = useSession()
|
|
62
|
-
const [orderingTheme] = useOrderingTheme()
|
|
63
62
|
const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
|
|
64
63
|
const [userPhoneNumber, setUserPhoneNumber] = useState(null)
|
|
65
64
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
@@ -215,7 +214,7 @@ export const UserFormDetailsUI = (props) => {
|
|
|
215
214
|
}
|
|
216
215
|
|
|
217
216
|
const showFieldWithTheme = (name) => {
|
|
218
|
-
return !
|
|
217
|
+
return !theme?.profile?.components?.[name]?.hidden
|
|
219
218
|
}
|
|
220
219
|
|
|
221
220
|
const _handleChangeDate = (date) => {
|
|
@@ -388,7 +387,7 @@ export const UserFormDetailsUI = (props) => {
|
|
|
388
387
|
<Input
|
|
389
388
|
borderBottom
|
|
390
389
|
className='form'
|
|
391
|
-
value={moment(birthdate).format('YYYY/MM/DD')}
|
|
390
|
+
value={birthdate ? moment(birthdate).format('YYYY/MM/DD') : ''}
|
|
392
391
|
autoComplete='off'
|
|
393
392
|
onFocus={() => setOpenCalendar(true)}
|
|
394
393
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect } from 'react'
|
|
2
|
-
import { useLanguage, useSession, LogoutAction as LogoutActionController, useEvent, useCustomer, useConfig,
|
|
2
|
+
import { useLanguage, useSession, LogoutAction as LogoutActionController, useEvent, useCustomer, useConfig, useOrder } from 'ordering-components-external'
|
|
3
3
|
import { usePopper } from 'react-popper'
|
|
4
4
|
import {
|
|
5
5
|
HeaderItem,
|
|
@@ -31,7 +31,6 @@ export const UserPopover = (props) => {
|
|
|
31
31
|
const [, t] = useLanguage()
|
|
32
32
|
const [events] = useEvent()
|
|
33
33
|
const [{ configs }] = useConfig()
|
|
34
|
-
const [orderingTheme] = useOrderingTheme()
|
|
35
34
|
const [orderStatus] = useOrder()
|
|
36
35
|
const theme = useTheme()
|
|
37
36
|
const referenceElement = useRef()
|
|
@@ -40,8 +39,8 @@ export const UserPopover = (props) => {
|
|
|
40
39
|
|
|
41
40
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
42
41
|
const isPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
|
|
43
|
-
const isAddressListNewPage =
|
|
44
|
-
const isChew =
|
|
42
|
+
const isAddressListNewPage = theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
43
|
+
const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
45
44
|
|
|
46
45
|
const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
|
|
47
46
|
const hideOrders = theme?.bar_menu?.components?.orders?.hidden
|
|
@@ -4,15 +4,16 @@ import { Tabs, Tab } from '../../../styles/Tabs'
|
|
|
4
4
|
import BsPerson from '@meronex/icons/bs/BsPerson'
|
|
5
5
|
import AiOutlineUnorderedList from '@meronex/icons/ai/AiOutlineUnorderedList'
|
|
6
6
|
import FaAddressBook from '@meronex/icons/fa/FaAddressBook'
|
|
7
|
-
import { useEvent, useLanguage
|
|
7
|
+
import { useEvent, useLanguage } from 'ordering-components-external'
|
|
8
|
+
import { useTheme } from 'styled-components'
|
|
8
9
|
|
|
9
10
|
export const ProfileOptions = ({ value }) => {
|
|
10
11
|
const [tabValue] = useState(value)
|
|
11
12
|
const [, t] = useLanguage()
|
|
12
13
|
const [events] = useEvent()
|
|
13
|
-
const
|
|
14
|
+
const theme = useTheme()
|
|
14
15
|
|
|
15
|
-
const showAddressListTab =
|
|
16
|
+
const showAddressListTab = theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
16
17
|
|
|
17
18
|
const handleGoToPage = (data) => {
|
|
18
19
|
events.emit('go_to_page', data)
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
useLanguage,
|
|
10
10
|
useSession,
|
|
11
11
|
DragAndDrop,
|
|
12
|
-
ExamineClick
|
|
13
|
-
useOrderingTheme
|
|
12
|
+
ExamineClick
|
|
14
13
|
} from 'ordering-components-external'
|
|
15
14
|
|
|
16
15
|
import { UserFormDetailsUI } from '../UserFormDetails'
|
|
@@ -97,7 +96,6 @@ const UserProfileFormUI = (props) => {
|
|
|
97
96
|
const [{ user }] = useSession()
|
|
98
97
|
const [{ configs }] = useConfig()
|
|
99
98
|
const theme = useTheme()
|
|
100
|
-
const [orderingTheme] = useOrderingTheme()
|
|
101
99
|
const [willVerifyOtpState, setWillVerifyOtpState] = useState(false)
|
|
102
100
|
const [otpLeftTime, , resetOtpLeftTime] = useCountdownTimer(
|
|
103
101
|
600, willVerifyOtpState)
|
|
@@ -110,7 +108,7 @@ const UserProfileFormUI = (props) => {
|
|
|
110
108
|
const userFormLayoutRow = theme?.profile?.components?.layout?.position === 'row'
|
|
111
109
|
|
|
112
110
|
const isPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
|
|
113
|
-
const isAddressListNewPage =
|
|
111
|
+
const isAddressListNewPage = theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
114
112
|
const isWalletEnabled = configs?.cash_wallet?.value &&
|
|
115
113
|
configs?.wallet_enabled?.value === '1' &&
|
|
116
114
|
(configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
@@ -4,7 +4,7 @@ import FiClock from '@meronex/icons/fi/FiClock'
|
|
|
4
4
|
import GrLocation from '@meronex/icons/gr/GrLocation'
|
|
5
5
|
import GrDeliver from '@meronex/icons/gr/GrDeliver'
|
|
6
6
|
import FaStar from '@meronex/icons/fa/FaStar'
|
|
7
|
-
import { useUtils, useOrder, useLanguage
|
|
7
|
+
import { useUtils, useOrder, useLanguage } from 'ordering-components-external'
|
|
8
8
|
import { convertHoursToMinutes } from '../../../../../utils'
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
BusinessInfo,
|
|
14
14
|
BusinessInfoItem
|
|
15
15
|
} from './styles'
|
|
16
|
+
import { useTheme } from 'styled-components'
|
|
16
17
|
const types = ['food', 'laundry', 'alcohol', 'groceries']
|
|
17
18
|
export const BusinessBasicInformation = (props) => {
|
|
18
19
|
const {
|
|
@@ -23,7 +24,7 @@ export const BusinessBasicInformation = (props) => {
|
|
|
23
24
|
const [orderState] = useOrder()
|
|
24
25
|
const [, t] = useLanguage()
|
|
25
26
|
const [{ parsePrice, parseDistance }] = useUtils()
|
|
26
|
-
const
|
|
27
|
+
const theme = useTheme()
|
|
27
28
|
const getBusinessType = () => {
|
|
28
29
|
if (Object.keys(business).length <= 0) return t('GENERAL', 'General')
|
|
29
30
|
const _types = []
|
|
@@ -33,11 +34,11 @@ export const BusinessBasicInformation = (props) => {
|
|
|
33
34
|
return _types.join(', ')
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
const showDeliveryFee = !
|
|
37
|
-
const showTime = !
|
|
38
|
-
const showBusinessInfo = !
|
|
39
|
-
const showReviews = !
|
|
40
|
-
const showDistance = !
|
|
37
|
+
const showDeliveryFee = !theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
|
|
38
|
+
const showTime = !theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
|
|
39
|
+
const showBusinessInfo = !theme?.business_view?.components?.header?.components?.business?.components?.business_info?.hidden
|
|
40
|
+
const showReviews = !theme?.business_view?.components?.header?.components?.business?.components?.reviews?.hidden
|
|
41
|
+
const showDistance = !theme?.business_view?.components?.header?.components?.business?.components?.distance?.hidden
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
44
|
<>
|
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import { Select } from '../../../styles/Select'
|
|
4
4
|
import { SearchBar } from '../../SearchBar'
|
|
5
5
|
import { useTheme } from 'styled-components'
|
|
6
|
-
import { useLanguage
|
|
6
|
+
import { useLanguage } from 'ordering-components-external'
|
|
7
7
|
|
|
8
8
|
export const SearchProducts = (props) => {
|
|
9
9
|
const {
|
|
@@ -17,8 +17,7 @@ export const SearchProducts = (props) => {
|
|
|
17
17
|
|
|
18
18
|
const theme = useTheme()
|
|
19
19
|
const [, t] = useLanguage()
|
|
20
|
-
const
|
|
21
|
-
const showSort = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
|
|
20
|
+
const showSort = !theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
|
|
22
21
|
const searchLayout = theme?.business_view?.components?.product_search?.components?.layout?.type
|
|
23
22
|
|
|
24
23
|
return (
|