ordering-ui-external 1.3.2 → 1.4.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.eec38d66166bc4458215.js +1 -0
- package/_bundles/{0.ordering-ui.8d3ec9f208550df10621.js → 1.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/{1.ordering-ui.8d3ec9f208550df10621.js → 2.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/{4.ordering-ui.8d3ec9f208550df10621.js → 4.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/{5.ordering-ui.8d3ec9f208550df10621.js → 5.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/{6.ordering-ui.8d3ec9f208550df10621.js → 6.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/7.ordering-ui.eec38d66166bc4458215.js +2 -0
- package/_bundles/{7.ordering-ui.8d3ec9f208550df10621.js.LICENSE.txt → 7.ordering-ui.eec38d66166bc4458215.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.8d3ec9f208550df10621.js → 8.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/{9.ordering-ui.8d3ec9f208550df10621.js → 9.ordering-ui.eec38d66166bc4458215.js} +1 -1
- package/_bundles/ordering-ui.eec38d66166bc4458215.js +2 -0
- package/_bundles/{ordering-ui.8d3ec9f208550df10621.js.LICENSE.txt → ordering-ui.eec38d66166bc4458215.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +47 -0
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +14 -29
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +10 -6
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +8 -7
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +3 -3
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +4 -1
- package/_modules/themes/five/src/components/Cart/index.js +3 -1
- package/_modules/themes/five/src/components/Checkout/index.js +52 -39
- package/_modules/themes/five/src/components/Favorite/index.js +16 -2
- package/_modules/themes/five/src/components/FavoriteList/index.js +15 -1
- package/_modules/themes/five/src/components/Header/index.js +2 -2
- package/_modules/themes/five/src/components/Header/styles.js +5 -3
- package/_modules/themes/five/src/components/Modal/index.js +2 -2
- package/_modules/themes/five/src/components/Modal/styles.js +8 -4
- package/_modules/themes/five/src/components/MyOrders/index.js +9 -2
- package/_modules/themes/five/src/components/OrderDetails/ActionsSection.js +1 -0
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +10 -40
- package/_modules/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/index.js +25 -0
- package/_modules/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/styles.js +19 -0
- package/_modules/themes/five/src/components/OrdersOption/index.js +16 -13
- package/_modules/themes/five/src/components/ProductForm/index.js +5 -5
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/SidebarMenu/index.js +39 -17
- package/_modules/themes/five/src/components/SingleProductCard/styles.js +1 -1
- package/_modules/themes/five/src/components/SingleProfessionalCard/index.js +95 -0
- package/_modules/themes/five/src/components/SingleProfessionalCard/styles.js +47 -0
- package/_modules/themes/five/src/styles/Selects/index.js +1 -1
- package/index-template.js +28 -5
- package/package.json +6 -3
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +44 -0
- package/src/themes/five/src/components/BusinessListingSearch/index.js +8 -30
- package/src/themes/five/src/components/BusinessProductsList/index.js +29 -22
- package/src/themes/five/src/components/BusinessProductsList/styles.js +25 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +4 -3
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
- package/src/themes/five/src/components/Cart/index.js +2 -0
- package/src/themes/five/src/components/Checkout/index.js +22 -14
- package/src/themes/five/src/components/Favorite/index.js +19 -1
- package/src/themes/five/src/components/FavoriteList/index.js +24 -0
- package/src/themes/five/src/components/Header/index.js +11 -8
- package/src/themes/five/src/components/Header/styles.js +5 -0
- package/src/themes/five/src/components/Modal/index.js +9 -6
- package/src/themes/five/src/components/Modal/styles.js +15 -1
- package/src/themes/five/src/components/MyOrders/index.js +11 -1
- package/src/themes/five/src/components/OrderDetails/ActionsSection.js +1 -0
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -29
- package/src/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/index.js +32 -0
- package/src/themes/five/src/components/OrdersOption/PreviousProfessionalOrdered/styles.js +38 -0
- package/src/themes/five/src/components/OrdersOption/index.js +18 -9
- package/src/themes/five/src/components/ProductForm/index.js +5 -5
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
- package/src/themes/five/src/components/SidebarMenu/index.js +98 -42
- package/src/themes/five/src/components/SingleProductCard/styles.js +5 -1
- package/src/themes/five/src/components/SingleProfessionalCard/index.js +82 -0
- package/src/themes/five/src/components/SingleProfessionalCard/styles.js +92 -0
- package/src/themes/five/src/styles/Selects/index.js +1 -0
- package/template/Utils/index.js +4 -0
- package/template/app.js +554 -143
- package/template/assets/images/business-hero.jpg +0 -0
- package/template/assets/images/business-signup-background.png +0 -0
- package/template/assets/images/business_signup.png +0 -0
- package/template/assets/images/congratulation_approval.png +0 -0
- package/template/assets/images/congratulation_no_approval.png +0 -0
- package/template/assets/images/credit.png +0 -0
- package/template/assets/images/delivery-types/curbside.jpg +0 -0
- package/template/assets/images/delivery-types/delivery.jpg +0 -0
- package/template/assets/images/delivery-types/drive_thru.jpg +0 -0
- package/template/assets/images/delivery-types/eat_in.jpg +0 -0
- package/template/assets/images/delivery-types/pickup.jpg +0 -0
- package/template/assets/images/driver-signup-background.png +0 -0
- package/template/assets/images/driver-signup-hero.png +0 -0
- package/template/assets/images/driver_congratulation_approval.png +0 -0
- package/template/assets/images/driver_congratulation_no_approval.png +0 -0
- package/template/assets/images/driver_signup.png +0 -0
- package/template/assets/images/home-hero.jpg +0 -0
- package/template/assets/images/loyalty_level.png +0 -0
- package/template/assets/images/mastercard.png +0 -0
- package/template/assets/images/not-found.svg +94 -1
- package/template/assets/images/not-network.svg +226 -1
- package/template/assets/images/visa.png +0 -0
- package/template/components/HelmetTags/index.js +5 -4
- package/template/components/ListenPageChanges/index.js +25 -12
- package/template/components/ScrollToTop/index.js +4 -0
- package/template/config.js +14 -0
- package/template/config.json +1 -0
- package/template/helmetdata.json +91 -28
- package/template/pages/AddressList/index.js +34 -0
- package/template/pages/AddressList/styles.js +43 -0
- package/template/pages/BusinessListingSearch/index.js +106 -0
- package/template/pages/BusinessProductsList/index.js +152 -29
- package/template/pages/BusinessesList/index.js +17 -6
- package/template/pages/Checkout/index.js +14 -4
- package/template/pages/Favorite/index.js +12 -0
- package/template/pages/Help/index.js +7 -2
- package/template/pages/Home/index.js +58 -36
- package/template/pages/Home/styles.js +14 -0
- package/template/pages/MessagesList/index.js +19 -0
- package/template/pages/MultiCheckout/index.js +26 -0
- package/template/pages/MultiOrdersDetails/index.js +21 -0
- package/template/pages/MyOrders/index.js +87 -3
- package/template/pages/OrderDetails/index.js +12 -2
- package/template/pages/Profile/index.js +16 -3
- package/template/pages/Promotions/index.js +13 -0
- package/template/pages/ResetPassword/index.js +15 -9
- package/template/pages/SessionsList/index.js +12 -0
- package/template/pages/SignUpBusiness/index.js +12 -0
- package/template/pages/SignUpDriver/index.js +12 -0
- package/template/pages/UserVerification/index.js +12 -0
- package/template/pages/Wallets/index.js +12 -0
- package/template/service-worker.js +72 -0
- package/template/theme.json +27 -51
- package/_bundles/3.ordering-ui.8d3ec9f208550df10621.js +0 -1
- package/_bundles/7.ordering-ui.8d3ec9f208550df10621.js +0 -2
- package/_bundles/ordering-ui.8d3ec9f208550df10621.js +0 -2
- package/template/assets/images/exclamation.svg +0 -3
- package/template/assets/images/order-creating.png +0 -0
- package/template/assets/images/order-sucess.png +0 -0
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Helmet } from 'react-helmet'
|
|
3
3
|
import helmetData from '../../helmetdata.json'
|
|
4
|
+
import settings from '../../config'
|
|
4
5
|
|
|
5
6
|
export const HelmetTags = (props) => {
|
|
6
7
|
const {
|
|
@@ -9,10 +10,10 @@ export const HelmetTags = (props) => {
|
|
|
9
10
|
|
|
10
11
|
const metaTag = page ? helmetData[page] : helmetData.app
|
|
11
12
|
return (
|
|
12
|
-
<Helmet titleTemplate={!page ? '' :
|
|
13
|
-
<title>{props.
|
|
14
|
-
<meta name='description' content={props.description || metaTag.description} />
|
|
15
|
-
<meta name='keywords' content={props.keywords || metaTag.keywords} />
|
|
13
|
+
<Helmet titleTemplate={!page ? '' : `${settings.app_name} - %s`}>
|
|
14
|
+
<title>{props.helmetMetaTags?.title || metaTag.title}</title>
|
|
15
|
+
<meta name='description' content={props.helmetMetaTags?.description || metaTag.description} />
|
|
16
|
+
<meta name='keywords' content={props.helmetMetaTags?.keywords || metaTag.keywords} />
|
|
16
17
|
{props.robots ? (
|
|
17
18
|
<meta name='robots' content={props.robots} />
|
|
18
19
|
) : (
|
|
@@ -1,34 +1,47 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { useHistory } from 'react-router-dom'
|
|
3
|
-
import { useEvent, useLanguage } from 'ordering-components-external'
|
|
3
|
+
import { useEvent, useLanguage, useSite } from 'ordering-components-external'
|
|
4
4
|
import { useTheme } from '../../../src/contexts/ThemeContext'
|
|
5
|
+
import { checkSiteUrl } from '../../Utils'
|
|
5
6
|
|
|
6
7
|
export const ListenPageChanges = ({ children }) => {
|
|
7
8
|
const history = useHistory()
|
|
8
9
|
const [events] = useEvent()
|
|
9
10
|
const [languageState] = useLanguage()
|
|
10
11
|
const [theme, { merge }] = useTheme()
|
|
12
|
+
const [{ site }] = useSite()
|
|
13
|
+
|
|
14
|
+
const businessUrlChecked = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
15
|
+
const businessUrl = businessUrlChecked.includes('?') ? businessUrlChecked.split('?')[0] : businessUrlChecked
|
|
16
|
+
|
|
17
|
+
const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
|
|
18
|
+
const productUrl = productUrlTemplate.includes('?') ? productUrlTemplate.split('?')[0] : productUrlTemplate
|
|
11
19
|
|
|
12
20
|
const routes = {
|
|
13
21
|
home: '/',
|
|
14
22
|
search: '/search',
|
|
15
|
-
delivery: '/delivery',
|
|
16
|
-
pickup: '/pickup',
|
|
17
|
-
eatin: '/eatin',
|
|
18
|
-
curbside: '/curbside',
|
|
19
|
-
drivethru: '/drivethru',
|
|
20
|
-
signup: '/signup',
|
|
21
|
-
signin: '/signin',
|
|
22
23
|
profile: '/profile',
|
|
24
|
+
messages: '/messages',
|
|
25
|
+
verify: '/verify',
|
|
26
|
+
wallets: '/wallets',
|
|
27
|
+
help: '/help',
|
|
28
|
+
signup_business: '/signup_business',
|
|
29
|
+
signup_driver: '/signup-driver',
|
|
23
30
|
orders: '/profile/orders',
|
|
24
31
|
order_detail: '/orders/:orderId',
|
|
25
32
|
checkout: '/checkout/:cartUuid',
|
|
26
33
|
checkout_list: '/checkout',
|
|
27
|
-
|
|
34
|
+
multi_checkout: '/multi-checkout',
|
|
35
|
+
multi_orders: '/multi-orders',
|
|
36
|
+
business: businessUrl,
|
|
28
37
|
business_slug: '/:store',
|
|
29
|
-
|
|
38
|
+
product: productUrl,
|
|
39
|
+
business_search: '/business_search',
|
|
30
40
|
reset_password: '/password/reset',
|
|
31
|
-
|
|
41
|
+
sessions: '/sessions',
|
|
42
|
+
promotions: '/promotions',
|
|
43
|
+
addresses: '/profile/addresses',
|
|
44
|
+
favorite: '/favorite'
|
|
32
45
|
}
|
|
33
46
|
|
|
34
47
|
const handleGoToPage = ({ page, params = {}, search, replace = false }) => {
|
|
@@ -83,7 +96,7 @@ export const ListenPageChanges = ({ children }) => {
|
|
|
83
96
|
events.off('go_to_page', handleGoToPage)
|
|
84
97
|
events.off('get_current_view', handleGetCurrentView)
|
|
85
98
|
}
|
|
86
|
-
}, [
|
|
99
|
+
}, [])
|
|
87
100
|
|
|
88
101
|
useEffect(() => {
|
|
89
102
|
if (theme.rtl !== languageState?.language?.rtl) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { withRouter } from 'react-router-dom'
|
|
3
|
+
import { useSite } from 'ordering-components-external'
|
|
4
|
+
import { checkSiteUrl } from '../../Utils'
|
|
3
5
|
|
|
4
6
|
export const ScrollToTop = withRouter(({ history, children }) => {
|
|
7
|
+
const [{ site }] = useSite()
|
|
8
|
+
const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
|
|
5
9
|
useEffect(() => {
|
|
6
10
|
const unlisten = history.listen((data) => {
|
|
7
11
|
if (!window.location.pathname.includes('/store/')) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import settings from './config.json'
|
|
2
|
+
|
|
3
|
+
const keysToNull = [
|
|
4
|
+
'franchiseSlug',
|
|
5
|
+
'businessSlug'
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
keysToNull.forEach(key => {
|
|
9
|
+
if (settings[key] === '0' || settings[key] === 'null') {
|
|
10
|
+
settings[key] = null
|
|
11
|
+
};
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export default settings
|
package/template/config.json
CHANGED
package/template/helmetdata.json
CHANGED
|
@@ -13,34 +13,6 @@
|
|
|
13
13
|
"robots": "index, follow",
|
|
14
14
|
"canonicalUrl": ""
|
|
15
15
|
},
|
|
16
|
-
"login": {
|
|
17
|
-
"title": "Login",
|
|
18
|
-
"description": "a dummy description about this page",
|
|
19
|
-
"keywords": "test, dummy, data",
|
|
20
|
-
"robots": "index, follow",
|
|
21
|
-
"canonicalUrl": ""
|
|
22
|
-
},
|
|
23
|
-
"signup": {
|
|
24
|
-
"title": "Signup",
|
|
25
|
-
"description": "a dummy description about this page",
|
|
26
|
-
"keywords": "test, dummy, data",
|
|
27
|
-
"robots": "index, follow",
|
|
28
|
-
"canonicalUrl": ""
|
|
29
|
-
},
|
|
30
|
-
"forgotpassword": {
|
|
31
|
-
"title": "Forgot Password",
|
|
32
|
-
"description": "a dummy description about this page",
|
|
33
|
-
"keywords": "test, dummy, data",
|
|
34
|
-
"robots": "index, follow",
|
|
35
|
-
"canonicalUrl": ""
|
|
36
|
-
},
|
|
37
|
-
"resetpassword": {
|
|
38
|
-
"title": "Reset Password",
|
|
39
|
-
"description": "a dummy description about this page",
|
|
40
|
-
"keywords": "test, dummy, data",
|
|
41
|
-
"robots": "index, follow",
|
|
42
|
-
"canonicalUrl": ""
|
|
43
|
-
},
|
|
44
16
|
"profile": {
|
|
45
17
|
"title": "Profile",
|
|
46
18
|
"description": "a dummy description about this page",
|
|
@@ -117,5 +89,96 @@
|
|
|
117
89
|
"keywords": "test, dummy, data",
|
|
118
90
|
"robots": "index, follow",
|
|
119
91
|
"canonicalUrl": ""
|
|
92
|
+
},
|
|
93
|
+
"signup_business": {
|
|
94
|
+
"title": "SignUp for business",
|
|
95
|
+
"description": "a dummy description about this page",
|
|
96
|
+
"keywords": "test, dummy, data",
|
|
97
|
+
"robots": "index, follow",
|
|
98
|
+
"canonicalUrl": ""
|
|
99
|
+
},
|
|
100
|
+
"messages": {
|
|
101
|
+
"title": "Messages",
|
|
102
|
+
"description": "a dummy description about this page",
|
|
103
|
+
"keywords": "test, dummy, data",
|
|
104
|
+
"robots": "index, follow",
|
|
105
|
+
"canonicalUrl": ""
|
|
106
|
+
},
|
|
107
|
+
"wallets": {
|
|
108
|
+
"title": "Wallets",
|
|
109
|
+
"description": "a dummy description about this page",
|
|
110
|
+
"keywords": "test, dummy, data",
|
|
111
|
+
"robots": "index, follow",
|
|
112
|
+
"canonicalUrl": ""
|
|
113
|
+
},
|
|
114
|
+
"user-verification": {
|
|
115
|
+
"title": "User Verification",
|
|
116
|
+
"description": "a dummy description about this page",
|
|
117
|
+
"keywords": "test, dummy, data",
|
|
118
|
+
"robots": "index, follow",
|
|
119
|
+
"canonicalUrl": ""
|
|
120
|
+
},
|
|
121
|
+
"business_search": {
|
|
122
|
+
"title": "Business Search",
|
|
123
|
+
"description": "a dummy description about this page",
|
|
124
|
+
"keywords": "test, dummy, data",
|
|
125
|
+
"robots": "index, follow",
|
|
126
|
+
"canonicalUrl": ""
|
|
127
|
+
},
|
|
128
|
+
"resetpassword": {
|
|
129
|
+
"title": "Reset Password",
|
|
130
|
+
"description": "a dummy description about this page",
|
|
131
|
+
"keywords": "test, dummy, data",
|
|
132
|
+
"robots": "index, follow",
|
|
133
|
+
"canonicalUrl": ""
|
|
134
|
+
},
|
|
135
|
+
"sessions": {
|
|
136
|
+
"title": "Sessions",
|
|
137
|
+
"description": "a dummy description about this page",
|
|
138
|
+
"keywords": "test, dummy, data",
|
|
139
|
+
"robots": "index, follow",
|
|
140
|
+
"canonicalUrl": ""
|
|
141
|
+
},
|
|
142
|
+
"signup_driver": {
|
|
143
|
+
"title": "SignUp for driver",
|
|
144
|
+
"description": "a dummy description about this page",
|
|
145
|
+
"keywords": "test, dummy, data",
|
|
146
|
+
"robots": "index, follow",
|
|
147
|
+
"canonicalUrl": ""
|
|
148
|
+
},
|
|
149
|
+
"promotions": {
|
|
150
|
+
"title": "Promotions",
|
|
151
|
+
"description": "a dummy description about this page",
|
|
152
|
+
"keywords": "test, dummy, data",
|
|
153
|
+
"robots": "index, follow",
|
|
154
|
+
"canonicalUrl": ""
|
|
155
|
+
},
|
|
156
|
+
"addresses": {
|
|
157
|
+
"title": "Addresses",
|
|
158
|
+
"description": "a dummy description about this page",
|
|
159
|
+
"keywords": "test, dummy, data",
|
|
160
|
+
"robots": "index, follow",
|
|
161
|
+
"canonicalUrl": ""
|
|
162
|
+
},
|
|
163
|
+
"favorite": {
|
|
164
|
+
"title": "Favorite",
|
|
165
|
+
"description": "a dummy description about this page",
|
|
166
|
+
"keywords": "test, dummy, data",
|
|
167
|
+
"robots": "index, follow",
|
|
168
|
+
"canonicalUrl": ""
|
|
169
|
+
},
|
|
170
|
+
"multi_checkout": {
|
|
171
|
+
"title": "Multi checkout",
|
|
172
|
+
"description": "a dummy description about this page",
|
|
173
|
+
"keywords": "test, dummy, data",
|
|
174
|
+
"robots": "index, follow",
|
|
175
|
+
"canonicalUrl": ""
|
|
176
|
+
},
|
|
177
|
+
"multi_orders": {
|
|
178
|
+
"title": "Multi Orders",
|
|
179
|
+
"description": "a dummy description about this page",
|
|
180
|
+
"keywords": "test, dummy, data",
|
|
181
|
+
"robots": "index, follow",
|
|
182
|
+
"canonicalUrl": ""
|
|
120
183
|
}
|
|
121
184
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { AddressList as AddressListController } from '../../../src/themes/five/src/components/AddressList'
|
|
3
|
+
import { ProfileOptions } from '../../../src/themes/five/src/components/UserProfileForm/ProfileOptions'
|
|
4
|
+
import { useLanguage, useSession, useOrderingTheme } from 'ordering-components-external'
|
|
5
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
6
|
+
import { SavedPlaces } from './styles'
|
|
7
|
+
|
|
8
|
+
export const AddressList = (props) => {
|
|
9
|
+
const [{ user }] = useSession()
|
|
10
|
+
const [, t] = useLanguage()
|
|
11
|
+
const [orderingTheme] = useOrderingTheme()
|
|
12
|
+
const addressListParams = {
|
|
13
|
+
...props,
|
|
14
|
+
addressList: user?.addresses,
|
|
15
|
+
isProfile: true,
|
|
16
|
+
isModal: true
|
|
17
|
+
}
|
|
18
|
+
const showProfileOptions = orderingTheme?.theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<HelmetTags page='addresses' />
|
|
23
|
+
{showProfileOptions && (
|
|
24
|
+
<ProfileOptions value='addresses' />
|
|
25
|
+
)}
|
|
26
|
+
<SavedPlaces>
|
|
27
|
+
<h1>
|
|
28
|
+
{t('SAVED_PLACES', 'Saved places')}
|
|
29
|
+
</h1>
|
|
30
|
+
<AddressListController {...addressListParams} />
|
|
31
|
+
</SavedPlaces>
|
|
32
|
+
</>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const SavedPlaces = styled.div`
|
|
4
|
+
width: 90%;
|
|
5
|
+
text-align: center;
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
margin-top: 40px;
|
|
8
|
+
margin-bottom: 20px;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
h1{
|
|
12
|
+
font-size: 24px;
|
|
13
|
+
text-align: left;
|
|
14
|
+
${props => props.theme?.rtl && css`
|
|
15
|
+
text-align: right;
|
|
16
|
+
`}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
> div{
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column-reverse;
|
|
22
|
+
align-items: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
button{
|
|
26
|
+
width: 100%;
|
|
27
|
+
align-self: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (min-width: 768px){
|
|
31
|
+
width: 90%;
|
|
32
|
+
margin-top: 40px;
|
|
33
|
+
h1 {
|
|
34
|
+
text-align: center;
|
|
35
|
+
}
|
|
36
|
+
ul{
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
button {
|
|
40
|
+
width: 65%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
|
+
import { BusinessListingSearch as BusinessListingSearchController } from '../../../src/themes/five/src/components/BusinessListingSearch'
|
|
4
|
+
import { useEvent, useSite } from 'ordering-components-external'
|
|
5
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
6
|
+
import { checkSiteUrl } from '../../Utils'
|
|
7
|
+
|
|
8
|
+
export const BusinessListingSearch = (props) => {
|
|
9
|
+
const [events] = useEvent()
|
|
10
|
+
const { search } = useLocation()
|
|
11
|
+
const searchParams = new URLSearchParams(search)
|
|
12
|
+
const defaultTerm = searchParams.get('term') || ''
|
|
13
|
+
|
|
14
|
+
const [{ site }] = useSite()
|
|
15
|
+
const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
16
|
+
const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
|
|
17
|
+
|
|
18
|
+
const businessListingProps = {
|
|
19
|
+
...props,
|
|
20
|
+
defaultTerm: defaultTerm,
|
|
21
|
+
onBusinessClick: (business) => {
|
|
22
|
+
if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
|
|
23
|
+
events.emit('go_to_page', { page: 'business', params: { business_slug: business.slug } })
|
|
24
|
+
} else {
|
|
25
|
+
events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${business.slug}` })
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
onRedirectPage: (data) => {
|
|
29
|
+
if (data.page === 'business') {
|
|
30
|
+
const businessSlug = data.params?.store
|
|
31
|
+
if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
|
|
32
|
+
events.emit('go_to_page', { page: 'business', params: { business_slug: businessSlug } })
|
|
33
|
+
} else {
|
|
34
|
+
events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${businessSlug}` })
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
events.emit('go_to_page', data)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
onProductRedirect: ({ slug, category, product }) => {
|
|
41
|
+
if (!category && !product) {
|
|
42
|
+
if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
|
|
43
|
+
return events.emit('go_to_page', { page: 'business', params: { business_slug: slug } })
|
|
44
|
+
} else {
|
|
45
|
+
return events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${slug}` })
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (productUrlTemplate === '/store/:business_slug/:category_slug/:product_slug' || productUrlTemplate === '/:business_slug/:category_slug/:product_slug') {
|
|
49
|
+
return events.emit('go_to_page', {
|
|
50
|
+
page: 'product',
|
|
51
|
+
params: {
|
|
52
|
+
business_slug: slug,
|
|
53
|
+
category_slug: category,
|
|
54
|
+
product_slug: product
|
|
55
|
+
},
|
|
56
|
+
replace: true
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
if (productUrlTemplate.includes('/store/:category_slug/:product_slug')) {
|
|
60
|
+
const businessParameter = businessUrlTemplate.replace('/store?', '').replace('=:business_slug', '')
|
|
61
|
+
return events.emit('go_to_page', {
|
|
62
|
+
page: 'product',
|
|
63
|
+
params: {
|
|
64
|
+
category_slug: category,
|
|
65
|
+
product_slug: product
|
|
66
|
+
},
|
|
67
|
+
search: `?${businessParameter}=${slug}`,
|
|
68
|
+
replace: true
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
if (productUrlTemplate.includes('/store/:business_slug') && productUrlTemplate.includes('category_id')) {
|
|
72
|
+
const ids = productUrlTemplate.split('?')[1].split('&')
|
|
73
|
+
const categoryParameter = ids[0].replace('=:category_id', '')
|
|
74
|
+
const productParameter = ids[1].replace('=:product_id', '')
|
|
75
|
+
return events.emit('go_to_page', {
|
|
76
|
+
page: 'product',
|
|
77
|
+
params: {
|
|
78
|
+
business_slug: slug,
|
|
79
|
+
},
|
|
80
|
+
search: `?${categoryParameter}=${category}&${productParameter}=${product}`,
|
|
81
|
+
replace: true
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
if (productUrlTemplate.includes('/:business_slug') && !productUrlTemplate.includes('store')) {
|
|
85
|
+
const ids = productUrlTemplate.split('?')[1].split('&')
|
|
86
|
+
const categoryParameter = ids[0].replace('=:category_id', '')
|
|
87
|
+
const productParameter = ids[1].replace('=:product_id', '')
|
|
88
|
+
return events.emit('go_to_page', {
|
|
89
|
+
page: 'product',
|
|
90
|
+
params: {
|
|
91
|
+
business_slug: slug,
|
|
92
|
+
},
|
|
93
|
+
search: `?${categoryParameter}=${category}&${productParameter}=${product}`,
|
|
94
|
+
replace: true
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<HelmetTags page='business_search' />
|
|
103
|
+
<BusinessListingSearchController {...businessListingProps} />
|
|
104
|
+
</>
|
|
105
|
+
)
|
|
106
|
+
}
|