@riosst100/pwa-marketplace 1.6.9 → 1.7.1
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/componentOverrideMapping.js +4 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +0 -4
- package/src/components/FilterTop/filterTop.js +0 -2
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +0 -1
- package/src/components/ProductLabel/index.js +47 -0
- package/src/components/ProductListTab/productListTab.js +51 -5
- package/src/components/ProductListTab/productListTab.module.css +1 -1
- package/src/components/RelatedProduct/relatedProduct.js +1 -1
- package/src/components/ShopBy/shopBy copy.js +172 -0
- package/src/components/ShopBy/shopBy.js +0 -1
- package/src/components/ShopBySets/shopBySets.js +0 -3
- package/src/components/SportCardsSets/index.js +2 -0
- package/src/components/SportCardsSets/sportCardsSets.js +372 -0
- package/src/components/SportCardsSets/sportCardsSets.module.css +76 -0
- package/src/components/SportCardsSets/sportCardsSets.shimmer.js +50 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/__fixtures__/apolloMocks.js +33 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ce.js +16 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ee.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.js +38 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/useCarousel.js +25 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/configAggregator.js +26 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.js +369 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.module.css +0 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/banner.module.css +103 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/configAggregator.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/index.js +2 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.js +221 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.module.css +231 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.js +126 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.module.css +5 -0
- package/src/overwrites/pagebuilder/lib/utils.js +224 -0
- package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +60 -0
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +4 -1
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +8 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +44 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.js +73 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.module.css +25 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.shimmer.js +18 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/index.js +7 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +12 -1
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +3 -3
- package/src/overwrites/venia-ui/lib/components/App/app.js +131 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +1 -1
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +4 -1
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +13 -3
- package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +176 -138
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +19 -10
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +5 -26
- package/src/overwrites/venia-ui/lib/components/RichContent/richContent.module.css +3 -3
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +0 -1
- package/src/overwrites/venia-ui/lib/index.module.css +137 -0
- package/src/overwrites/venia-ui/lib/tokens.module.css +167 -0
- package/src/talons/CollectibleGameSets/collectibleGameSets.gql.js +15 -1
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +0 -11
- package/src/talons/FilterTop/useFilterTop.js +0 -2
- package/src/talons/ShopBy/useShopBy.js +0 -22
- package/src/talons/SportCardsSets/sportCardsSets.gql.js +46 -0
- package/src/talons/SportCardsSets/useSportCardsSets.js +170 -0
- package/src/talons/SubCategoryPage/useSubCategoryPage.js +0 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
@import './tokens.module.css';
|
|
2
|
+
|
|
3
|
+
:global(*) {
|
|
4
|
+
/* composes: box-border from global; */
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* TODO @TW: cannot compose */
|
|
9
|
+
:global(html) {
|
|
10
|
+
/* composes: text-[100%] from global; */
|
|
11
|
+
font-size: 100%;
|
|
12
|
+
/* composes: text-normal from global; */
|
|
13
|
+
font-weight: 400;
|
|
14
|
+
/* composes: leading-none from global; */
|
|
15
|
+
line-height: 1;
|
|
16
|
+
/* composes: antialiased from global; */
|
|
17
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:global(html[data-scroll-lock='true']),
|
|
22
|
+
:global(html[data-scroll-lock='true'] body) {
|
|
23
|
+
height: 100%;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
position: fixed;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* TODO @TW: cannot compose */
|
|
30
|
+
:global(body),
|
|
31
|
+
:global(button),
|
|
32
|
+
:global(input),
|
|
33
|
+
:global(select),
|
|
34
|
+
:global(textarea) {
|
|
35
|
+
/* composes: text-gray-900 from global; */
|
|
36
|
+
/* color: rgb(var(--venia-global-color-text)); */
|
|
37
|
+
color: rgb(23 32 38);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:global(body) {
|
|
41
|
+
/* composes: m-0 from global; */
|
|
42
|
+
margin: 0;
|
|
43
|
+
/* composes: p-0 from global; */
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:global(h1),
|
|
48
|
+
:global(h2),
|
|
49
|
+
:global(h3),
|
|
50
|
+
:global(h4),
|
|
51
|
+
:global(h5),
|
|
52
|
+
:global(h6) {
|
|
53
|
+
/* composes: font-base from global; */
|
|
54
|
+
font-size: 1rem;
|
|
55
|
+
/* composes: font-normal from global; */
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
/* composes: m-0 from global; */
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:global(h1) {
|
|
62
|
+
/* composes: text-xl from global; */
|
|
63
|
+
font-size: 1.5rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:global(h2) {
|
|
67
|
+
/* composes: text-lg from global; */
|
|
68
|
+
font-size: 1.25rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:global(a) {
|
|
72
|
+
/* composes: text-current from global; */
|
|
73
|
+
color: currentColor;
|
|
74
|
+
/* composes: no-underline from global; */
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:global(p) {
|
|
79
|
+
/* composes: m-0 from global; */
|
|
80
|
+
margin: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:global(dl),
|
|
84
|
+
:global(ol),
|
|
85
|
+
:global(ul) {
|
|
86
|
+
/* composes: list-none from global; */
|
|
87
|
+
list-style-type: none;
|
|
88
|
+
/* composes: m-0 from global; */
|
|
89
|
+
margin: 0;
|
|
90
|
+
/* composes: p-0 from global; */
|
|
91
|
+
padding: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:global(dd),
|
|
95
|
+
:global(dt) {
|
|
96
|
+
/* composes: m-0 from global; */
|
|
97
|
+
margin: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* TODO @TW: cannot compose */
|
|
101
|
+
:global(button) {
|
|
102
|
+
/* composes: bg-transparent from global; */
|
|
103
|
+
background: none;
|
|
104
|
+
/* composes: border-0 from global; */
|
|
105
|
+
border: 0;
|
|
106
|
+
/* composes: cursor-pointer from global; */
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
/* composes: text-[100%] from global; */
|
|
109
|
+
font-size: 100%;
|
|
110
|
+
/* composes: p-0 from global; */
|
|
111
|
+
padding: 0;
|
|
112
|
+
touch-action: manipulation;
|
|
113
|
+
/* composes: select-none from global; */
|
|
114
|
+
user-select: none;
|
|
115
|
+
/* composes: appearance-none from global; */
|
|
116
|
+
-webkit-appearance: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:global(button:disabled) {
|
|
120
|
+
/* composes: cursor-default from global; */
|
|
121
|
+
cursor: default;
|
|
122
|
+
touch-action: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:global(.braintree-sheet__content--form
|
|
126
|
+
.braintree-form__field-group
|
|
127
|
+
.braintree-form__field
|
|
128
|
+
.braintree-form__hosted-field
|
|
129
|
+
input.braintree-form__raw-input) {
|
|
130
|
+
color: #8f8f8f !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:global(.braintree-sheet__content--form
|
|
134
|
+
.braintree-form__field-group
|
|
135
|
+
.braintree-form__descriptor) {
|
|
136
|
+
color: #757575 !important;
|
|
137
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* global tokens */
|
|
2
|
+
:global(:root) {
|
|
3
|
+
/* animation */
|
|
4
|
+
--venia-global-anim-bounce: cubic-bezier(0.5, 1.8, 0.9, 0.8);
|
|
5
|
+
--venia-global-anim-in: cubic-bezier(0, 0, 0.2, 1);
|
|
6
|
+
--venia-global-anim-out: cubic-bezier(0.4, 0, 1, 1);
|
|
7
|
+
--venia-global-anim-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
8
|
+
|
|
9
|
+
/* color */
|
|
10
|
+
--venia-global-color-blue-100: 194 200 255;
|
|
11
|
+
--venia-global-color-blue-400: 71 139 255;
|
|
12
|
+
/* --venia-global-color-blue-500: 51 109 255; */
|
|
13
|
+
/* --venia-global-color-blue-600: 41 84 255; */
|
|
14
|
+
--venia-global-color-blue-700: 31 57 255;
|
|
15
|
+
/* --venia-global-color-blue-800: 23 43 196; */
|
|
16
|
+
--venia-global-color-gray-50: 255 255 255;
|
|
17
|
+
/* --venia-global-color-gray-75: 250 250 250; */
|
|
18
|
+
--venia-global-color-gray-100: 244 245 245;
|
|
19
|
+
/* --venia-global-color-gray-200: 234 235 235; */
|
|
20
|
+
--venia-global-color-gray-300: 161 151 145;
|
|
21
|
+
--venia-global-color-gray-400: 181 184 186;
|
|
22
|
+
--venia-global-color-gray-500: 149 154 157;
|
|
23
|
+
--venia-global-color-gray-600: 118 123 127;
|
|
24
|
+
--venia-global-color-gray-700: 84 93 99;
|
|
25
|
+
/* --venia-global-color-gray-800: 51 63 71; */
|
|
26
|
+
--venia-global-color-gray-900: 23 32 38;
|
|
27
|
+
--venia-global-color-gray: var(--venia-global-color-gray-100);
|
|
28
|
+
--venia-global-color-gray-dark: var(--venia-global-color-gray-300);
|
|
29
|
+
--venia-global-color-gray-darker: var(--venia-global-color-gray-600);
|
|
30
|
+
/* --venia-global-color-green-400: 51 171 132; */
|
|
31
|
+
--venia-global-color-green-500: 45 157 120;
|
|
32
|
+
/* --venia-global-color-green-600: 38 142 108; */
|
|
33
|
+
/* --venia-global-color-green-700: 18 128 92; */
|
|
34
|
+
--venia-global-color-orange: 241 99 33;
|
|
35
|
+
--venia-global-color-red-400: 236 91 98;
|
|
36
|
+
/* --venia-global-color-red-500: 227 72 80; */
|
|
37
|
+
/* --venia-global-color-red-600: 215 55 63; */
|
|
38
|
+
--venia-global-color-red-700: 201 37 45;
|
|
39
|
+
/* --venia-global-color-red-800: 161 30 36; */
|
|
40
|
+
--venia-global-color-teal: var(--venia-global-color-blue-400);
|
|
41
|
+
/* --venia-global-color-teal-dark: var(--venia-global-color-blue-600); */
|
|
42
|
+
--venia-global-color-teal-light: var(--venia-global-color-gray-100);
|
|
43
|
+
|
|
44
|
+
/* color by semantics */
|
|
45
|
+
/* --venia-global-color-background: var(--venia-global-color-gray-50); */
|
|
46
|
+
--venia-global-color-border: var(--venia-global-color-gray-300);
|
|
47
|
+
--venia-global-color-error: var(--venia-global-color-red-700);
|
|
48
|
+
--venia-global-color-text: var(--venia-global-color-gray-900);
|
|
49
|
+
/* --venia-global-color-text-alt: var(--venia-global-color-gray-darker); */
|
|
50
|
+
--venia-global-color-text-hint: var(--venia-global-color-gray-500);
|
|
51
|
+
/* --venia-global-color-warning-dark: var(--venia-global-color-red-700); */
|
|
52
|
+
/* --venia-global-color-warning-light: var(--venia-global-color-gray-100); */
|
|
53
|
+
|
|
54
|
+
/* font family */
|
|
55
|
+
/* --venia-global-fontFamily-sansSerif: 'Muli', sans-serif; */
|
|
56
|
+
/* --venia-global-fontFamily-serif: 'Source Serif Pro', serif; */
|
|
57
|
+
|
|
58
|
+
/* font size */
|
|
59
|
+
/* --venia-global-fontSize-50: 0.6875rem; */
|
|
60
|
+
/* 11px */
|
|
61
|
+
/* --venia-global-fontSize-75: 0.75rem; */
|
|
62
|
+
/* 12px */
|
|
63
|
+
/* --venia-global-fontSize-100: 0.875rem; */
|
|
64
|
+
/* 14px */
|
|
65
|
+
/* --venia-global-fontSize-200: 1rem; */
|
|
66
|
+
/* 16px */
|
|
67
|
+
/* --venia-global-fontSize-300: 1.125rem; */
|
|
68
|
+
/* 18px */
|
|
69
|
+
/* --venia-global-fontSize-400: 1.25rem; */
|
|
70
|
+
/* 20px */
|
|
71
|
+
/* --venia-global-fontSize-500: 1.375rem; */
|
|
72
|
+
/* 22px */
|
|
73
|
+
/* --venia-global-fontSize-600: 1.5rem; */
|
|
74
|
+
/* 24px */
|
|
75
|
+
/* --venia-global-fontSize-700: 1.75rem; */
|
|
76
|
+
/* 28px */
|
|
77
|
+
/* --venia-global-fontSize-800: 2rem; */
|
|
78
|
+
/* 32px */
|
|
79
|
+
/* --venia-global-fontSize-900: 2.25rem; */
|
|
80
|
+
/* 36px */
|
|
81
|
+
/* --venia-global-fontSize-1000: 2.5rem; */
|
|
82
|
+
/* 40px */
|
|
83
|
+
/* --venia-global-fontSize-1100: 3rem; */
|
|
84
|
+
/* 48px */
|
|
85
|
+
/* --venia-global-fontSize-1200: 3.5rem; */
|
|
86
|
+
/* 56px */
|
|
87
|
+
|
|
88
|
+
/* font weight */
|
|
89
|
+
/* --venia-global-fontWeight-normal: 400; */
|
|
90
|
+
/* --venia-global-fontWeight-semibold: 600; */
|
|
91
|
+
/* --venia-global-fontWeight-bold: 700; */
|
|
92
|
+
|
|
93
|
+
/* line height */
|
|
94
|
+
/* --venia-global-lineHeight-100: 1; */
|
|
95
|
+
/* --venia-global-lineHeight-200: 1.25; */
|
|
96
|
+
/* --venia-global-lineHeight-300: 1.5; */
|
|
97
|
+
/* --venia-global-lineHeight-400: 1.75; */
|
|
98
|
+
/* --venia-global-lineHeight-500: 2; */
|
|
99
|
+
|
|
100
|
+
/* dimensions */
|
|
101
|
+
--venia-global-maxWidth: 1180px;
|
|
102
|
+
--venia-global-header-minHeight: 5rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (max-width: 959px) {
|
|
106
|
+
:global(:root) {
|
|
107
|
+
--venia-global-header-minHeight: 3.5rem;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* alias tokens */
|
|
112
|
+
:global(:root) {
|
|
113
|
+
/* colors */
|
|
114
|
+
--venia-brand-color-1-100: var(--venia-global-color-blue-100);
|
|
115
|
+
/* --venia-brand-color-1-400: var(--venia-global-color-blue-400); */
|
|
116
|
+
/* --venia-brand-color-1-500: var(--venia-global-color-blue-500); */
|
|
117
|
+
/* --venia-brand-color-1-600: var(--venia-global-color-blue-600); */
|
|
118
|
+
--venia-brand-color-1-700: var(--venia-global-color-blue-700);
|
|
119
|
+
/* --venia-brand-color-1-800: var(--venia-global-color-blue-800); */
|
|
120
|
+
|
|
121
|
+
/* typography - heading */
|
|
122
|
+
/*
|
|
123
|
+
--venia-global-typography-heading-XL-fontSize: var(
|
|
124
|
+
--venia-global-fontSize-600
|
|
125
|
+
);
|
|
126
|
+
--venia-global-typography-heading-L-fontSize: var(
|
|
127
|
+
--venia-global-fontSize-400
|
|
128
|
+
);
|
|
129
|
+
--venia-global-typography-heading-M-fontSize: var(
|
|
130
|
+
--venia-global-fontSize-300
|
|
131
|
+
);
|
|
132
|
+
--venia-global-typography-heading-S-fontSize: var(
|
|
133
|
+
--venia-global-fontSize-200
|
|
134
|
+
);
|
|
135
|
+
--venia-global-typography-heading-XS-fontSize: var(
|
|
136
|
+
--venia-global-fontSize-100
|
|
137
|
+
);
|
|
138
|
+
--venia-global-typography-heading-lineHeight: calc(
|
|
139
|
+
var(--venia-global-lineHeight-200) * 1em
|
|
140
|
+
);
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
/* typography - body */
|
|
144
|
+
/* --venia-typography-body-XXXL-fontSize: var(--venia-global-fontSize-600); */
|
|
145
|
+
/* --venia-typography-body-XXL-fontSize: var(--venia-global-fontSize-500); */
|
|
146
|
+
/* --venia-typography-body-XL-fontSize: var(--venia-global-fontSize-400); */
|
|
147
|
+
/* --venia-typography-body-L-fontSize: var(--venia-global-fontSize-300); */
|
|
148
|
+
/* --venia-typography-body-M-fontSize: var(--venia-global-fontSize-200); */
|
|
149
|
+
/* --venia-typography-body-S-fontSize: var(--venia-global-fontSize-100); */
|
|
150
|
+
/* --venia-typography-body-XS-fontSize: var(--venia-global-fontSize-50); */
|
|
151
|
+
/*
|
|
152
|
+
--venia-typography-body-lineHeight: calc(
|
|
153
|
+
var(--venia-global-lineHeight-300) * 1em
|
|
154
|
+
);
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
/* typography - detail */
|
|
158
|
+
/*
|
|
159
|
+
--venia-typography-detail-XL-fontSize: var(--venia-global-fontSize-200);
|
|
160
|
+
--venia-typography-detail-L-fontSize: var(--venia-global-fontSize-100);
|
|
161
|
+
--venia-typography-detail-M-fontSize: var(--venia-global-fontSize-75);
|
|
162
|
+
--venia-typography-detail-S-fontSize: var(--venia-global-fontSize-50);
|
|
163
|
+
--venia-typography-detail-lineHeight: calc(
|
|
164
|
+
var(--venia-global-lineHeight-200) * 1em
|
|
165
|
+
);
|
|
166
|
+
*/
|
|
167
|
+
}
|
|
@@ -27,7 +27,21 @@ export const GET_COLLECTIBLE_GAME_QUERY = gql`
|
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
29
|
|
|
30
|
+
export const GET_SPORT_CARDS_SETS_QUERY = gql`
|
|
31
|
+
query getSportCardsSets($categoryUrlKey: String!, $setType: String) {
|
|
32
|
+
sportCardsSets(categoryUrlKey: $categoryUrlKey, setType: $setType) {
|
|
33
|
+
group
|
|
34
|
+
sets {
|
|
35
|
+
set_name
|
|
36
|
+
option_id
|
|
37
|
+
release_year
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
30
43
|
export default {
|
|
31
44
|
getStoreConfigData: GET_STORE_CONFIG_DATA,
|
|
32
|
-
getCollectibleGameQuery: GET_COLLECTIBLE_GAME_QUERY
|
|
45
|
+
getCollectibleGameQuery: GET_COLLECTIBLE_GAME_QUERY,
|
|
46
|
+
getSportCardsSetsQuery: GET_SPORT_CARDS_SETS_QUERY
|
|
33
47
|
};
|
|
@@ -27,8 +27,6 @@ export const useCollectibleGameSets = props => {
|
|
|
27
27
|
nextFetchPolicy: 'cache-first'
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
// console.log(sortby)
|
|
31
|
-
|
|
32
30
|
const pathnameArr = pathname.split('/');
|
|
33
31
|
|
|
34
32
|
const categoryUrlKey = pathnameArr[pathnameArr.length - 1].replace('.html','');
|
|
@@ -58,8 +56,6 @@ export const useCollectibleGameSets = props => {
|
|
|
58
56
|
return null;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
// console.log(sortby)
|
|
62
|
-
|
|
63
59
|
const sortbyData = [];
|
|
64
60
|
if (sortby != 'all') {
|
|
65
61
|
collectibleGameSets.map((setRelease, index) => {
|
|
@@ -71,7 +67,6 @@ export const useCollectibleGameSets = props => {
|
|
|
71
67
|
// groupingSetsByYear.splice(release_year, 0, set);
|
|
72
68
|
const result = sortbyData.find(item => item.release_type === release_year);
|
|
73
69
|
|
|
74
|
-
// console.log(result)
|
|
75
70
|
// groupingSetsByYear[release_year] = set;
|
|
76
71
|
if (result) {
|
|
77
72
|
result.sets.push(set)
|
|
@@ -94,8 +89,6 @@ export const useCollectibleGameSets = props => {
|
|
|
94
89
|
|
|
95
90
|
const availableGroups = collectibleGameSets && collectibleGameSets.length ? collectibleGameSets.map(({ release_type }) => release_type) : [];
|
|
96
91
|
|
|
97
|
-
// console.log(collectibleGameSets)
|
|
98
|
-
|
|
99
92
|
const filteredCollectibleGameSets = useMemo(() => {
|
|
100
93
|
if (!collectibleGameSets) {
|
|
101
94
|
return null;
|
|
@@ -108,8 +101,6 @@ export const useCollectibleGameSets = props => {
|
|
|
108
101
|
setActive('all')
|
|
109
102
|
|
|
110
103
|
collectibleGameSets.map(({ release_type, sets }, index) => {
|
|
111
|
-
|
|
112
|
-
// console.log(sets)
|
|
113
104
|
const newSets = sets.filter(function(set) {
|
|
114
105
|
return set.set_name.search(new RegExp(searchQuery, "i")) != -1 || set.set_abbreviation.search(new RegExp(searchQuery, "i")) != -1 || release_type.search(new RegExp(searchQuery, "i")) != -1;
|
|
115
106
|
// return set.set_name.includes(searchQuery);
|
|
@@ -122,8 +113,6 @@ export const useCollectibleGameSets = props => {
|
|
|
122
113
|
})
|
|
123
114
|
}
|
|
124
115
|
})
|
|
125
|
-
|
|
126
|
-
// console.log(filteredSets)
|
|
127
116
|
}
|
|
128
117
|
|
|
129
118
|
return searchQuery ? filteredSets : collectibleGameSets;
|
|
@@ -98,8 +98,6 @@ export const useFilterTop = props => {
|
|
|
98
98
|
return disabled;
|
|
99
99
|
}, [pathname]);
|
|
100
100
|
|
|
101
|
-
// console.log(introspectionData)
|
|
102
|
-
|
|
103
101
|
// Get "allowed" filters by intersection of filter attribute codes and
|
|
104
102
|
// schema input field types. This restricts the displayed filters to those
|
|
105
103
|
// that the api will understand.
|
|
@@ -27,10 +27,6 @@ export const useShopBy = props => {
|
|
|
27
27
|
nextFetchPolicy: 'cache-first'
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// // console.log(sortby)
|
|
33
|
-
|
|
34
30
|
const pathnameArr = pathname.split('/');
|
|
35
31
|
|
|
36
32
|
const categoryUrlKey = pathnameArr[pathnameArr.length - 1].replace('.html','');
|
|
@@ -55,20 +51,15 @@ export const useShopBy = props => {
|
|
|
55
51
|
if (!data) {
|
|
56
52
|
return null;
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
// console.log(data)
|
|
60
54
|
|
|
61
55
|
const rawData = data.shopByData;
|
|
62
56
|
if (!rawData) {
|
|
63
57
|
return null;
|
|
64
58
|
}
|
|
65
|
-
|
|
66
|
-
// console.log(rawData)
|
|
67
59
|
|
|
68
60
|
let options = rawData[0].options;
|
|
69
61
|
|
|
70
62
|
const mappingData = options.reduce((acc, item) => {
|
|
71
|
-
// console.log(item)
|
|
72
63
|
let firstLetter = item.label.charAt(0).toUpperCase();
|
|
73
64
|
if (!alpha.includes(firstLetter)) {
|
|
74
65
|
firstLetter = '#';
|
|
@@ -78,10 +69,6 @@ export const useShopBy = props => {
|
|
|
78
69
|
return acc;
|
|
79
70
|
}, {});
|
|
80
71
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// console.log(mappingData)
|
|
84
|
-
|
|
85
72
|
const sortbyData = [];
|
|
86
73
|
|
|
87
74
|
return sortby != "all" ? sortbyData && sortbyData.length ? sortbyData.sort((a, b) => b.release_type.toLowerCase().localeCompare(a.release_type.toLowerCase())) : sortbyData : mappingData;
|
|
@@ -91,15 +78,11 @@ export const useShopBy = props => {
|
|
|
91
78
|
if (!data) {
|
|
92
79
|
return null;
|
|
93
80
|
}
|
|
94
|
-
|
|
95
|
-
// console.log(data)
|
|
96
81
|
|
|
97
82
|
const rawData = data.shopByData;
|
|
98
83
|
if (!rawData) {
|
|
99
84
|
return null;
|
|
100
85
|
}
|
|
101
|
-
|
|
102
|
-
// console.log(rawData)
|
|
103
86
|
|
|
104
87
|
let options = rawData[0].options;
|
|
105
88
|
|
|
@@ -111,7 +94,6 @@ export const useShopBy = props => {
|
|
|
111
94
|
}
|
|
112
95
|
|
|
113
96
|
const mappingData = options.reduce((acc, item) => {
|
|
114
|
-
// console.log(item)
|
|
115
97
|
let firstLetter = item.label.charAt(0).toUpperCase();
|
|
116
98
|
if (!alpha.includes(firstLetter)) {
|
|
117
99
|
firstLetter = '#';
|
|
@@ -121,10 +103,6 @@ export const useShopBy = props => {
|
|
|
121
103
|
return acc;
|
|
122
104
|
}, {});
|
|
123
105
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// console.log(mappingData)
|
|
127
|
-
|
|
128
106
|
const sortbyData = [];
|
|
129
107
|
|
|
130
108
|
return sortby != "all" ? sortbyData && sortbyData.length ? sortbyData.sort((a, b) => b.release_type.toLowerCase().localeCompare(a.release_type.toLowerCase())) : sortbyData : mappingData;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
export const GET_STORE_CONFIG_DATA = gql`
|
|
4
|
+
query getStoreConfigData {
|
|
5
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
6
|
+
storeConfig {
|
|
7
|
+
store_code
|
|
8
|
+
product_url_suffix
|
|
9
|
+
category_url_suffix
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const GET_SPORT_CARDS_SETS_QUERY = gql`
|
|
15
|
+
query getSportCardsSets($categoryUrlKey: String!, $setType: String) {
|
|
16
|
+
sportCardsSets(categoryUrlKey: $categoryUrlKey, setType: $setType) {
|
|
17
|
+
group
|
|
18
|
+
sets {
|
|
19
|
+
set_name
|
|
20
|
+
option_id
|
|
21
|
+
release_year
|
|
22
|
+
sc_league
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export const GET_CATEGORY_CONTENT = gql`
|
|
29
|
+
query getCategoryData($id: String!) {
|
|
30
|
+
categories(filters: { category_uid: { in: [$id] } }) {
|
|
31
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
32
|
+
items {
|
|
33
|
+
uid
|
|
34
|
+
name
|
|
35
|
+
url_key
|
|
36
|
+
url_path
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
getStoreConfigData: GET_STORE_CONFIG_DATA,
|
|
44
|
+
getSportCardsSetsQuery: GET_SPORT_CARDS_SETS_QUERY,
|
|
45
|
+
getCategoryContentQuery: GET_CATEGORY_CONTENT
|
|
46
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client';
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { useLocation } from 'react-router-dom';
|
|
4
|
+
import { useAppContext } from '@magento/peregrine/lib/context/app';
|
|
5
|
+
|
|
6
|
+
import mergeOperations from '@magento/peregrine/lib/util/shallowMerge';
|
|
7
|
+
import DEFAULT_OPERATIONS from './sportCardsSets.gql';
|
|
8
|
+
|
|
9
|
+
export const useSportCardsSets = props => {
|
|
10
|
+
|
|
11
|
+
const { searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab } = props
|
|
12
|
+
|
|
13
|
+
const { value: sortby } = currentSort
|
|
14
|
+
|
|
15
|
+
const operations = mergeOperations(DEFAULT_OPERATIONS, null);
|
|
16
|
+
const { getStoreConfigData, getSportCardsSetsQuery, getCategoryContentQuery } = operations;
|
|
17
|
+
const { pathname } = useLocation();
|
|
18
|
+
const [
|
|
19
|
+
,
|
|
20
|
+
{
|
|
21
|
+
actions: { setPageLoading }
|
|
22
|
+
}
|
|
23
|
+
] = useAppContext();
|
|
24
|
+
|
|
25
|
+
const { data: storeConfigData } = useQuery(getStoreConfigData, {
|
|
26
|
+
fetchPolicy: 'cache-and-network',
|
|
27
|
+
nextFetchPolicy: 'cache-first'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const pathnameArr = pathname.split('/');
|
|
31
|
+
|
|
32
|
+
const categoryUrlKey = pathnameArr[pathnameArr.length - 1].replace('.html','');
|
|
33
|
+
const parentCategoryUrlKey = pathnameArr[pathnameArr.length - 2].replace('.html','');
|
|
34
|
+
const productType = shopby;
|
|
35
|
+
|
|
36
|
+
const categoryUrlSuffix = storeConfigData?.storeConfig?.category_url_suffix;
|
|
37
|
+
|
|
38
|
+
const { error, loading, data } = useQuery(getSportCardsSetsQuery, {
|
|
39
|
+
fetchPolicy: 'cache-and-network',
|
|
40
|
+
nextFetchPolicy: 'cache-first',
|
|
41
|
+
skip: !storeConfigData,
|
|
42
|
+
variables: {
|
|
43
|
+
categoryUrlKey: categoryUrlKey,
|
|
44
|
+
setType: setType
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// console.log(data)
|
|
49
|
+
|
|
50
|
+
const isBackgroundLoading = !!data && loading;
|
|
51
|
+
|
|
52
|
+
const availableLeagues = [];
|
|
53
|
+
|
|
54
|
+
const sportCardsSets = useMemo(() => {
|
|
55
|
+
if (!data) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const sportCardsSets = data.sportCardsSets;
|
|
60
|
+
if (!sportCardsSets) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const sortbyData = [];
|
|
65
|
+
// if (activeTab == 'year') {
|
|
66
|
+
|
|
67
|
+
// console.log(activeTab)
|
|
68
|
+
sportCardsSets.map((setRelease, index) => {
|
|
69
|
+
const { group, sets } = setRelease;
|
|
70
|
+
if (sets.length) {
|
|
71
|
+
sets.map((set, index) => {
|
|
72
|
+
const { release_year, sc_league } = set;
|
|
73
|
+
if (sc_league) {
|
|
74
|
+
if (!availableLeagues.includes(sc_league)) {
|
|
75
|
+
availableLeagues.push(sc_league);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// if (release_year) {
|
|
79
|
+
// // groupingSetsByYear.splice(release_year, 0, set);
|
|
80
|
+
// const result = sortbyData.find(item => item.group === release_year);
|
|
81
|
+
|
|
82
|
+
// // groupingSetsByYear[release_year] = set;
|
|
83
|
+
// if (result) {
|
|
84
|
+
// result.sets.push(set)
|
|
85
|
+
// } else {
|
|
86
|
+
// // if (sortby == "date" || sortby == "newest" && sortbyData.length < 2) {
|
|
87
|
+
// sortbyData.push({
|
|
88
|
+
// 'group': release_year,
|
|
89
|
+
// 'sets': [set]
|
|
90
|
+
// })
|
|
91
|
+
// // }
|
|
92
|
+
// }
|
|
93
|
+
// }
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
return activeTab == "year" ? sortbyData && sortbyData.length ? sortbyData.sort((a, b) => b.group.toLowerCase().localeCompare(a.group.toLowerCase())) : sortbyData : sportCardsSets.slice().sort((a, b) => a.group.toLowerCase().localeCompare(b.group.toLowerCase()));
|
|
100
|
+
}, [data, activeTab]);
|
|
101
|
+
|
|
102
|
+
const availableGroups = sportCardsSets && sportCardsSets.length ? sportCardsSets.map(({ group }) => group) : [];
|
|
103
|
+
|
|
104
|
+
// const availableLeagues = sportCardsSets && sportCardsSets.length ? sportCardsSets.map(({ sets }) => sportCardsSets.map(({ sc_league }) => sc_league)) : [];
|
|
105
|
+
// console.log(availableLeagues)
|
|
106
|
+
// sc_league
|
|
107
|
+
|
|
108
|
+
const filteredsportCardsSets = useMemo(() => {
|
|
109
|
+
if (!sportCardsSets) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const filteredSets = [];
|
|
114
|
+
|
|
115
|
+
if (searchQuery) {
|
|
116
|
+
|
|
117
|
+
setActive('all')
|
|
118
|
+
|
|
119
|
+
sportCardsSets.map(({ group, sets }, index) => {
|
|
120
|
+
const newSets = sets.filter(function(set) {
|
|
121
|
+
return set.set_name.search(new RegExp(searchQuery, "i")) != -1 || group.search(new RegExp(searchQuery, "i")) != -1;
|
|
122
|
+
// return set.set_name.includes(searchQuery);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
if (newSets && newSets.length) {
|
|
126
|
+
filteredSets.push({
|
|
127
|
+
'group': group,
|
|
128
|
+
'sets': newSets
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return searchQuery ? filteredSets : sportCardsSets;
|
|
135
|
+
}, [sportCardsSets, searchQuery, sortby]);
|
|
136
|
+
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
setPageLoading(isBackgroundLoading);
|
|
139
|
+
}, [isBackgroundLoading, setPageLoading]);
|
|
140
|
+
|
|
141
|
+
const { data: categoryData, loading: categoryLoading } = useQuery(
|
|
142
|
+
getCategoryContentQuery,
|
|
143
|
+
{
|
|
144
|
+
fetchPolicy: 'cache-and-network',
|
|
145
|
+
nextFetchPolicy: 'cache-first',
|
|
146
|
+
skip: !categoryId,
|
|
147
|
+
variables: {
|
|
148
|
+
id: categoryId
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
const category =
|
|
154
|
+
categoryData && categoryData.categories.items.length
|
|
155
|
+
? categoryData.categories.items[0]
|
|
156
|
+
: null;
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
error,
|
|
160
|
+
loading,
|
|
161
|
+
sportCardsSets,
|
|
162
|
+
filteredsportCardsSets,
|
|
163
|
+
categoryUrlSuffix,
|
|
164
|
+
categoryUrlKey,
|
|
165
|
+
productType,
|
|
166
|
+
availableGroups,
|
|
167
|
+
category,
|
|
168
|
+
// availableLeagues
|
|
169
|
+
};
|
|
170
|
+
};
|
|
@@ -80,7 +80,6 @@ export const useSubCategoryPage = props => {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const mappingData = options.reduce((acc, item) => {
|
|
83
|
-
console.log(item)
|
|
84
83
|
let firstLetter = item.name.charAt(0).toUpperCase();
|
|
85
84
|
if (!alpha.includes(firstLetter)) {
|
|
86
85
|
firstLetter = '#';
|
|
@@ -93,8 +92,6 @@ export const useSubCategoryPage = props => {
|
|
|
93
92
|
return mappingData;
|
|
94
93
|
}, [children, searchQuery]);
|
|
95
94
|
|
|
96
|
-
console.log(dataResult)
|
|
97
|
-
|
|
98
95
|
const availableGroups = originalDataResult ? Object.keys(originalDataResult).sort() : [];
|
|
99
96
|
const filteredAvailableGroups = dataResult ? Object.keys(dataResult).sort() : [];
|
|
100
97
|
|