@riosst100/pwa-marketplace 2.3.1 → 2.3.3
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/package.json
CHANGED
|
@@ -8,7 +8,21 @@ const LinkToOtherStores = (props) => {
|
|
|
8
8
|
const linkToOtherStores = productDetails?.link_to_other_stores;
|
|
9
9
|
|
|
10
10
|
// Convert the JSON string to an array
|
|
11
|
-
const storesArray = JSON.parse(linkToOtherStores);
|
|
11
|
+
// const storesArray = JSON.parse(linkToOtherStores);
|
|
12
|
+
const storesArray = [
|
|
13
|
+
{
|
|
14
|
+
'product_link': 'https://shopee.sg',
|
|
15
|
+
'stores': 'Shopee'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
'product_link': 'https://tokopedia.com',
|
|
19
|
+
'stores': 'Tokopedia'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
'product_link': 'https://lazada.sg',
|
|
23
|
+
'stores': 'Lazada'
|
|
24
|
+
}
|
|
25
|
+
];
|
|
12
26
|
|
|
13
27
|
const getLogo = (stores) => {
|
|
14
28
|
let img = '';
|
|
@@ -107,6 +107,10 @@ export const useCategory = props => {
|
|
|
107
107
|
loading: introspectionLoading
|
|
108
108
|
} = useQuery(getFilterInputsQuery);
|
|
109
109
|
|
|
110
|
+
console.log(introspectionCalled)
|
|
111
|
+
console.log(introspectionLoading)
|
|
112
|
+
console.log(introspectionData)
|
|
113
|
+
|
|
110
114
|
// Create a type map we can reference later to ensure we pass valid args
|
|
111
115
|
// to the graphql query.
|
|
112
116
|
// For example: { category_id: 'FilterEqualTypeInput', price: 'FilterRangeTypeInput' }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
@@ -6,9 +6,6 @@ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
|
6
6
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
7
|
import defaultClasses from './submenuColumn.module.css';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import { ArrowDown2 } from 'iconsax-react';
|
|
10
|
-
import { textPrimary } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
11
|
-
import CustomSubmenuColumn from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn';
|
|
12
9
|
import cn from 'classnames';
|
|
13
10
|
|
|
14
11
|
/**
|
|
@@ -31,12 +28,8 @@ const SubmenuColumn = props => {
|
|
|
31
28
|
const categoryUrl = resourceUrl(
|
|
32
29
|
`/${category.url_path}${categoryUrlSuffix || ''}`
|
|
33
30
|
);
|
|
34
|
-
let children = null;
|
|
35
|
-
|
|
36
|
-
// let maybeDownArrowIcon = () => {
|
|
37
|
-
// return ;
|
|
38
|
-
// };
|
|
39
31
|
|
|
32
|
+
let children = null;
|
|
40
33
|
let childrenItems = '';
|
|
41
34
|
|
|
42
35
|
if (category.children.length) {
|
|
@@ -54,41 +47,10 @@ const SubmenuColumn = props => {
|
|
|
54
47
|
|
|
55
48
|
const customMenuItems = subCategory.custom_submenu;
|
|
56
49
|
|
|
57
|
-
const [showCustomMenu, setShowCustomMenu] = useState(false);
|
|
58
|
-
|
|
59
|
-
const toggleCustomMenu = () => {
|
|
60
|
-
if (!showCustomMenu) {
|
|
61
|
-
setShowCustomMenu(true);
|
|
62
|
-
} else {
|
|
63
|
-
setShowCustomMenu(false);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const customSubMenus = customMenuItems.length ? (
|
|
68
|
-
<CustomSubmenuColumn
|
|
69
|
-
categoryUrlSuffix={categoryUrlSuffix}
|
|
70
|
-
onNavigate={onNavigate}
|
|
71
|
-
handleCloseSubMenu={handleCloseSubMenu}
|
|
72
|
-
category={subCategory}
|
|
73
|
-
customMenuItems={customMenuItems}
|
|
74
|
-
toggleCustomMenu={toggleCustomMenu}
|
|
75
|
-
/>
|
|
76
|
-
) : '';
|
|
77
|
-
|
|
78
|
-
// if (customMenuItems.length) {
|
|
79
|
-
// console.log(customMenuItems)
|
|
80
|
-
// }
|
|
81
|
-
|
|
82
|
-
// var childLi = '';
|
|
83
50
|
let result = [];
|
|
84
|
-
|
|
85
51
|
if (customMenuItems.length) {
|
|
86
|
-
// console.log('customMenuItems length')
|
|
87
|
-
// console.log(customMenuItems)
|
|
88
|
-
|
|
89
52
|
customMenuItems.map((submenu, index) => {
|
|
90
|
-
const {name
|
|
91
|
-
|
|
53
|
+
const {name} = submenu;
|
|
92
54
|
result.push(
|
|
93
55
|
<li key={index} className={cn(classes.submenuChildItem, 'mt-0')}>
|
|
94
56
|
<Link
|
|
@@ -106,8 +68,6 @@ const SubmenuColumn = props => {
|
|
|
106
68
|
</li>
|
|
107
69
|
)
|
|
108
70
|
})
|
|
109
|
-
|
|
110
|
-
// console.log(childrenItems)
|
|
111
71
|
} else {
|
|
112
72
|
result.push(
|
|
113
73
|
<li key={index} className={cn(classes.submenuChildItem, 'mt-0')}>
|
|
@@ -127,19 +87,11 @@ const SubmenuColumn = props => {
|
|
|
127
87
|
);
|
|
128
88
|
}
|
|
129
89
|
|
|
130
|
-
// return '';
|
|
131
|
-
|
|
132
|
-
// return childLi;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
90
|
return result;
|
|
138
91
|
});
|
|
139
92
|
}
|
|
140
93
|
|
|
141
|
-
if (category.custom_submenu && category.custom_submenu.length)
|
|
142
|
-
{
|
|
94
|
+
if (category.custom_submenu && category.custom_submenu.length) {
|
|
143
95
|
childrenItems = category.custom_submenu.map((subCategory, index) => {
|
|
144
96
|
const { path, isActive, name } = subCategory;
|
|
145
97
|
const categoryUrl = resourceUrl(
|