@riosst100/pwa-marketplace 1.5.2 → 1.5.4
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 +1 -1
- package/src/components/CollectibleGameSets/collectibleGameSets.js +83 -31
- package/src/components/CollectibleGameSets/collectibleGameSets.module.css +38 -0
- package/src/components/Dropdown/dropdown.js +77 -0
- package/src/components/Dropdown/index.js +10 -0
- package/src/components/MtgSinglesPage/index.js +62 -0
- package/src/components/MtgSinglesPage/mtgSingles.js +90 -0
- package/src/components/MtgSinglesPage/singles.module.css +15 -0
- package/src/components/SubCategory/subCategory.js +14 -20
- package/src/intercept.js +7 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +1 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +44 -30
- package/src/overwrites/venia-ui/lib/components/Button/button.module.css +10 -6
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.js +4 -3
- package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.module.css +2 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +5 -4
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.module.css +2 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +11 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +4 -6
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +10 -19
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +2 -2
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +2 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +6 -7
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +173 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/bidList.js +67 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/modalFormReview.js +164 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +52 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/productReview.js +45 -37
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/starInput.js +33 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +86 -22
- package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.js +5 -1
- package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.module.css +5 -6
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +27 -1
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.module.css +0 -1
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +9 -2
- package/src/overwrites/venia-ui/lib/components/TextInput/field.module.css +4 -3
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +10 -2
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.module.css +1 -1
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +4 -2
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
1
|
+
import React, { Fragment, useState } from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl';
|
|
3
3
|
import { useSeller } from '@riosst100/pwa-marketplace/src/talons/Seller/useSeller';
|
|
4
4
|
import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
|
|
@@ -6,9 +6,20 @@ import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
|
|
|
6
6
|
import { useCollectibleGameSets } from '@riosst100/pwa-marketplace/src/talons/CollectibleGameSets/useCollectibleGameSets';
|
|
7
7
|
import { Link } from 'react-router-dom';
|
|
8
8
|
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
9
|
+
import defaultClasses from './collectibleGameSets.module.css';
|
|
10
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
11
|
+
import cn from 'classnames';
|
|
12
|
+
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
9
13
|
|
|
10
14
|
const CollectibleGameSets = props => {
|
|
11
|
-
|
|
15
|
+
|
|
16
|
+
const { product_type } = props;
|
|
17
|
+
|
|
18
|
+
const [active, setActive] = useState('all');
|
|
19
|
+
|
|
20
|
+
const classes = useStyle(defaultClasses);
|
|
21
|
+
|
|
22
|
+
const talonProps = useCollectibleGameSets({ product_type });
|
|
12
23
|
|
|
13
24
|
const { error, loading, collectibleGameSets, categoryUrlSuffix, categoryUrlKey, productType } = talonProps;
|
|
14
25
|
|
|
@@ -35,10 +46,10 @@ const CollectibleGameSets = props => {
|
|
|
35
46
|
const setRelases = collectibleGameSets.map((setRelease, index) => {
|
|
36
47
|
const { release_type, sets } = setRelease;
|
|
37
48
|
|
|
38
|
-
const setsResult = [];
|
|
39
|
-
|
|
40
49
|
setsLengthArr[release_type] = sets.length
|
|
41
50
|
|
|
51
|
+
const setsResult = [];
|
|
52
|
+
|
|
42
53
|
if (sets.length) {
|
|
43
54
|
sets.map((set, index) => {
|
|
44
55
|
const { set_name, option_id, set_abbreviation } = set;
|
|
@@ -47,44 +58,85 @@ const CollectibleGameSets = props => {
|
|
|
47
58
|
`/games/collectible-game/${categoryUrlKey}${categoryUrlSuffix || ''}?card_set[filter]=${set_name},${option_id}`
|
|
48
59
|
);
|
|
49
60
|
|
|
50
|
-
setsResult.push(
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
</
|
|
54
|
-
)
|
|
55
|
-
})
|
|
61
|
+
setsResult.push(<li className='list-none'>
|
|
62
|
+
<Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
|
|
63
|
+
{set_name} <small style={{"color":"grey"}}>{set_abbreviation}</small>
|
|
64
|
+
</Link>
|
|
65
|
+
</li>)
|
|
66
|
+
})
|
|
56
67
|
}
|
|
57
|
-
|
|
68
|
+
|
|
58
69
|
return (
|
|
59
70
|
<>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
{active == "all" || active == release_type ?
|
|
72
|
+
<div id={"#tab_list_"+release_type.toLowerCase()} className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
73
|
+
<div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
|
|
74
|
+
{release_type}
|
|
75
|
+
</div>
|
|
76
|
+
<div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
|
|
77
|
+
</div> : ''}
|
|
65
78
|
</>
|
|
66
79
|
);
|
|
67
80
|
});
|
|
68
81
|
|
|
82
|
+
const handleActive = (val) => {
|
|
83
|
+
setActive(val);
|
|
84
|
+
}
|
|
85
|
+
|
|
69
86
|
const alpha = ['#', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
|
|
70
87
|
|
|
71
88
|
return (
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
<>
|
|
90
|
+
<h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
|
|
91
|
+
{productType == "sealed-products" ? "Expansion Sets" : "All Sets"}
|
|
92
|
+
</h1>
|
|
93
|
+
<div className='border border-gray-100 px-6'>
|
|
94
|
+
{productType != "sealed-products" ? (
|
|
95
|
+
<>
|
|
96
|
+
<section className='single_list-indexing-container relative m-auto py-10'>
|
|
97
|
+
<ul className='flex gap-2 justify-center flex-wrap'>
|
|
98
|
+
<li>
|
|
99
|
+
<button
|
|
100
|
+
className={cn(
|
|
101
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
102
|
+
'leading-4 font-medium text-base hover_bg-gray-50'
|
|
103
|
+
)}
|
|
104
|
+
onClick={() => {
|
|
105
|
+
handleActive('all')
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
All
|
|
109
|
+
</button>
|
|
110
|
+
</li>
|
|
111
|
+
{alpha.map((letter, index) => (
|
|
112
|
+
<li key={index}>
|
|
113
|
+
<button
|
|
114
|
+
className={cn(
|
|
115
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
116
|
+
'leading-4 font-medium text-base ',
|
|
117
|
+
setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
|
|
118
|
+
)}
|
|
119
|
+
onClick={() => {
|
|
120
|
+
handleActive(letter)
|
|
121
|
+
}}
|
|
122
|
+
disabled={setsLengthArr[letter] > 0 ? false : true}
|
|
123
|
+
>
|
|
124
|
+
{letter}
|
|
125
|
+
</button>
|
|
126
|
+
</li>
|
|
127
|
+
))}
|
|
128
|
+
</ul>
|
|
129
|
+
</section>
|
|
130
|
+
</>
|
|
131
|
+
) : ''}
|
|
132
|
+
<Divider className="mb-5 px-4" />
|
|
133
|
+
<section className='singles-container'>
|
|
134
|
+
<div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
|
|
135
|
+
{setRelases}
|
|
83
136
|
</div>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</Fragment>
|
|
137
|
+
</section>
|
|
138
|
+
</div>
|
|
139
|
+
</>
|
|
88
140
|
);
|
|
89
141
|
};
|
|
90
142
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.tabs {
|
|
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: 30px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tabs_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
|
+
}
|
|
23
|
+
|
|
24
|
+
.singlesWrapper {
|
|
25
|
+
column-count: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media screen and (min-width: 768px) {
|
|
29
|
+
.singlesWrapper {
|
|
30
|
+
column-count: 2;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media screen and (min-width: 1023px) {
|
|
35
|
+
.singlesWrapper {
|
|
36
|
+
column-count: 3;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { ArrowDown2 } from 'iconsax-react';
|
|
4
|
+
|
|
5
|
+
const Dropdown = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
placeholder, options, onSelect, rootClassName, className,
|
|
8
|
+
optionsClassName, optionItemClassName,
|
|
9
|
+
} = props;
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
const [selected, setSelected] = useState('');
|
|
12
|
+
const dropdownRef = useRef(null);
|
|
13
|
+
|
|
14
|
+
const toggleDropdown = () => setIsOpen(!isOpen);
|
|
15
|
+
|
|
16
|
+
const handleClick = (option) => {
|
|
17
|
+
onSelect(option);
|
|
18
|
+
setSelected(option.label)
|
|
19
|
+
setIsOpen(false);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const handleClickOutside = (event) => {
|
|
23
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
24
|
+
setIsOpen(false);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const listener = document.addEventListener('mousedown', handleClickOutside);
|
|
30
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
31
|
+
}, [isOpen]);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div className={cn('dropdown relative', rootClassName)} ref={dropdownRef}>
|
|
35
|
+
<button
|
|
36
|
+
onClick={toggleDropdown}
|
|
37
|
+
className={cn(
|
|
38
|
+
'text-base text-gray-400 flex justify-between items-center gap-x-4 border',
|
|
39
|
+
'border-gray-100 border-solid rounded-md min-w-max px-2.5 py-2',
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
>
|
|
43
|
+
{selected ? selected : placeholder}
|
|
44
|
+
<ArrowDown2
|
|
45
|
+
size={14}
|
|
46
|
+
className={cn(
|
|
47
|
+
' text-gray-400 transition-all',
|
|
48
|
+
isOpen ? 'rotate-180' : 'rotate-0',
|
|
49
|
+
)}
|
|
50
|
+
/>
|
|
51
|
+
</button>
|
|
52
|
+
{isOpen && (
|
|
53
|
+
<ul
|
|
54
|
+
className={cn(
|
|
55
|
+
'absolute rounded-md bg-white w-full p-2.5 mt-2 border border-gray-100',
|
|
56
|
+
optionsClassName,
|
|
57
|
+
)}
|
|
58
|
+
>
|
|
59
|
+
{options.map((option) => (
|
|
60
|
+
<li
|
|
61
|
+
className={cn(
|
|
62
|
+
'cursor-pointer px-3 py-1.5 hover_bg-gray-100 rounded-md',
|
|
63
|
+
optionItemClassName
|
|
64
|
+
)}
|
|
65
|
+
key={option.value}
|
|
66
|
+
onClick={() => handleClick(option)}
|
|
67
|
+
>
|
|
68
|
+
{option.label}
|
|
69
|
+
</li>
|
|
70
|
+
))}
|
|
71
|
+
</ul>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default Dropdown;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Content from './mtgSingles';
|
|
3
|
+
|
|
4
|
+
const index = (props) => {
|
|
5
|
+
const [active, setActive] = useState('all')
|
|
6
|
+
const letters = Array.from({ length: 26 }, (_, i) => String.fromCharCode(i + 65));
|
|
7
|
+
|
|
8
|
+
const singles = [
|
|
9
|
+
{ id: 1, name: "Amonkhet" },
|
|
10
|
+
{ id: 2, name: "ApocalypseAPC" },
|
|
11
|
+
{ id: 3, name: "AmonkhetAKH" },
|
|
12
|
+
{ id: 4, name: "Rivals of IxalanRIX" },
|
|
13
|
+
{ id: 5, name: "Rise of the EldraziROE" },
|
|
14
|
+
{ id: 5, name: "Ravnica Remastered - VariantsRVR2" },
|
|
15
|
+
{ id: 5, name: "Streets of New CapennaSNC" },
|
|
16
|
+
{ id: 5, name: "Streets of New Capenna CommanderNCC" },
|
|
17
|
+
{ id: 5, name: "ChroniclesCHR" },
|
|
18
|
+
{ id: 5, name: "Commander 2019C19" },
|
|
19
|
+
{ id: 5, name: "Commander - OversizedCMD2" },
|
|
20
|
+
{ id: 5, name: "Throne of Eldraine - VariantsELD2" },
|
|
21
|
+
{ id: 5, name: "TormentTOR" },
|
|
22
|
+
{ id: 6, name: "Dominaria UnitedDMU" },
|
|
23
|
+
{ id: 7, name: "Double Masters2XM" },
|
|
24
|
+
{ id: 8, name: "WorldwakeWWK" },
|
|
25
|
+
{ id: 8, name: "World ChampionshipWCHP" },
|
|
26
|
+
{ id: 8, name: "Welcome Deck 2017W17" },
|
|
27
|
+
{ id: 8, name: "ZendikarZEN" },
|
|
28
|
+
{ id: 8, name: "Zendikar Rising - VariantsZNR2" },
|
|
29
|
+
{ id: 8, name: "Visions" },
|
|
30
|
+
{ id: 8, name: "Zendikar Rising ExpeditionsZNE" },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const groupSinglesFirstLetter = (items) => {
|
|
34
|
+
return items.reduce((acc, item) => {
|
|
35
|
+
const firstLetter = item.name.charAt(0).toUpperCase();
|
|
36
|
+
acc[firstLetter] = acc[firstLetter] || [];
|
|
37
|
+
acc[firstLetter].push(item);
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const groupedSingles = groupSinglesFirstLetter(singles);
|
|
43
|
+
const availableLetter = Object.keys(groupedSingles).sort();
|
|
44
|
+
|
|
45
|
+
const handleActive = (val) => {
|
|
46
|
+
setActive(val);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const contentProps = {
|
|
50
|
+
letters,
|
|
51
|
+
groupedSingles,
|
|
52
|
+
availableLetter,
|
|
53
|
+
active,
|
|
54
|
+
handleActive,
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
return (
|
|
58
|
+
<Content {...contentProps} />
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default index
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
5
|
+
import defaultClasses from './singles.module.css';
|
|
6
|
+
import { Link } from 'react-router-dom'
|
|
7
|
+
|
|
8
|
+
const mtgSingles = (props) => {
|
|
9
|
+
const { letters, groupedSingles, active, handleActive, availableLetter } = props;
|
|
10
|
+
|
|
11
|
+
const classes = useStyle(defaultClasses);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
|
|
16
|
+
MTG Singles
|
|
17
|
+
</h1>
|
|
18
|
+
<div className='border border-gray-100 px-6'>
|
|
19
|
+
<section className='single_list-indexing-container relative m-auto py-10'>
|
|
20
|
+
<ul className='flex gap-2 justify-center flex-wrap'>
|
|
21
|
+
<li >
|
|
22
|
+
<button
|
|
23
|
+
className={cn(
|
|
24
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
25
|
+
'leading-4 font-medium text-base hover_bg-gray-50'
|
|
26
|
+
)}
|
|
27
|
+
onClick={() => {
|
|
28
|
+
handleActive('all')
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
All
|
|
32
|
+
</button>
|
|
33
|
+
</li>
|
|
34
|
+
{letters.map((letter, index) => (
|
|
35
|
+
<li key={index}>
|
|
36
|
+
<button
|
|
37
|
+
className={cn(
|
|
38
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
39
|
+
'leading-4 font-medium text-base ',
|
|
40
|
+
!availableLetter.includes(letter) ? 'bg-gray-100 text-gray-400' : 'hover_bg-gray-50',
|
|
41
|
+
)}
|
|
42
|
+
onClick={() => {
|
|
43
|
+
handleActive(letter)
|
|
44
|
+
}}
|
|
45
|
+
disabled={!availableLetter.includes(letter)}
|
|
46
|
+
>
|
|
47
|
+
{letter}
|
|
48
|
+
</button>
|
|
49
|
+
</li>
|
|
50
|
+
))}
|
|
51
|
+
</ul>
|
|
52
|
+
</section>
|
|
53
|
+
<Divider className="mb-5 px-4" />
|
|
54
|
+
<section className='singles-container'>
|
|
55
|
+
<div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
|
|
56
|
+
{availableLetter.map((initialLetter, index) => (
|
|
57
|
+
<>
|
|
58
|
+
{active === 'all' || active === initialLetter ? (
|
|
59
|
+
<div className='singles_group-wrapper mb-4 px-4 inline-block w-full' key={index}>
|
|
60
|
+
<div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
|
|
61
|
+
{initialLetter}
|
|
62
|
+
</div>
|
|
63
|
+
<div
|
|
64
|
+
className={cn(
|
|
65
|
+
'singles_item-list flex flex-col'
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
{groupedSingles[initialLetter].map((item, index) => (
|
|
69
|
+
<li key={index} className='list-none'>
|
|
70
|
+
<Link
|
|
71
|
+
to="/"
|
|
72
|
+
className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2"
|
|
73
|
+
>
|
|
74
|
+
{item.name}
|
|
75
|
+
</Link>
|
|
76
|
+
</li>
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
) : null}
|
|
81
|
+
</>
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
84
|
+
</section>
|
|
85
|
+
</div>
|
|
86
|
+
</>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export default mtgSingles
|
|
@@ -1,36 +1,30 @@
|
|
|
1
1
|
import { useSubCategory } from '@riosst100/pwa-marketplace/src/talons/SubCategory/useSubCategory';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
5
5
|
import defaultClasses from './subCategory.module.css';
|
|
6
6
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
7
|
import { useFilterSidebar } from '@magento/peregrine/lib/talons/FilterSidebar';
|
|
8
|
+
import CollectibleGameSets from '@riosst100/pwa-marketplace/src/components/CollectibleGameSets/collectibleGameSets';
|
|
8
9
|
|
|
9
10
|
const SubCategory = props => {
|
|
10
|
-
const { children } = props;
|
|
11
|
+
// const { children } = props;
|
|
11
12
|
|
|
12
|
-
const talonProps = useSubCategory({ children });
|
|
13
|
+
// const talonProps = useSubCategory({ children });
|
|
13
14
|
|
|
14
15
|
const classes = useStyle(defaultClasses, props.classes);
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
normalizedData
|
|
18
|
-
} = talonProps;
|
|
19
|
-
|
|
20
|
-
const subCategory = [];
|
|
21
|
-
|
|
22
|
-
normalizedData && normalizedData.map(({ text, path }, index) => {
|
|
23
|
-
subCategory.push(
|
|
24
|
-
<Link
|
|
25
|
-
key={index}
|
|
26
|
-
to={resourceUrl(path)}
|
|
27
|
-
>
|
|
28
|
-
<li className={classes.item}>{text}</li>
|
|
29
|
-
</Link>
|
|
30
|
-
)
|
|
31
|
-
});
|
|
17
|
+
const [activeTab, setActiveTab] = useState('singles')
|
|
32
18
|
|
|
33
|
-
return
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<ul className={classes.root}>
|
|
22
|
+
<li className={classes.item} onClick={() => setActiveTab('singles')}>All Sets</li>
|
|
23
|
+
<li className={classes.item} onClick={() => setActiveTab('sealed-products')}>Expansion Sets</li>
|
|
24
|
+
</ul>
|
|
25
|
+
{activeTab == "singles" ? <CollectibleGameSets product_type={"singles"} /> : <CollectibleGameSets product_type={"sealed-products"} />}
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
34
28
|
};
|
|
35
29
|
|
|
36
30
|
export default SubCategory;
|
package/src/intercept.js
CHANGED
|
@@ -117,6 +117,13 @@ module.exports = targets => {
|
|
|
117
117
|
path: require.resolve("./components/BrandLandingPage/index.js"),
|
|
118
118
|
authed: false,
|
|
119
119
|
},
|
|
120
|
+
{
|
|
121
|
+
exact: true,
|
|
122
|
+
name: "MtgSinglesPage",
|
|
123
|
+
pattern: "/mtg-singles",
|
|
124
|
+
path: require.resolve("./components/MtgSinglesPage/index.js"),
|
|
125
|
+
authed: false,
|
|
126
|
+
},
|
|
120
127
|
];
|
|
121
128
|
|
|
122
129
|
// Apply DefinePlugin using the results of the asynchronous operation
|
|
@@ -28,6 +28,9 @@ import SubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/s
|
|
|
28
28
|
import AttributesBlock from '@riosst100/pwa-marketplace/src/components/AttributesBlock/attributesBlock';
|
|
29
29
|
|
|
30
30
|
import BrandSlider from '@riosst100/pwa-marketplace/src/components/BrandSlider';
|
|
31
|
+
import CollectibleGameSets from '@riosst100/pwa-marketplace/src/components/CollectibleGameSets/collectibleGameSets';
|
|
32
|
+
import { useLocation } from 'react-router-dom';
|
|
33
|
+
import { getFiltersFromSearch } from '@magento/peregrine/lib/talons/FilterModal/helpers';
|
|
31
34
|
|
|
32
35
|
const FilterModal = React.lazy(() => import('@magento/venia-ui/lib/components/FilterModal'));
|
|
33
36
|
const FilterSidebar = React.lazy(() =>
|
|
@@ -170,6 +173,9 @@ const CategoryContent = props => {
|
|
|
170
173
|
|
|
171
174
|
const categoryTitle = categoryName ? categoryName : <Shimmer width={5} />;
|
|
172
175
|
|
|
176
|
+
const { search } = useLocation();
|
|
177
|
+
const activeFilters = getFiltersFromSearch(search);
|
|
178
|
+
|
|
173
179
|
return (
|
|
174
180
|
<Fragment>
|
|
175
181
|
<Breadcrumbs categoryId={categoryId} />
|
|
@@ -186,39 +192,47 @@ const CategoryContent = props => {
|
|
|
186
192
|
</h1>
|
|
187
193
|
{categoryDescriptionElement}
|
|
188
194
|
</div>
|
|
189
|
-
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
{maybeSortButton}
|
|
195
|
+
{activeFilters.size <= 0 && category && category.custom_landing_page ? (
|
|
196
|
+
<>
|
|
197
|
+
<SubCategory customLandingPage={category.custom_landing_page} />
|
|
198
|
+
</>
|
|
199
|
+
) : (
|
|
200
|
+
<>
|
|
201
|
+
{/* <SubCategory filters={filters} children={children} /> */}
|
|
202
|
+
<FilterTop filters={filters} category={category} />
|
|
203
|
+
{/* <AttributesBlock category={category} attributesBlock={attributesBlock} /> */}
|
|
204
|
+
{/* <section className='category_brand-slider my-5'>
|
|
205
|
+
<BrandSlider />
|
|
206
|
+
</section> */}
|
|
207
|
+
<div className={classes.contentWrapper}>
|
|
208
|
+
<div ref={sidebarRef} className={classes.sidebar}>
|
|
209
|
+
<Suspense fallback={<FilterSidebarShimmer />}>
|
|
210
|
+
{shouldRenderSidebarContent ? sidebar : null}
|
|
211
|
+
</Suspense>
|
|
207
212
|
</div>
|
|
208
|
-
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
<div className={classes.categoryContent}>
|
|
214
|
+
<div className={cn(classes.heading)}>
|
|
215
|
+
{maybeProductsTabContainer}
|
|
216
|
+
<div className={classes.headerButtons}>
|
|
217
|
+
{maybeFilterButtons}
|
|
218
|
+
{maybeSortButton}
|
|
219
|
+
</div>
|
|
220
|
+
{maybeSortContainer}
|
|
221
|
+
</div>
|
|
222
|
+
<div className={cn(classes.heading)}>
|
|
223
|
+
<div
|
|
224
|
+
data-cy="CategoryContent-categoryInfo"
|
|
225
|
+
className={classes.categoryInfo}
|
|
226
|
+
>
|
|
227
|
+
{categoryResultsHeading}
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
{content}
|
|
231
|
+
<Suspense fallback={null}>{filtersModal}</Suspense>
|
|
216
232
|
</div>
|
|
217
233
|
</div>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
234
|
+
</>
|
|
235
|
+
)}
|
|
222
236
|
</article>
|
|
223
237
|
</Fragment>
|
|
224
238
|
);
|