ordering-ui-external 2.7.2 → 3.0.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/{7.ordering-ui.0a58ae9fc1a4bce64c6e.js → 7.ordering-ui.5fbb70216ae0e9633027.js} +1 -1
- package/_bundles/ordering-ui.5fbb70216ae0e9633027.js +2 -0
- package/_modules/themes/five/src/components/BusinessInformation/index.js +9 -9
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +1 -1
- package/_modules/themes/five/src/components/OrderContextUI/index.js +1 -1
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/styles.js +1 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +20 -10
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +5 -3
- package/_modules/themes/five/src/components/ScheduleAccordion/index.js +3 -3
- package/package.json +2 -2
- package/src/components/MomentContent/index.js +1 -1
- package/src/themes/callcenterOriginal/src/components/Shared/Modal/index.js +1 -1
- package/src/themes/five/src/components/BusinessInformation/index.js +7 -5
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/index.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- package/src/themes/five/src/components/Header/index.js +1 -1
- package/src/themes/five/src/components/OrderContextUI/index.js +1 -1
- package/src/themes/five/src/components/OrderContextUI/styles.js +1 -1
- package/src/themes/five/src/components/ProductForm/styles.js +2 -2
- package/src/themes/five/src/components/RenderProductsLayout/index.js +16 -3
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +11 -0
- package/src/themes/five/src/components/ScheduleAccordion/index.js +4 -4
- package/src/themes/two/src/components/Header/index.js +1 -1
- package/template/app.js +10 -6
- package/template/pages/BusinessProductsList/index.js +10 -4
- package/template/pages/BusinessesList/index.js +11 -4
- package/template/pages/Checkout/index.js +7 -2
- package/template/pages/Home/index.js +5 -2
- package/template/pages/MessagesList/index.js +7 -2
- package/template/pages/MyOrders/index.js +10 -3
- package/_bundles/ordering-ui.0a58ae9fc1a4bce64c6e.js +0 -2
- /package/_bundles/{0.ordering-ui.0a58ae9fc1a4bce64c6e.js → 0.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{1.ordering-ui.0a58ae9fc1a4bce64c6e.js → 1.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{2.ordering-ui.0a58ae9fc1a4bce64c6e.js → 2.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{4.ordering-ui.0a58ae9fc1a4bce64c6e.js → 4.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{5.ordering-ui.0a58ae9fc1a4bce64c6e.js → 5.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{6.ordering-ui.0a58ae9fc1a4bce64c6e.js → 6.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{7.ordering-ui.0a58ae9fc1a4bce64c6e.js.LICENSE.txt → 7.ordering-ui.5fbb70216ae0e9633027.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.0a58ae9fc1a4bce64c6e.js → 8.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{9.ordering-ui.0a58ae9fc1a4bce64c6e.js → 9.ordering-ui.5fbb70216ae0e9633027.js} +0 -0
- /package/_bundles/{ordering-ui.0a58ae9fc1a4bce64c6e.js.LICENSE.txt → ordering-ui.5fbb70216ae0e9633027.js.LICENSE.txt} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useParams, useLocation } from 'react-router-dom'
|
|
3
|
-
import { useApi, useEvent, useSite } from 'ordering-components-external'
|
|
3
|
+
import { useApi, useEvent, useSite, useOrderingTheme } 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'
|
|
@@ -10,6 +10,12 @@ import { checkSiteUrl } from '../../Utils'
|
|
|
10
10
|
export const BusinessProductsList = (props) => {
|
|
11
11
|
const [{ site }] = useSite()
|
|
12
12
|
const { search } = useLocation()
|
|
13
|
+
const [orderingTheme] = useOrderingTheme()
|
|
14
|
+
|
|
15
|
+
const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
|
|
16
|
+
const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
17
|
+
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
18
|
+
|
|
13
19
|
const [helmetMetaTags, setHelmetMetaTags] = useState({
|
|
14
20
|
title: '',
|
|
15
21
|
description: '',
|
|
@@ -19,7 +25,7 @@ export const BusinessProductsList = (props) => {
|
|
|
19
25
|
let businessSlug = ''
|
|
20
26
|
const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
21
27
|
const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
|
|
22
|
-
|
|
28
|
+
|
|
23
29
|
if (businessUrlTemplate.includes('?')) {
|
|
24
30
|
const businessParameter = businessUrlTemplate.replace('/store?', '').replace('=:business_slug', '')
|
|
25
31
|
const params = new URLSearchParams(search)
|
|
@@ -82,11 +88,11 @@ export const BusinessProductsList = (props) => {
|
|
|
82
88
|
...props,
|
|
83
89
|
ordering,
|
|
84
90
|
avoidBusinessLoading: true,
|
|
85
|
-
isCustomLayout: settings?.use_marketplace ||
|
|
91
|
+
isCustomLayout: settings?.use_marketplace || updatedBusinessSlug,
|
|
86
92
|
useKioskApp: settings?.use_kiosk,
|
|
87
93
|
isSearchByName: true,
|
|
88
94
|
isSearchByDescription: true,
|
|
89
|
-
slug:
|
|
95
|
+
slug: updatedBusinessSlug || businessSlug,
|
|
90
96
|
categoryId,
|
|
91
97
|
productId,
|
|
92
98
|
businessProps: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { BusinessesListing } from '../../../src/themes/five/src/components/BusinessesListing'
|
|
3
|
-
import { useEvent, useSite } from 'ordering-components-external'
|
|
3
|
+
import { useEvent, useSite, useOrderingTheme } from 'ordering-components-external'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
import settings from '../../config'
|
|
6
6
|
import { checkSiteUrl } from '../../Utils'
|
|
@@ -8,15 +8,22 @@ import { checkSiteUrl } from '../../Utils'
|
|
|
8
8
|
export const BusinessesList = (props) => {
|
|
9
9
|
const [events] = useEvent()
|
|
10
10
|
const [{ site }] = useSite()
|
|
11
|
+
const [orderingTheme] = useOrderingTheme()
|
|
11
12
|
|
|
12
13
|
const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
13
14
|
|
|
15
|
+
const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
|
|
16
|
+
const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
17
|
+
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
18
|
+
const websiteThemeFranchiseSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.franchise_slug
|
|
19
|
+
const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
|
|
20
|
+
|
|
14
21
|
const businessListingProps = {
|
|
15
22
|
...props,
|
|
16
23
|
isSearchByName: true,
|
|
17
24
|
isSearchByDescription: true,
|
|
18
|
-
franchiseId:
|
|
19
|
-
businessId:
|
|
25
|
+
franchiseId: updatedFranchiseSlug,
|
|
26
|
+
businessId: updatedBusinessSlug,
|
|
20
27
|
onBusinessClick: (business) => {
|
|
21
28
|
if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
|
|
22
29
|
events.emit('go_to_page', { page: 'business', params: { business_slug: business.slug } })
|
|
@@ -26,7 +33,7 @@ export const BusinessesList = (props) => {
|
|
|
26
33
|
},
|
|
27
34
|
currentPageParam: 0,
|
|
28
35
|
propsToFetch: ['id', 'name', 'header', 'logo', 'location', 'address', 'ribbon', 'timezone', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug', 'city', 'city_id', 'menus'],
|
|
29
|
-
onRedirectPage: (data) => events.emit('go_to_page', data)
|
|
36
|
+
onRedirectPage: (data) => events.emit('go_to_page', data)
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
return (
|
|
@@ -4,7 +4,7 @@ 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 } from 'ordering-components-external'
|
|
7
|
+
import { useEvent, useOrder, useLanguage, useSite, useOrderingTheme } from 'ordering-components-external'
|
|
8
8
|
import settings from '../../config'
|
|
9
9
|
import { checkSiteUrl } from '../../Utils'
|
|
10
10
|
|
|
@@ -15,6 +15,11 @@ export const CheckoutPage = (props) => {
|
|
|
15
15
|
const [orderState, { confirmCart, changeMoment }] = useOrder()
|
|
16
16
|
const [, t] = useLanguage()
|
|
17
17
|
const [{ site }] = useSite()
|
|
18
|
+
const [orderingTheme] = useOrderingTheme()
|
|
19
|
+
const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
|
|
20
|
+
const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
21
|
+
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
22
|
+
|
|
18
23
|
const stripePayments = ['stripe', 'stripe_connect', 'stripe_direct', 'google_pay', 'apple_pay']
|
|
19
24
|
const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
20
25
|
|
|
@@ -101,7 +106,7 @@ export const CheckoutPage = (props) => {
|
|
|
101
106
|
useValidationFields: true,
|
|
102
107
|
validationFieldsType: 'checkout',
|
|
103
108
|
useKioskApp: settings?.use_kiosk,
|
|
104
|
-
businessSlug:
|
|
109
|
+
businessSlug: updatedBusinessSlug,
|
|
105
110
|
onPlaceOrderClick: (data, paymethod, cart) => {
|
|
106
111
|
if (cart?.order?.uuid) {
|
|
107
112
|
if (orderState?.options?.moment) {
|
|
@@ -26,6 +26,9 @@ export const HomePage = (props) => {
|
|
|
26
26
|
const [events] = useEvent()
|
|
27
27
|
const [{ site }] = useSite()
|
|
28
28
|
const [{ theme }] = useOrderingTheme()
|
|
29
|
+
const websiteThemeType = theme?.my_products?.components?.website_theme?.components?.type
|
|
30
|
+
const websiteThemeBusinessSlug = theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
31
|
+
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
29
32
|
|
|
30
33
|
const requestsState = {}
|
|
31
34
|
const isKioskApp = settings?.use_kiosk
|
|
@@ -38,9 +41,9 @@ export const HomePage = (props) => {
|
|
|
38
41
|
|
|
39
42
|
const handleGoToBusiness = () => {
|
|
40
43
|
if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
|
|
41
|
-
events.emit('go_to_page', { page: 'business', params: { business_slug:
|
|
44
|
+
events.emit('go_to_page', { page: 'business', params: { business_slug: updatedBusinessSlug } })
|
|
42
45
|
} else {
|
|
43
|
-
events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${
|
|
46
|
+
events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${updatedBusinessSlug}` })
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -2,14 +2,19 @@ import React from 'react'
|
|
|
2
2
|
import { MessagesListing } from '../../../src/themes/five/src/components/MessagesListing'
|
|
3
3
|
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
|
-
import { useEvent } from 'ordering-components-external'
|
|
5
|
+
import { useEvent, useOrderingTheme } from 'ordering-components-external'
|
|
6
6
|
import settings from '../../config'
|
|
7
7
|
|
|
8
8
|
export const MessagesList = (props) => {
|
|
9
9
|
const [events] = useEvent()
|
|
10
|
+
const [orderingTheme] = useOrderingTheme()
|
|
11
|
+
const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
|
|
12
|
+
const websiteThemeFranchiseSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.franchise_slug
|
|
13
|
+
const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
|
|
14
|
+
|
|
10
15
|
const messageprops = {
|
|
11
16
|
...props,
|
|
12
|
-
franchiseId:
|
|
17
|
+
franchiseId: updatedFranchiseSlug,
|
|
13
18
|
onRedirectPage: (data) => events.emit('go_to_page', data)
|
|
14
19
|
}
|
|
15
20
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useSite, useEvent } from 'ordering-components-external'
|
|
2
|
+
import { useSite, useEvent, useOrderingTheme } from 'ordering-components-external'
|
|
3
3
|
import { MyOrders as MyOrdersController } from '../../../src/themes/five/src/components/MyOrders'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
import settings from '../../config'
|
|
@@ -9,14 +9,21 @@ import { useWindowSize } from '../../../src/hooks/useWindowSize'
|
|
|
9
9
|
export const MyOrders = (props) => {
|
|
10
10
|
const [events] = useEvent()
|
|
11
11
|
const [{ site }] = useSite()
|
|
12
|
+
const [orderingTheme] = useOrderingTheme()
|
|
13
|
+
const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
|
|
14
|
+
const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
|
|
15
|
+
const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
|
|
16
|
+
const websiteThemeFranchiseSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.franchise_slug
|
|
17
|
+
const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
|
|
18
|
+
|
|
12
19
|
const windowSize = useWindowSize()
|
|
13
20
|
const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
|
|
14
21
|
const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
|
|
15
22
|
|
|
16
23
|
const ordersProps = {
|
|
17
24
|
...props,
|
|
18
|
-
franchiseId:
|
|
19
|
-
businessId:
|
|
25
|
+
franchiseId: updatedFranchiseSlug,
|
|
26
|
+
businessId: updatedBusinessSlug,
|
|
20
27
|
hideOptions: windowSize.width < 576,
|
|
21
28
|
onRedirectPage: (data) => {
|
|
22
29
|
if (data.page === 'business') {
|