@riosst100/pwa-marketplace 1.5.1 → 1.5.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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/components/CollectibleGameSets/collectibleGameSets.js +142 -41
  3. package/src/components/CollectibleGameSets/collectibleGameSets.module.css +38 -0
  4. package/src/components/Dropdown/dropdown.js +77 -0
  5. package/src/components/Dropdown/index.js +10 -0
  6. package/src/components/MtgSinglesPage/index.js +62 -0
  7. package/src/components/MtgSinglesPage/mtgSingles.js +90 -0
  8. package/src/components/MtgSinglesPage/singles.module.css +15 -0
  9. package/src/components/SubCategory/subCategory.js +14 -20
  10. package/src/intercept.js +7 -0
  11. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +1 -0
  12. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +44 -30
  13. package/src/overwrites/venia-ui/lib/components/Button/button.module.css +10 -6
  14. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +1 -1
  15. package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.js +4 -3
  16. package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.module.css +2 -2
  17. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +6 -5
  18. package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.module.css +2 -2
  19. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +11 -2
  20. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +4 -6
  21. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +10 -19
  22. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +2 -2
  23. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +2 -1
  24. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +6 -7
  25. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +173 -0
  26. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/bidList.js +67 -0
  27. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/modalFormReview.js +164 -0
  28. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +52 -0
  29. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/productReview.js +45 -37
  30. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/starInput.js +33 -0
  31. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +86 -22
  32. package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.js +5 -1
  33. package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.module.css +5 -6
  34. package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +27 -1
  35. package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.module.css +0 -1
  36. package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +9 -2
  37. package/src/overwrites/venia-ui/lib/components/TextInput/field.module.css +4 -3
  38. package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +10 -2
  39. package/src/overwrites/venia-ui/lib/components/TextInput/textInput.module.css +1 -1
  40. package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +4 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "1.5.1",
4
+ "version": "1.5.3",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -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,18 @@ 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
- const talonProps = useCollectibleGameSets();
15
+
16
+ const { product_type } = props;
17
+
18
+ const classes = useStyle(defaultClasses);
19
+
20
+ const talonProps = useCollectibleGameSets({ product_type });
12
21
 
13
22
  const { error, loading, collectibleGameSets, categoryUrlSuffix, categoryUrlKey, productType } = talonProps;
14
23
 
@@ -30,61 +39,153 @@ const CollectibleGameSets = props => {
30
39
  );
31
40
  }
32
41
 
42
+ const [active, setActive] = useState('all')
43
+
33
44
  const setsLengthArr = [];
34
45
 
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
-
42
- if (sets.length) {
43
- sets.map((set, index) => {
44
- const { set_name, option_id, set_abbreviation } = set;
45
-
46
- const categoryUrl = resourceUrl(
47
- `/games/collectible-game/${categoryUrlKey}${categoryUrlSuffix || ''}?card_set[filter]=${set_name},${option_id}`
48
- );
49
-
50
- setsResult.push(
51
- <li>
52
- <Link to={categoryUrl}>{set_name} <small style={{"color":"grey"}}>{set_abbreviation}</small></Link>
53
- </li>
54
- );
55
- });
56
- }
57
-
50
+
58
51
  return (
59
52
  <>
60
- <div id={"#tab_list_"+release_type.toLowerCase()}>
61
- <div className='text-[16px] pb-2'><b>{release_type}</b></div>
62
- <hr />
63
- <ul className='pt-2'>{setsResult}</ul>
64
- </div>
53
+ {active == "all" || active == release_type ?
54
+ <div id={"#tab_list_"+release_type.toLowerCase()} className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
55
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
56
+ {release_type}
57
+ </div>
58
+ <div className={cn('singles_item-list flex flex-col')}>{sets.length ?
59
+ sets.map((set, index) => {
60
+ const { set_name, option_id, set_abbreviation } = set;
61
+
62
+ const categoryUrl = resourceUrl(
63
+ `/games/collectible-game/${categoryUrlKey}${categoryUrlSuffix || ''}?card_set[filter]=${set_name},${option_id}`
64
+ );
65
+
66
+ return <li className='list-none'>
67
+ <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
68
+ {set_name} <small style={{"color":"grey"}}>{set_abbreviation}</small>
69
+ </Link>
70
+ </li>
71
+ })
72
+ : ''}</div>
73
+ </div> : ''}
65
74
  </>
66
75
  );
67
76
  });
68
77
 
78
+
79
+
80
+ const handleActive = (val) => {
81
+ setActive(val);
82
+ }
83
+
69
84
  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
85
 
