ordering-ui-external 10.1.0 → 10.2.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.e9827c5566d8cce0eaa4.js → 0.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.8384f3801abcc340af2a.js} +2 -2
- package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/ordering-ui.8384f3801abcc340af2a.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 +11 -14
- 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/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 +3 -6
- 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/OrderTypeSelectorContent/index.js +11 -1
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
- package/_modules/themes/five/src/components/PageBanner/index.js +75 -54
- 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/SingleProductCard/layouts/starbucks/index.js +0 -3
- 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 +2 -4
- 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/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 +2 -4
- 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/OrderTypeSelectorContent/index.js +13 -1
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
- package/src/themes/five/src/components/PageBanner/index.js +64 -50
- 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/SingleProductCard/layouts/starbucks/index.js +1 -2
- 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.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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 (
|
package/template/app.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import PWAPrompt from 'react-ios-pwa-prompt'
|
|
3
|
-
import { useTheme
|
|
3
|
+
import { useTheme } from 'styled-components'
|
|
4
|
+
import { ThemeProvider } from '../src/contexts/ThemeContext'
|
|
4
5
|
import loadable from '@loadable/component'
|
|
5
6
|
import {
|
|
6
7
|
Switch,
|
|
@@ -28,7 +29,6 @@ import { useOnlineStatus } from '../src/hooks/useOnlineStatus'
|
|
|
28
29
|
import { useWindowSize } from '../src/hooks/useWindowSize'
|
|
29
30
|
|
|
30
31
|
import settings from './config'
|
|
31
|
-
import { orderingThemeUpdated } from './components/OrderingThemeUpdated'
|
|
32
32
|
|
|
33
33
|
import { SpinnerLoader } from '../src/components/SpinnerLoader'
|
|
34
34
|
import { Input } from '../src/themes/five/src/styles/Inputs'
|
|
@@ -134,7 +134,8 @@ export const App = () => {
|
|
|
134
134
|
colors: {
|
|
135
135
|
...theme.colors,
|
|
136
136
|
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color && { primary: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color }),
|
|
137
|
-
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color && { links: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color })
|
|
137
|
+
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color && { links: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color }),
|
|
138
|
+
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.background_page && { backgroundPage: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.background_page })
|
|
138
139
|
},
|
|
139
140
|
images: {
|
|
140
141
|
...theme.images,
|
|
@@ -170,6 +171,10 @@ export const App = () => {
|
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
|
|
174
|
+
const websiteThemeType = themeUpdated?.theme?.my_products?.components?.website_theme?.components?.type
|
|
175
|
+
const websiteThemeBusinessSlug = themeUpdated?.theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
176
|
+
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
177
|
+
|
|
173
178
|
const businessesSlug = {
|
|
174
179
|
marketplace: 'marketplace',
|
|
175
180
|
kiosk: settings?.businessSlug
|
|
@@ -180,21 +185,21 @@ export const App = () => {
|
|
|
180
185
|
businessSlug: businessesSlug[isKioskApp ? 'kiosk' : 'marketplace']
|
|
181
186
|
}
|
|
182
187
|
|
|
183
|
-
const signUpBusinesslayout =
|
|
188
|
+
const signUpBusinesslayout = themeUpdated?.theme?.business_signup?.components?.layout?.type === 'old'
|
|
184
189
|
? 'old'
|
|
185
190
|
: 'new'
|
|
186
191
|
|
|
187
|
-
const signUpDriverlayout =
|
|
192
|
+
const signUpDriverlayout = themeUpdated?.theme?.driver_signup?.components?.layout?.type === 'old'
|
|
188
193
|
? 'old'
|
|
189
194
|
: 'new'
|
|
190
195
|
|
|
191
196
|
const HeaderComponent =
|
|
192
197
|
isKioskApp ? HeaderKiosk
|
|
193
|
-
:
|
|
198
|
+
: themeUpdated?.theme?.header?.components?.layout?.type === 'old'
|
|
194
199
|
? HeaderOld
|
|
195
|
-
:
|
|
200
|
+
: themeUpdated?.theme?.header?.components?.layout?.type === 'red'
|
|
196
201
|
? HeaderRed
|
|
197
|
-
:
|
|
202
|
+
: themeUpdated?.theme?.header?.components?.layout?.type === 'starbucks'
|
|
198
203
|
? HeaderStarbucks
|
|
199
204
|
: Header
|
|
200
205
|
|
|
@@ -205,7 +210,7 @@ export const App = () => {
|
|
|
205
210
|
const isEmailVerifyRequired = auth && configs?.verification_email_required?.value === '1' && !user?.email_verified
|
|
206
211
|
const isPhoneVerifyRequired = auth && configs?.verification_phone_required?.value === '1' && !user?.phone_verified
|
|
207
212
|
const isUserVerifyRequired = (isEmailVerifyRequired || isPhoneVerifyRequired) && !isKioskApp
|
|
208
|
-
const isHideFooter =
|
|
213
|
+
const isHideFooter = themeUpdated?.theme?.footer?.hidden
|
|
209
214
|
|
|
210
215
|
const isHome = location.pathname === '/' || location.pathname === '/home'
|
|
211
216
|
const isFooterPage = location.pathname === '/pages/footer' || isKioskApp || isHideFooter
|
|
@@ -524,7 +529,7 @@ export const App = () => {
|
|
|
524
529
|
{
|
|
525
530
|
loaded && (
|
|
526
531
|
<ThemeProvider
|
|
527
|
-
theme={
|
|
532
|
+
theme={themeUpdated}
|
|
528
533
|
>
|
|
529
534
|
<ListenPageChanges />
|
|
530
535
|
{!(isKioskApp && isHome) && (
|
|
@@ -2,13 +2,14 @@ import React from 'react'
|
|
|
2
2
|
import { Helmet } from 'react-helmet'
|
|
3
3
|
import helmetData from '../../helmetdata.json'
|
|
4
4
|
import settings from '../../config'
|
|
5
|
-
import { useConfig
|
|
5
|
+
import { useConfig } from 'ordering-components-external'
|
|
6
|
+
import { useTheme } from 'styled-components'
|
|
6
7
|
|
|
7
8
|
export const HelmetTags = (props) => {
|
|
8
9
|
const {
|
|
9
10
|
page
|
|
10
11
|
} = props
|
|
11
|
-
const
|
|
12
|
+
const theme = useTheme()
|
|
12
13
|
const [configs] = useConfig()
|
|
13
14
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
14
15
|
const metaTag = page ? helmetData[page] : helmetData.app
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { AddressList as AddressListController } from '../../../src/themes/five/src/components/AddressList'
|
|
3
3
|
import { ProfileOptions } from '../../../src/themes/five/src/components/UserProfileForm/ProfileOptions'
|
|
4
|
-
import { useLanguage, useSession
|
|
4
|
+
import { useLanguage, useSession } from 'ordering-components-external'
|
|
5
5
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
6
6
|
import { SavedPlaces } from './styles'
|
|
7
|
+
import { useTheme } from 'styled-components'
|
|
7
8
|
|
|
8
9
|
export const AddressList = (props) => {
|
|
9
10
|
const [{ user }] = useSession()
|
|
10
11
|
const [, t] = useLanguage()
|
|
11
|
-
const
|
|
12
|
+
const theme = useTheme()
|
|
12
13
|
const addressListParams = {
|
|
13
14
|
...props,
|
|
14
15
|
addressList: user?.addresses,
|
|
15
16
|
isProfile: true,
|
|
16
17
|
isModal: true
|
|
17
18
|
}
|
|
18
|
-
const showProfileOptions =
|
|
19
|
+
const showProfileOptions = theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<>
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useParams, useLocation } from 'react-router-dom'
|
|
3
|
-
import { useApi, useEvent, useSite
|
|
3
|
+
import { useApi, useEvent, useSite } from 'ordering-components-external'
|
|
4
4
|
import { BusinessProductsListing } from '../../../src/themes/five/src/components/BusinessProductsListing'
|
|
5
5
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
6
6
|
import { capitalize } from '../../../src/utils'
|
|
7
7
|
import settings from '../../config'
|
|
8
8
|
import { checkSiteUrl } from '../../Utils'
|
|
9
|
+
import { useTheme } from 'styled-components'
|
|
9
10
|
|
|
10
11
|
export const BusinessProductsList = (props) => {
|
|
11
12
|
const [{ site }] = useSite()
|
|
12
13
|
const { search } = useLocation()
|
|
13
|
-
const
|
|
14
|
+
const theme = useTheme()
|
|
14
15
|
|
|
15
|
-
const websiteThemeType =
|
|
16
|
-
const websiteThemeBusinessSlug =
|
|
16
|
+
const websiteThemeType = theme?.my_products?.components?.website_theme?.components?.type
|
|
17
|
+
const websiteThemeBusinessSlug = theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
17
18
|
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
18
19
|
|
|
19
20
|
const [helmetMetaTags, setHelmetMetaTags] = useState({
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { BusinessesListing } from '../../../src/themes/five/src/components/BusinessesListing'
|
|
3
|
-
import { useEvent, useSite
|
|
3
|
+
import { useEvent, useSite } from 'ordering-components-external'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
import settings from '../../config'
|
|
6
6
|
import { checkSiteUrl } from '../../Utils'
|
|
7
|
+
import { useTheme } from 'styled-components'
|
|
7
8
|
|
|
8
9
|
export const BusinessesList = (props) => {
|
|
9
10
|
const [events] = useEvent()
|
|
10
11
|
const [{ site }] = useSite()
|
|
11
|
-
const
|
|
12
|
-
|
|
12
|
+
const theme = useTheme()
|
|
13
13
|
const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
14
14
|
|
|
15
|
-
const websiteThemeType =
|
|
16
|
-
const websiteThemeBusinessSlug =
|
|
15
|
+
const websiteThemeType = theme?.my_products?.components?.website_theme?.components?.type
|
|
16
|
+
const websiteThemeBusinessSlug = theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
17
17
|
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
18
|
-
const websiteThemeFranchiseSlug =
|
|
18
|
+
const websiteThemeFranchiseSlug = theme?.my_products?.components?.website_theme?.components?.franchise_slug
|
|
19
19
|
const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
|
|
20
20
|
|
|
21
21
|
const businessListingProps = {
|
|
@@ -4,9 +4,10 @@ import { useParams, useLocation } from 'react-router-dom'
|
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
|
|
6
6
|
import { Checkout } from '../../../src/themes/five/src/components/Checkout'
|
|
7
|
-
import { useEvent, useOrder, useLanguage, useSite
|
|
7
|
+
import { useEvent, useOrder, useLanguage, useSite } from 'ordering-components-external'
|
|
8
8
|
import settings from '../../config'
|
|
9
9
|
import { checkSiteUrl } from '../../Utils'
|
|
10
|
+
import { useTheme } from 'styled-components'
|
|
10
11
|
|
|
11
12
|
export const CheckoutPage = (props) => {
|
|
12
13
|
const { cartUuid } = useParams()
|
|
@@ -15,9 +16,10 @@ export const CheckoutPage = (props) => {
|
|
|
15
16
|
const [orderState, { confirmCart, changeMoment }] = useOrder()
|
|
16
17
|
const [, t] = useLanguage()
|
|
17
18
|
const [{ site }] = useSite()
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
19
|
+
const theme = useTheme()
|
|
20
|
+
|
|
21
|
+
const websiteThemeType = theme?.my_products?.components?.website_theme?.components?.type
|
|
22
|
+
const websiteThemeBusinessSlug = theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
21
23
|
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
22
24
|
|
|
23
25
|
const stripePayments = ['stripe', 'stripe_connect', 'stripe_direct', 'google_pay', 'apple_pay']
|