@riosst100/pwa-marketplace 1.6.1 → 1.6.2
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 +3 -2
- package/src/components/AlphaFilter/alphaFilter.js +14 -3
- package/src/components/AlphaFilter/alphaFilter.shimmer.js +50 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +1 -1
- package/src/components/CrossSeller/crossSellerBuy.js +19 -0
- package/src/components/CrossSeller/index.js +15 -0
- package/src/components/CrossSeller/item.js +79 -0
- package/src/components/CrossSeller/logo_seller.png +0 -0
- package/src/components/CrossSeller/starIcon.js +14 -0
- package/src/components/CrossSeller/verifyIcon.js +12 -0
- package/src/components/CustomSortBy/productSort.module.css +65 -0
- package/src/components/CustomSortBy/productSort.shimmer.js +28 -0
- package/src/components/CustomSortBy/productSort.shimmer.module.css +10 -0
- package/src/components/CustomSubCategory/subCategory.js +48 -0
- package/src/components/CustomSubCategory/subCategory.module.css +22 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilter.js +47 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilter.module.css +22 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilters.js +50 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilters.module.css +21 -0
- package/src/components/FilterTop/CurrentTopFilters/index.js +1 -0
- package/src/components/FilterTop/CustomFilters/customFilters.js +68 -30
- package/src/components/FilterTop/FilterBlockList/filterBlockList.js +50 -0
- package/src/components/FilterTop/FilterBlockList/filterBlockList.module.css +8 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItem.js +40 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItem.module.css +14 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.js +91 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.module.css +23 -0
- package/src/components/FilterTop/FilterBlockList/index.js +1 -0
- package/src/components/FilterTop/filterTop.js +131 -13
- package/src/components/FilterTop/filterTop.module.css +23 -58
- package/src/components/FilterTop/filterTop.shimmer.js +24 -24
- package/src/components/FilterTop/filterTopBlock.js +54 -0
- package/src/components/FilterTop/index.js +2 -2
- package/src/components/FilterTopBackup/CustomFilters/customFilter.js +83 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilter.module.css +22 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +132 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilters.module.css +23 -0
- package/src/components/FilterTopBackup/CustomFilters/index.js +1 -0
- package/src/components/FilterTopBackup/filterTop.js +14 -0
- package/src/components/FilterTopBackup/filterTop.module.css +23 -0
- package/src/components/FilterTopBackup/filterTop.shimmer.js +24 -0
- package/src/components/FilterTopBackup/index.js +2 -0
- package/src/components/RelatedProduct/index.js +16 -0
- package/src/components/RelatedProduct/relatedProduct.js +112 -0
- package/src/components/RelatedProduct/sample.json +154 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +0 -13
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +1 -1
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +3 -2
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +3 -1
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.js +2 -2
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +13 -1
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.js +2 -2
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +1 -1
- package/src/talons/CustomFilters/useCustomFilters.js +163 -5
- package/src/talons/FilterTop/customFilters.gql.js +45 -0
- package/src/talons/FilterTop/filterTop.gql.js +45 -0
- package/src/talons/FilterTop/index.js +1 -0
- package/src/talons/FilterTop/useFilterTop.js +330 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { arrayOf, shape, string, func, bool } from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { ChevronDown as ArrowDown, ChevronUp as ArrowUp } from 'react-feather';
|
|
5
|
+
import { Form } from 'informed';
|
|
6
|
+
|
|
7
|
+
import { useFilterBlock } from '@magento/peregrine/lib/talons/FilterModal';
|
|
8
|
+
import setValidator from '@magento/peregrine/lib/validators/set';
|
|
9
|
+
|
|
10
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
11
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
12
|
+
import FilterBlockList from './FilterBlockList';
|
|
13
|
+
import { ArrowUp2 } from 'iconsax-react';
|
|
14
|
+
import cn from 'classnames';
|
|
15
|
+
|
|
16
|
+
const FilterTopBlock = props => {
|
|
17
|
+
const {
|
|
18
|
+
filterApi,
|
|
19
|
+
filterState,
|
|
20
|
+
filterFrontendInput,
|
|
21
|
+
group,
|
|
22
|
+
items,
|
|
23
|
+
name,
|
|
24
|
+
onApply,
|
|
25
|
+
filterNames,
|
|
26
|
+
initialOpen,
|
|
27
|
+
originalFilterState
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
30
|
+
const { formatMessage } = useIntl();
|
|
31
|
+
const talonProps = useFilterBlock({
|
|
32
|
+
filterState,
|
|
33
|
+
items,
|
|
34
|
+
initialOpen
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const list = <Form>
|
|
38
|
+
<FilterBlockList
|
|
39
|
+
filterApi={filterApi}
|
|
40
|
+
filterState={filterState}
|
|
41
|
+
originalFilterState={originalFilterState}
|
|
42
|
+
name={name}
|
|
43
|
+
filterFrontendInput={filterFrontendInput}
|
|
44
|
+
group={group}
|
|
45
|
+
items={items}
|
|
46
|
+
filterNames={filterNames}
|
|
47
|
+
onApply={onApply}
|
|
48
|
+
/>
|
|
49
|
+
</Form>
|
|
50
|
+
|
|
51
|
+
return list;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default FilterTopBlock;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './filterTop';
|
|
2
|
-
export { default as FilterTopShimmer } from './filterTop.shimmer';
|
|
1
|
+
export { default } from './filterTop';
|
|
2
|
+
export { default as FilterTopShimmer } from './filterTop.shimmer';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { shape, string, func } from 'prop-types';
|
|
4
|
+
import { X as Remove } from 'react-feather';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
8
|
+
import Trigger from '@magento/venia-ui/lib/components/Trigger';
|
|
9
|
+
import defaultClasses from './customFilter.module.css';
|
|
10
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
11
|
+
|
|
12
|
+
import { Link } from 'react-router-dom';
|
|
13
|
+
|
|
14
|
+
const CustomFilter = props => {
|
|
15
|
+
const { group, item, onRemove } = props;
|
|
16
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
17
|
+
const { formatMessage } = useIntl();
|
|
18
|
+
|
|
19
|
+
const ariaLabel = formatMessage(
|
|
20
|
+
{
|
|
21
|
+
id: 'filterModal.action.clearFilterItem.ariaLabel',
|
|
22
|
+
defaultMessage: 'Clear filter "{name}"'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: item.label ? item.label : item.title
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const normalizedData = [
|
|
30
|
+
{
|
|
31
|
+
'label': 'Sealed Products',
|
|
32
|
+
'path': '/'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
'label': 'Singles',
|
|
36
|
+
'path': '/'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
'label': 'Supplies',
|
|
40
|
+
'path': '/'
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const subCategory = [];
|
|
45
|
+
|
|
46
|
+
const customAttributeLandingPage = ['card_set', 'sc_baseball_release'];
|
|
47
|
+
|
|
48
|
+
if (customAttributeLandingPage.includes(group)) {
|
|
49
|
+
normalizedData && normalizedData.map(({ label, path }, index) => {
|
|
50
|
+
subCategory.push(
|
|
51
|
+
<Link
|
|
52
|
+
key={index}
|
|
53
|
+
to={resourceUrl(path)}
|
|
54
|
+
>
|
|
55
|
+
<li className={classes.item}>{label}</li>
|
|
56
|
+
</Link>
|
|
57
|
+
)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<ul className={classes.root}>{subCategory}</ul>
|
|
64
|
+
// <span className={classes.root} data-cy="CustomFilter-root">
|
|
65
|
+
// <span className={classes.text}>
|
|
66
|
+
// {item.label ? item.label : item.title}
|
|
67
|
+
// </span>
|
|
68
|
+
// </span>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default CustomFilter;
|
|
73
|
+
|
|
74
|
+
CustomFilter.defaultProps = {
|
|
75
|
+
onRemove: null
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
CustomFilter.propTypes = {
|
|
79
|
+
classes: shape({
|
|
80
|
+
root: string
|
|
81
|
+
}),
|
|
82
|
+
onRemove: func
|
|
83
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: flex from global;
|
|
3
|
+
composes: flex-wrap from global;
|
|
4
|
+
composes: mt-3 from global;
|
|
5
|
+
composes: gap-[15px] from global;
|
|
6
|
+
margin-bottom: 10px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.item {
|
|
10
|
+
composes: px-4 from global;
|
|
11
|
+
composes: py-2 from global;
|
|
12
|
+
composes: transition-colors from global;
|
|
13
|
+
composes: duration-150 from global;
|
|
14
|
+
composes: border from global;
|
|
15
|
+
composes: border-solid from global;
|
|
16
|
+
composes: leading-normal from global;
|
|
17
|
+
composes: text-base from global;
|
|
18
|
+
composes: text-colorDefault from global;
|
|
19
|
+
composes: bg-white from global;
|
|
20
|
+
composes: border-gray-100 from global;
|
|
21
|
+
border-radius: 5px;
|
|
22
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { func, shape, string } from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import CustomFilter from './customFilter';
|
|
7
|
+
import defaultClasses from './customFilters.module.css';
|
|
8
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
9
|
+
import { Link } from 'react-router-dom';
|
|
10
|
+
import { useCustomFilters } from '@riosst100/pwa-marketplace/src/talons/CustomFilters/useCustomFilters';
|
|
11
|
+
|
|
12
|
+
const CustomFilters = props => {
|
|
13
|
+
const { onRemove, clearAll, category, filters } = props;
|
|
14
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
15
|
+
const { formatMessage } = useIntl();
|
|
16
|
+
|
|
17
|
+
const talonProps = useCustomFilters({ filters });
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
customFiltersData,
|
|
21
|
+
categoryUrlSuffix,
|
|
22
|
+
search,
|
|
23
|
+
pathname,
|
|
24
|
+
filterApi,
|
|
25
|
+
// filterItems,
|
|
26
|
+
// filterNames,
|
|
27
|
+
// filterFrontendInput,
|
|
28
|
+
filterState
|
|
29
|
+
} = talonProps;
|
|
30
|
+
|
|
31
|
+
const params = search ? JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}') : {};
|
|
32
|
+
|
|
33
|
+
const { removeItem } = filterApi;
|
|
34
|
+
|
|
35
|
+
const activeFilters = useMemo(() => {
|
|
36
|
+
const elements = [];
|
|
37
|
+
for (const [group, items] of filterState) {
|
|
38
|
+
for (const item of items) {
|
|
39
|
+
elements.push(
|
|
40
|
+
{
|
|
41
|
+
group: group,
|
|
42
|
+
item: item,
|
|
43
|
+
removeItem: removeItem
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return elements;
|
|
50
|
+
}, [filterState, removeItem]);
|
|
51
|
+
|
|
52
|
+
// console.log(activeFilters)\\
|
|
53
|
+
|
|
54
|
+
// const handleClick = useCallback(() => {
|
|
55
|
+
// removeItem({ group, item });
|
|
56
|
+
// }, [group, item, removeItem]);
|
|
57
|
+
|
|
58
|
+
// create elements and params at the same time for efficiency
|
|
59
|
+
const filterElements = useMemo(() => {
|
|
60
|
+
const elements = [];
|
|
61
|
+
customFiltersData && customFiltersData.map((filter, index) => {
|
|
62
|
+
const { label, attribute_code, options } = filter || {};
|
|
63
|
+
|
|
64
|
+
const group = attribute_code;
|
|
65
|
+
|
|
66
|
+
// const handleClick = useCallback(() => {
|
|
67
|
+
// removeItem({ group, item });
|
|
68
|
+
// if (typeof onRemove === 'function') {
|
|
69
|
+
// onRemove(group, item);
|
|
70
|
+
// }
|
|
71
|
+
// }, [group, item, removeItem, onRemove]);
|
|
72
|
+
|
|
73
|
+
if (options.length) {
|
|
74
|
+
const items = [];
|
|
75
|
+
options.map((item, index) => {
|
|
76
|
+
const { label, value } = item
|
|
77
|
+
// const path = '/';
|
|
78
|
+
|
|
79
|
+
// const path = resourceUrl(
|
|
80
|
+
// `/${category.url_path}${categoryUrlSuffix || ''}?${attribute_code}[filter]=${label},${value}`
|
|
81
|
+
// );
|
|
82
|
+
// const keyAttr = `${attribute_code}[filter]`;
|
|
83
|
+
|
|
84
|
+
if (params) {
|
|
85
|
+
Object.keys(params).forEach(function(key, index) {
|
|
86
|
+
if (index > 1) {
|
|
87
|
+
delete params[key];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (value != "all") {
|
|
93
|
+
params[`${attribute_code}[filter]`] = `${label},${value}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const finalParams = params ? Object.keys(params).map(key => `${key}=${params[key]}`).join('&') : '';
|
|
97
|
+
const path = pathname + finalParams;
|
|
98
|
+
|
|
99
|
+
if (value != "all") {
|
|
100
|
+
items.push(
|
|
101
|
+
<li key={index}>
|
|
102
|
+
<Link
|
|
103
|
+
to={path}
|
|
104
|
+
>
|
|
105
|
+
<span className={classes.item}>{label}</span>
|
|
106
|
+
</Link>
|
|
107
|
+
</li>
|
|
108
|
+
)
|
|
109
|
+
} else {
|
|
110
|
+
items.push(
|
|
111
|
+
<li key={index}>
|
|
112
|
+
<span className={classes.item} onClick={removeItem({ group, item })}>{label}</span>
|
|
113
|
+
</li>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
elements.push(
|
|
119
|
+
<ul key={index} className={classes.root}>{items}</ul>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
return elements;
|
|
125
|
+
}, [customFiltersData]);
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<>{filterElements}</>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export default CustomFilters;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: flex from global;
|
|
3
|
+
composes: flex-wrap from global;
|
|
4
|
+
composes: mt-3 from global;
|
|
5
|
+
composes: gap-[15px] from global;
|
|
6
|
+
margin-bottom: 10px;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.item {
|
|
11
|
+
composes: px-4 from global;
|
|
12
|
+
composes: py-2 from global;
|
|
13
|
+
composes: transition-colors from global;
|
|
14
|
+
composes: duration-150 from global;
|
|
15
|
+
composes: border from global;
|
|
16
|
+
composes: border-solid from global;
|
|
17
|
+
composes: leading-normal from global;
|
|
18
|
+
composes: text-base from global;
|
|
19
|
+
composes: text-colorDefault from global;
|
|
20
|
+
composes: bg-white from global;
|
|
21
|
+
composes: border-gray-100 from global;
|
|
22
|
+
border-radius: 5px;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './customFilters';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CustomFilters from './CustomFilters';
|
|
3
|
+
|
|
4
|
+
const FilterTop = props => {
|
|
5
|
+
const { category, filters } = props;
|
|
6
|
+
return (
|
|
7
|
+
<CustomFilters
|
|
8
|
+
category={category}
|
|
9
|
+
filters={filters}
|
|
10
|
+
/>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default FilterTop;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: flex from global;
|
|
3
|
+
composes: flex-wrap from global;
|
|
4
|
+
composes: mt-3 from global;
|
|
5
|
+
composes: gap-[15px] from global;
|
|
6
|
+
margin-bottom: 10px;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.item {
|
|
11
|
+
composes: px-4 from global;
|
|
12
|
+
composes: py-2 from global;
|
|
13
|
+
composes: transition-colors from global;
|
|
14
|
+
composes: duration-150 from global;
|
|
15
|
+
composes: border from global;
|
|
16
|
+
composes: border-solid from global;
|
|
17
|
+
composes: leading-normal from global;
|
|
18
|
+
composes: text-base from global;
|
|
19
|
+
composes: text-colorDefault from global;
|
|
20
|
+
composes: bg-white from global;
|
|
21
|
+
composes: border-gray-100 from global;
|
|
22
|
+
border-radius: 5px;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
4
|
+
|
|
5
|
+
import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
|
|
6
|
+
import defaultClasses from './filterTop.module.css';
|
|
7
|
+
|
|
8
|
+
const FilterTop = props => {
|
|
9
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<aside className={classes.root} aria-live="polite" aria-busy="true">
|
|
13
|
+
<Shimmer width="95%" height="70vh" style={{ marginBottom: 25 }} />
|
|
14
|
+
</aside>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
FilterTop.propTypes = {
|
|
19
|
+
classes: shape({
|
|
20
|
+
root: string
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default FilterTop;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Content from './relatedProduct';
|
|
3
|
+
import data from './sample.json';
|
|
4
|
+
|
|
5
|
+
const index = () => {
|
|
6
|
+
|
|
7
|
+
const contetnProps = {
|
|
8
|
+
data
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Content {...contetnProps} />
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default index
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import GalleryItem from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Gallery/item';
|
|
3
|
+
import Slider from "react-slick";
|
|
4
|
+
import { ArrowLeft2, ArrowRight2 } from 'iconsax-react';
|
|
5
|
+
import cn from 'classnames';
|
|
6
|
+
import { useGallery } from '@magento/peregrine/lib/talons/Gallery/useGallery';
|
|
7
|
+
|
|
8
|
+
import { primary900 } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
9
|
+
|
|
10
|
+
const CustomArrow = (props) => {
|
|
11
|
+
const { isNext = true, onClick, className } = props;
|
|
12
|
+
return (
|
|
13
|
+
<span
|
|
14
|
+
className={cn(
|
|
15
|
+
className,
|
|
16
|
+
'custom_arrow rounded-full w-10 h-10 p-2.5 bg-white hover_!bg-white z-[1] !border !border-solid !border-gray-100 before_hidden',
|
|
17
|
+
isNext ? 'right-2 lg_right-4' : 'left-2 lg_left-4',
|
|
18
|
+
)}
|
|
19
|
+
onClick={onClick}
|
|
20
|
+
>
|
|
21
|
+
{isNext ? (
|
|
22
|
+
<ArrowRight2 className='' size="20" color={primary900} />
|
|
23
|
+
) : (
|
|
24
|
+
<ArrowLeft2 size="20" color={primary900} />
|
|
25
|
+
)}
|
|
26
|
+
</span>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const relatedProduct = (props) => {
|
|
31
|
+
const { data } = props;
|
|
32
|
+
const talonProps = useGallery();
|
|
33
|
+
const { storeConfig } = talonProps;
|
|
34
|
+
|
|
35
|
+
const settings = {
|
|
36
|
+
dots: false,
|
|
37
|
+
infinite: false,
|
|
38
|
+
speed: 500,
|
|
39
|
+
slidesToShow: 5,
|
|
40
|
+
slidesToScroll: 1,
|
|
41
|
+
nextArrow: <CustomArrow />,
|
|
42
|
+
prevArrow: <CustomArrow isNext={false} />,
|
|
43
|
+
centerPadding: "60px",
|
|
44
|
+
responsive: [
|
|
45
|
+
{
|
|
46
|
+
breakpoint: 1023,
|
|
47
|
+
settings: {
|
|
48
|
+
slidesToShow: 3,
|
|
49
|
+
slidesToScroll: 1,
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
breakpoint: 767,
|
|
54
|
+
settings: {
|
|
55
|
+
slidesToShow: 3,
|
|
56
|
+
slidesToScroll: 1,
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
breakpoint: 576,
|
|
61
|
+
settings: {
|
|
62
|
+
slidesToShow: 2,
|
|
63
|
+
slidesToScroll: 1
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<h2
|
|
72
|
+
className={cn(
|
|
73
|
+
'bg-darkblue-900 text-lg font-semibold text-white leading-6 px-6 py-3 inline-block relative',
|
|
74
|
+
'after_border-l-[48px] after_border-t-[48px] after_border-b-0 after_border-r-0',
|
|
75
|
+
'after_border-l-darkblue-900 after_border-t-transparent after_border-r-transparent after_border-b-transparent',
|
|
76
|
+
'after_absolute after_right-[-48px] after_top-0'
|
|
77
|
+
)}
|
|
78
|
+
>
|
|
79
|
+
More from this store
|
|
80
|
+
</h2>
|
|
81
|
+
<div className='related_products-container flex flex-col gap-x-4 gap-y-5 py-10 mb-4'>
|
|
82
|
+
<Slider {...settings}>
|
|
83
|
+
{data.map((item) => {
|
|
84
|
+
return (
|
|
85
|
+
<GalleryItem
|
|
86
|
+
key={item.id}
|
|
87
|
+
item={item}
|
|
88
|
+
storeConfig={storeConfig}
|
|
89
|
+
rootClassName="px-4 block"
|
|
90
|
+
/>
|
|
91
|
+
)
|
|
92
|
+
})}
|
|
93
|
+
</Slider>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<style global jsx>
|
|
97
|
+
{`
|
|
98
|
+
.related_products-container .slick-slider {
|
|
99
|
+
margin: 0 -8px;
|
|
100
|
+
}
|
|
101
|
+
@media only screen and (min-width: 1024px) {
|
|
102
|
+
.related_products-container .slick-slider {
|
|
103
|
+
margin: 0 -16px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`}
|
|
107
|
+
</style>
|
|
108
|
+
</>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default relatedProduct
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"__typename": "SimpleProduct",
|
|
4
|
+
"id": 25,
|
|
5
|
+
"uid": "MjU=",
|
|
6
|
+
"name": "Test Product 13",
|
|
7
|
+
"seller": {
|
|
8
|
+
"__typename": "Seller",
|
|
9
|
+
"name": null
|
|
10
|
+
},
|
|
11
|
+
"price_range": {
|
|
12
|
+
"__typename": "PriceRange",
|
|
13
|
+
"maximum_price": {
|
|
14
|
+
"__typename": "ProductPrice",
|
|
15
|
+
"final_price": {
|
|
16
|
+
"__typename": "Money",
|
|
17
|
+
"currency": "SGD",
|
|
18
|
+
"value": 120
|
|
19
|
+
},
|
|
20
|
+
"regular_price": {
|
|
21
|
+
"__typename": "Money",
|
|
22
|
+
"currency": "SGD",
|
|
23
|
+
"value": 120
|
|
24
|
+
},
|
|
25
|
+
"discount": {
|
|
26
|
+
"__typename": "ProductDiscount",
|
|
27
|
+
"amount_off": 0
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"sku": "Test Product 7-1-2",
|
|
32
|
+
"small_image": {
|
|
33
|
+
"__typename": "ProductImage",
|
|
34
|
+
"url": "https://seller-dev.tcgcollective.co/media/catalog/product/cache/9d2223072e07b2ec257382d238a7acb0/b/p/bp19439l_4_.jpg"
|
|
35
|
+
},
|
|
36
|
+
"stock_status": "IN_STOCK",
|
|
37
|
+
"rating_summary": 0,
|
|
38
|
+
"url_key": "test-product-13"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"__typename": "SimpleProduct",
|
|
42
|
+
"id": 24,
|
|
43
|
+
"uid": "MjQ=",
|
|
44
|
+
"name": "Test Product 12",
|
|
45
|
+
"seller": {
|
|
46
|
+
"__typename": "Seller",
|
|
47
|
+
"name": null
|
|
48
|
+
},
|
|
49
|
+
"price_range": {
|
|
50
|
+
"__typename": "PriceRange",
|
|
51
|
+
"maximum_price": {
|
|
52
|
+
"__typename": "ProductPrice",
|
|
53
|
+
"final_price": {
|
|
54
|
+
"__typename": "Money",
|
|
55
|
+
"currency": "SGD",
|
|
56
|
+
"value": 120
|
|
57
|
+
},
|
|
58
|
+
"regular_price": {
|
|
59
|
+
"__typename": "Money",
|
|
60
|
+
"currency": "SGD",
|
|
61
|
+
"value": 120
|
|
62
|
+
},
|
|
63
|
+
"discount": {
|
|
64
|
+
"__typename": "ProductDiscount",
|
|
65
|
+
"amount_off": 0
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"sku": "Test Product 11-1",
|
|
70
|
+
"small_image": {
|
|
71
|
+
"__typename": "ProductImage",
|
|
72
|
+
"url": "https://seller-dev.tcgcollective.co/static/frontend/Magento/luma/en_US/Magento_Catalog/images/product/placeholder/small_image.jpg"
|
|
73
|
+
},
|
|
74
|
+
"stock_status": "IN_STOCK",
|
|
75
|
+
"rating_summary": 0,
|
|
76
|
+
"url_key": "test-product-12"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"__typename": "SimpleProduct",
|
|
80
|
+
"id": 23,
|
|
81
|
+
"uid": "MjM=",
|
|
82
|
+
"name": "Test Product 11",
|
|
83
|
+
"seller": {
|
|
84
|
+
"__typename": "Seller",
|
|
85
|
+
"name": null
|
|
86
|
+
},
|
|
87
|
+
"price_range": {
|
|
88
|
+
"__typename": "PriceRange",
|
|
89
|
+
"maximum_price": {
|
|
90
|
+
"__typename": "ProductPrice",
|
|
91
|
+
"final_price": {
|
|
92
|
+
"__typename": "Money",
|
|
93
|
+
"currency": "SGD",
|
|
94
|
+
"value": 120
|
|
95
|
+
},
|
|
96
|
+
"regular_price": {
|
|
97
|
+
"__typename": "Money",
|
|
98
|
+
"currency": "SGD",
|
|
99
|
+
"value": 120
|
|
100
|
+
},
|
|
101
|
+
"discount": {
|
|
102
|
+
"__typename": "ProductDiscount",
|
|
103
|
+
"amount_off": 0
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"sku": "Test Product 11",
|
|
108
|
+
"small_image": {
|
|
109
|
+
"__typename": "ProductImage",
|
|
110
|
+
"url": "https://seller-dev.tcgcollective.co/static/frontend/Magento/luma/en_US/Magento_Catalog/images/product/placeholder/small_image.jpg"
|
|
111
|
+
},
|
|
112
|
+
"stock_status": "IN_STOCK",
|
|
113
|
+
"rating_summary": 0,
|
|
114
|
+
"url_key": "test-product-11"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"__typename": "SimpleProduct",
|
|
118
|
+
"id": 21,
|
|
119
|
+
"uid": "MjE=",
|
|
120
|
+
"name": "Test Product 9",
|
|
121
|
+
"seller": {
|
|
122
|
+
"__typename": "Seller",
|
|
123
|
+
"name": null
|
|
124
|
+
},
|
|
125
|
+
"price_range": {
|
|
126
|
+
"__typename": "PriceRange",
|
|
127
|
+
"maximum_price": {
|
|
128
|
+
"__typename": "ProductPrice",
|
|
129
|
+
"final_price": {
|
|
130
|
+
"__typename": "Money",
|
|
131
|
+
"currency": "SGD",
|
|
132
|
+
"value": 98
|
|
133
|
+
},
|
|
134
|
+
"regular_price": {
|
|
135
|
+
"__typename": "Money",
|
|
136
|
+
"currency": "SGD",
|
|
137
|
+
"value": 120
|
|
138
|
+
},
|
|
139
|
+
"discount": {
|
|
140
|
+
"__typename": "ProductDiscount",
|
|
141
|
+
"amount_off": 22
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"sku": "Test Product 7-1-1",
|
|
146
|
+
"small_image": {
|
|
147
|
+
"__typename": "ProductImage",
|
|
148
|
+
"url": "https://seller-dev.tcgcollective.co/media/catalog/product/cache/9d2223072e07b2ec257382d238a7acb0/f/4/f4f14229_14.jpg"
|
|
149
|
+
},
|
|
150
|
+
"stock_status": "IN_STOCK",
|
|
151
|
+
"rating_summary": 0,
|
|
152
|
+
"url_key": "test-product-9"
|
|
153
|
+
}
|
|
154
|
+
]
|