86
+ const singles = [
87
+ { id: 1, name: "Amonkhet" },
88
+ { id: 2, name: "ApocalypseAPC" },
89
+ { id: 3, name: "AmonkhetAKH" },
90
+ { id: 4, name: "Rivals of IxalanRIX" }
91
+ ];
92
+
93
+ const groupSinglesFirstLetter = (items) => {
94
+ return items.reduce((acc, item) => {
95
+ const firstLetter = item.name.charAt(0).toUpperCase();
96
+ acc[firstLetter] = acc[firstLetter] || [];
97
+ acc[firstLetter].push(item);
98
+ return acc;
99
+ }, {});
100
+ }
101
+
102
+ const groupedSingles = groupSinglesFirstLetter(singles);
103
+ const availableLetter = Object.keys(groupedSingles).sort();
104
+
71
105
  return (
72
- <Fragment>
73
- <StoreTitle>{"Magic: The Gathering" + " | " + (productType == "sealed-products" ? "Expansion Sets" : "All Sets")}</StoreTitle>
74
- <div className='text-[20px] pb-4 pt-5'><b>{productType == "sealed-products" ? "Expansion Sets" : "All Sets"}</b></div>
75
- {productType != "sealed-products" ? (
76
- <>
77
- <div className='flex flex-wrap mb-3'>
78
- {alpha.map((val, index) =>
79
- setsLengthArr[val] > 0 ? (
80
- <a className="py-2 px-3 font-bold mr-1 border" href={"#tab_list_"+val.toLowerCase()}>{val}</a>
81
- ) : (<span className="py-2 px-3 font-bold mr-1 border" style={{"color":"grey"}}>{val}</span>)
82
- )}
106
+ <>
107
+ <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
108
+ {productType == "sealed-products" ? "Expansion Sets" : "All Sets"}
109
+ </h1>
110
+ <div className='border border-gray-100 px-6'>
111
+ {productType != "sealed-products" ? (
112
+ <>
113
+ <section className='single_list-indexing-container relative m-auto py-10'>
114
+ <ul className='flex gap-2 justify-center flex-wrap'>
115
+ <li>
116
+ <button
117
+ className={cn(
118
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
119
+ 'leading-4 font-medium text-base hover_bg-gray-50'
120
+ )}
121
+ onClick={() => {
122
+ handleActive('all')
123
+ }}
124
+ >
125
+ All
126
+ </button>
127
+ </li>
128
+ {alpha.map((letter, index) => (
129
+ <li key={index}>
130
+ <button
131
+ className={cn(
132
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
133
+ 'leading-4 font-medium text-base ',
134
+ setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
135
+ )}
136
+ onClick={() => {
137
+ handleActive(letter)
138
+ }}
139
+ disabled={setsLengthArr[letter] > 0 ? false : true}
140
+ >
141
+ {letter}
142
+ </button>
143
+ </li>
144
+ ))}
145
+ </ul>
146
+ </section>
147
+ </>
148
+ ) : ''}
149
+ <Divider className="mb-5 px-4" />
150
+ <section className='singles-container'>
151
+ <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
152
+ {availableLetter.map((initialLetter, index) => (
153
+ <>
154
+ {/* {active === 'all' || active === initialLetter ? (
155
+ <div className='singles_group-wrapper mb-4 px-4 inline-block w-full' key={index}>
156
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
157
+ {initialLetter}
158
+ </div>
159
+ <div
160
+ className={cn(
161
+ 'singles_item-list flex flex-col'
162
+ )}
163
+ >
164
+ {groupedSingles[initialLetter].map((item, index) => (
165
+ <li key={index} className='list-none'>
166
+ <Link
167
+ to="/"
168
+ className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2"
169
+ >
170
+ {item.name}
171
+ </Link>
172
+ </li>
173
+ ))}
174
+ </div>
175
+
176
+ </div>
177
+ ) : null} */}
178
+ </>
179
+ ))}
180
+ {setRelases}
83
181
  </div>
84
- </>
85
- ) : ''}
86
- <div className='flex flex-wrap gap-[30px]'>{setRelases}</div>
87
- </Fragment>
182
+ </section>
183
+ </div>
184
+ {/* <StoreTitle>{"Magic: The Gathering" + " | " + (productType == "sealed-products" ? "Expansion Sets" : "All Sets")}</StoreTitle> */}
185
+ {/* <div className='text-[20px] pb-4 pt-5' id={productType == "sealed-products" ? 'expansion-sets' : 'all-sets'}><b></b></div>
186
+
187
+ <div className='flex flex-wrap gap-[30px]'>{setRelases}</div> */}
188
+ </>
88
189
  );
89
190
  };
90
191
 
@@ -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,10 @@
1
+ import React from 'react';
2
+ import Content from './dropdown';
3
+
4
+ const index = (props) => {
5
+ return (
6
+ <Content {...props} />
7
+ )
8
+ }
9
+
10
+ export default index
@@ -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
@@ -0,0 +1,15 @@
1
+ .singlesWrapper {
2
+ column-count: 1;
3
+ }
4
+
5
+ @media screen and (min-width: 768px) {
6
+ .singlesWrapper {
7
+ column-count: 2;
8
+ }
9
+ }
10
+
11
+ @media screen and (min-width: 1023px) {
12
+ .singlesWrapper {
13
+ column-count: 3;
14
+ }
15
+ }
@@ -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 subCategory.length ? <ul className={classes.root}>{subCategory}</ul> : '';
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
@@ -29,6 +29,7 @@ export const GET_CATEGORY_CONTENT = gql`
29
29
  description
30
30
  url_key
31
31
  url_path
32
+ custom_landing_page
32
33
  attributes_block {
33
34
  label
34
35
  code