@riosst100/pwa-marketplace 2.1.3 → 2.1.5
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 +6 -0
- package/src/components/FavoriteSeller/AddToListButton/addToListButton.js +54 -54
- package/src/components/FavoriteSeller/AddToListButton/addToListButton.module.css +17 -17
- package/src/components/FavoriteSeller/AddToListButton/index.js +1 -1
- package/src/components/FavoriteSeller/AddToListButton/useCommonToasts.js +33 -33
- package/src/components/FilterTop/CustomFilters/customFilters.js +130 -132
- package/src/components/FilterTop/filterTop.js +1 -8
- package/src/components/LinkToOtherStores/index.js +61 -0
- package/src/components/NonSportCardsSets/nonSportCardsSets.js +0 -2
- package/src/components/RFQ/index.js +6 -3
- package/src/components/SellerDetail/sellerDetail.js +18 -1
- package/src/components/SellerInformation/sellerInformation.js +5 -3
- package/src/components/SellerSocialMedia/index.js +96 -0
- package/src/components/SetsData/index.js +2 -0
- package/src/components/SetsData/setsData.js +349 -0
- package/src/components/SetsData/setsData.module.css +76 -0
- package/src/components/SetsData/setsData.shimmer.js +50 -0
- package/src/components/ShopBy/shopBy.js +3 -2
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.js +13 -0
- package/src/overwrites/peregrine/lib/talons/MagentoRoute/magentoRoute.gql.js +27 -0
- package/src/overwrites/peregrine/lib/talons/MagentoRoute/useMagentoRoute.js +193 -0
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +40 -9
- package/src/overwrites/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js +77 -0
- package/src/overwrites/peregrine/lib/talons/ProductOptions/useOption.js +59 -0
- package/src/overwrites/peregrine/lib/talons/ProductOptions/useTile.js +47 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +13 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +23 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +11 -3
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +0 -6
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.js +0 -1
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.js +0 -1
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +0 -3
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +0 -1
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +17 -3
- package/src/overwrites/venia-ui/lib/components/Price/price.js +113 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +77 -104
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.js +3 -1
- package/src/overwrites/venia-ui/lib/components/ProductOptions/option.js +112 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/option.module.css +30 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/options.js +49 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tile.js +118 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tile.module.css +68 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tileList.js +78 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tileList.module.css +6 -0
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tileList.shimmer.js +32 -0
- package/src/talons/CustomFilters/useCustomFilters.js +0 -2
- package/src/talons/FavoriteSeller/AddToListButton/addToListButton.gql.js +30 -30
- package/src/talons/FavoriteSeller/AddToListButton/useAddToFavoriteListButton.js +0 -1
- package/src/talons/LegoSets/useLegoSets.js +0 -5
- package/src/talons/Seller/useSeller.js +1 -1
- package/src/talons/SetsData/setsData.gql.js +70 -0
- package/src/talons/SetsData/useSetsData.js +225 -0
- package/src/talons/ShopBy/shopBy.gql.js +12 -6
- package/src/talons/ShopBy/useShopBy.js +13 -4
- package/src/talons/TrainsSets/useTrainsSets.js +0 -3
|
@@ -76,6 +76,23 @@ const SellerDetail = props => {
|
|
|
76
76
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
const getSellerAddressDisplay = (seller) => {
|
|
80
|
+
let city = seller?.city;
|
|
81
|
+
let country = seller?.country;
|
|
82
|
+
|
|
83
|
+
let result = '';
|
|
84
|
+
if (city && country) {
|
|
85
|
+
result = `${city}, ${country}`;
|
|
86
|
+
}
|
|
87
|
+
if (city && !country) {
|
|
88
|
+
result = `${city}`;
|
|
89
|
+
}
|
|
90
|
+
if (!city && country) {
|
|
91
|
+
result = `${country}`;
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
|
|
79
96
|
return (
|
|
80
97
|
<div className=' py-8'>
|
|
81
98
|
<Slider seller={seller} rootClassname='mb-[30px]' />
|
|
@@ -106,7 +123,7 @@ const SellerDetail = props => {
|
|
|
106
123
|
</div>
|
|
107
124
|
</div>
|
|
108
125
|
<div class="relative w-fit font-normal text-[#999999] text-[12px] tracking-[0] leading-[14px] whitespace-nowrap">
|
|
109
|
-
{seller ? seller
|
|
126
|
+
{seller ? getSellerAddressDisplay(seller) : ''}
|
|
110
127
|
</div>
|
|
111
128
|
</div>
|
|
112
129
|
<div className='flex flex-wrap items-start gap-4 relative'>
|
|
@@ -3,6 +3,7 @@ import SellerLocation from '../SellerLocation';
|
|
|
3
3
|
import { Location, ShopAdd } from 'iconsax-react';
|
|
4
4
|
import OperatingHours from '@riosst100/pwa-marketplace/src/components/OperatingHours';
|
|
5
5
|
import SellerAddressCard from '@riosst100/pwa-marketplace/src/components/Seller/sellerAddressCard';
|
|
6
|
+
import SellerSocialMedia from '@riosst100/pwa-marketplace/src/components/SellerSocialMedia';
|
|
6
7
|
|
|
7
8
|
const SellerInformation = ({ seller }) => {
|
|
8
9
|
return (
|
|
@@ -59,10 +60,11 @@ const SellerInformation = ({ seller }) => {
|
|
|
59
60
|
{seller ? seller.term_and_conditions : ''}
|
|
60
61
|
</div>
|
|
61
62
|
</div>
|
|
62
|
-
</div
|
|
63
|
-
</div
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<SellerSocialMedia seller={seller} />
|
|
64
66
|
{seller ? <SellerLocation storeLocators={seller.store_locators} /> : ''}
|
|
65
|
-
</div
|
|
67
|
+
</div>
|
|
66
68
|
</>
|
|
67
69
|
)
|
|
68
70
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const SellerSocialMedia = (props) => {
|
|
4
|
+
|
|
5
|
+
const { seller } = props;
|
|
6
|
+
|
|
7
|
+
const { twitter_id, facebook_id, youtube_id, instagram_id, linkedin_id } = seller;
|
|
8
|
+
|
|
9
|
+
const socialMediaLinks = [
|
|
10
|
+
{
|
|
11
|
+
code: 'X',
|
|
12
|
+
link: twitter_id
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
code: 'Facebook',
|
|
16
|
+
link: facebook_id
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
code: 'Youtube',
|
|
20
|
+
link: youtube_id
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
code: 'Instagram',
|
|
24
|
+
link: instagram_id
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
code: 'LinkedIn',
|
|
28
|
+
link: linkedin_id
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const getLogo = (code) => {
|
|
33
|
+
let img = '';
|
|
34
|
+
if (code == "X") {
|
|
35
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/5/53/X_logo_2023_original.svg';
|
|
36
|
+
}
|
|
37
|
+
if (code == "Facebook") {
|
|
38
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/1280px-Facebook_f_logo_%282019%29.svg.png';
|
|
39
|
+
}
|
|
40
|
+
if (code == "Youtube") {
|
|
41
|
+
img = 'https://cdn3.iconfinder.com/data/icons/social-network-30/512/social-06-512.png';
|
|
42
|
+
}
|
|
43
|
+
if (code == "Instagram") {
|
|
44
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Instagram_logo_2022.svg/768px-Instagram_logo_2022.svg.png';
|
|
45
|
+
}
|
|
46
|
+
if (code == "LinkedIn") {
|
|
47
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/LinkedIn_icon.svg/1024px-LinkedIn_icon.svg.png';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return img;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let sellerSocialMediaResult = [];
|
|
54
|
+
|
|
55
|
+
if (socialMediaLinks && socialMediaLinks.length) {
|
|
56
|
+
socialMediaLinks.forEach((socialMedia) => {
|
|
57
|
+
if (socialMedia.code && socialMedia.link) {
|
|
58
|
+
const logo = getLogo(socialMedia.code);
|
|
59
|
+
sellerSocialMediaResult.push(
|
|
60
|
+
<a href={socialMedia.link} className='platform_logo-wrapper rounded-md px-5 py-2.5 border border-gray-100 flex items-center' target="_blank">
|
|
61
|
+
{logo ? <img
|
|
62
|
+
alt={socialMedia.code}
|
|
63
|
+
// width="auto"
|
|
64
|
+
// height={30}
|
|
65
|
+
src={logo}
|
|
66
|
+
style={{
|
|
67
|
+
"height":"20px"
|
|
68
|
+
}}
|
|
69
|
+
/> : socialMedia.code}
|
|
70
|
+
</a>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return sellerSocialMediaResult && sellerSocialMediaResult.length ? <>
|
|
77
|
+
<div class="flex items-start relative self-stretch w-full flex-[0_0_auto]">
|
|
78
|
+
<div class="flex flex-col items-start gap-[15px] relative flex-1 grow">
|
|
79
|
+
<div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-DemiBold',Helvetica] font-bold text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">Social Media</div>
|
|
80
|
+
<div class="inline-flex items-center justify-center gap-[10px] relative flex-[0_0_auto]">
|
|
81
|
+
<div class="flex flex-col items-start gap-[10px]" style={
|
|
82
|
+
{
|
|
83
|
+
"display": "flex",
|
|
84
|
+
"flex-direction": "row",
|
|
85
|
+
"align-items": "center"
|
|
86
|
+
}
|
|
87
|
+
}>
|
|
88
|
+
{sellerSocialMediaResult}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</> : '';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default SellerSocialMedia;
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import React, { Fragment, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
|
|
3
|
+
import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
|
|
4
|
+
import { useSetsData } from '@riosst100/pwa-marketplace/src/talons/SetsData/useSetsData';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
7
|
+
import defaultClasses from './setsData.module.css';
|
|
8
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
9
|
+
import cn from 'classnames';
|
|
10
|
+
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
11
|
+
import { SetsDataShimmer } from '@riosst100/pwa-marketplace/src/components/SetsData';
|
|
12
|
+
import CustomSortBy from '@riosst100/pwa-marketplace/src/components/CustomSortBy';
|
|
13
|
+
import ArraySearchInput from '@riosst100/pwa-marketplace/src/components/ArraySearchInput';
|
|
14
|
+
import { useCustomSort } from '@riosst100/pwa-marketplace/src/hooks/useCustomSort';
|
|
15
|
+
import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs';
|
|
16
|
+
|
|
17
|
+
const SetsData = props => {
|
|
18
|
+
const { categoryId } = props
|
|
19
|
+
|
|
20
|
+
const { location } = globalThis;
|
|
21
|
+
|
|
22
|
+
const query = new URLSearchParams(location.search);
|
|
23
|
+
|
|
24
|
+
const [active, setActive] = useState('all');
|
|
25
|
+
const [activeTab, setActiveTab] = useState('all');
|
|
26
|
+
const [activeFilter, setActiveFilter] = useState('');
|
|
27
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
28
|
+
|
|
29
|
+
const shopby = query.get('shopby') || null;
|
|
30
|
+
const setType = query.get('set_type') || null;
|
|
31
|
+
|
|
32
|
+
let defaultSort = {
|
|
33
|
+
sortText: 'All (A-Z)',
|
|
34
|
+
value: 'all'
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (shopby == "release_year") {
|
|
38
|
+
defaultSort = {
|
|
39
|
+
sortText: 'All (By Year)',
|
|
40
|
+
value: 'date'
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// if (productType == "expansion_sets") {
|
|
45
|
+
// defaultSort = {
|
|
46
|
+
// sortText: 'All (Expansion Sets)',
|
|
47
|
+
// value: 'all'
|
|
48
|
+
// };
|
|
49
|
+
// }
|
|
50
|
+
|
|
51
|
+
// Sorting
|
|
52
|
+
const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
|
|
53
|
+
const [currentSort] = sortProps;
|
|
54
|
+
// const [sortBy, setSortBy] = useState({
|
|
55
|
+
// sortText: 'All (A-Z)',
|
|
56
|
+
// value: 'all'
|
|
57
|
+
// });
|
|
58
|
+
|
|
59
|
+
// let availableSortBy = [
|
|
60
|
+
// {
|
|
61
|
+
// 'label': 'All (A-Z)',
|
|
62
|
+
// 'value': 'all'
|
|
63
|
+
// },
|
|
64
|
+
// {
|
|
65
|
+
// 'label': 'By Year',
|
|
66
|
+
// 'value': 'newest'
|
|
67
|
+
// }
|
|
68
|
+
// ];
|
|
69
|
+
|
|
70
|
+
const classes = useStyle(defaultClasses);
|
|
71
|
+
|
|
72
|
+
const talonProps = useSetsData({ activeFilter, searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab });
|
|
73
|
+
|
|
74
|
+
const { error, loading, setsData, categoryUrlSuffix, categoryUrlKey, productType, filteredSetsData, availableGroups, category, attributeData, pageInfo } = talonProps;
|
|
75
|
+
|
|
76
|
+
if (loading && !setsData)
|
|
77
|
+
return <SetsDataShimmer />;
|
|
78
|
+
if (error && !setsData) return <ErrorView />;
|
|
79
|
+
|
|
80
|
+
if (!setsData && !loading && !error) {
|
|
81
|
+
return <SetsDataShimmer />;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const setsLengthArr = [];
|
|
85
|
+
|
|
86
|
+
const newSetsData = searchQuery ? filteredSetsData : setsData;
|
|
87
|
+
|
|
88
|
+
// useEffect(() => {
|
|
89
|
+
if (setsData && setsData.length) {
|
|
90
|
+
setsData.map((setRelease, index) => {
|
|
91
|
+
const { group, sets } = setRelease;
|
|
92
|
+
|
|
93
|
+
setsLengthArr[group] = sets.length
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
// }, [setsData])
|
|
97
|
+
|
|
98
|
+
const splitToNChunks = (array, n) => {
|
|
99
|
+
let result = [];
|
|
100
|
+
for (let i = n; i > 0; i--) {
|
|
101
|
+
result.push(array.splice(0, Math.ceil(array.length / i)));
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let allSetsTitle = "Sets";
|
|
107
|
+
let attributeCode = attributeData ? attributeData.attribute_code : '';
|
|
108
|
+
let byYearTitle = "By Year";
|
|
109
|
+
// if (shopby == "singles") {
|
|
110
|
+
// attributeCode = "lego_set_name";
|
|
111
|
+
// // allSetsTitle = "Singles";
|
|
112
|
+
// byYearTitle = "By Year";
|
|
113
|
+
// }
|
|
114
|
+
|
|
115
|
+
const setRelases = newSetsData && newSetsData.length && newSetsData.map((setRelease, index) => {
|
|
116
|
+
const { group, sets } = setRelease;
|
|
117
|
+
|
|
118
|
+
const setsResult = [];
|
|
119
|
+
|
|
120
|
+
if (sets.length) {
|
|
121
|
+
sets.map((set, index) => {
|
|
122
|
+
const { set_name, option_id, release_year } = set;
|
|
123
|
+
|
|
124
|
+
const categoryUrl = resourceUrl(
|
|
125
|
+
`/${category?.url_path}${categoryUrlSuffix || ''}?${attributeCode}[filter]=${set_name},${option_id}`
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
setsResult.push(<li className='list-none'>
|
|
129
|
+
<Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
|
|
130
|
+
{set_name}
|
|
131
|
+
</Link>
|
|
132
|
+
</li>)
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
let setsResultSplitted = [];
|
|
137
|
+
if (active == group || newSetsData.length == 1) {
|
|
138
|
+
setsResultSplitted = splitToNChunks(setsResult, 3);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return (
|
|
142
|
+
<>
|
|
143
|
+
{active == "all" && newSetsData.length > 1 ?
|
|
144
|
+
<div className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
|
|
145
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' >
|
|
146
|
+
{group}
|
|
147
|
+
</div>
|
|
148
|
+
<div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
|
|
149
|
+
</div> : ''}
|
|
150
|
+
{active == group || newSetsData.length == 1 ? setsResultSplitted && setsResultSplitted.length && setsResultSplitted.map((setsResult, index) =>
|
|
151
|
+
<div key={index} className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
|
|
152
|
+
{index == 0 ? <div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2'>{group}</div> :
|
|
153
|
+
<div className='singles_item_group_letter text-xl font-medium pb-1 mb-2' style={{"marginTop":"35px"}}></div>}
|
|
154
|
+
<div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
|
|
155
|
+
</div>
|
|
156
|
+
)
|
|
157
|
+
: ''}
|
|
158
|
+
</>
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const handleActive = (val) => {
|
|
163
|
+
setActive(val);
|
|
164
|
+
|
|
165
|
+
setSearchQuery('')
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const handleActiveTab = (val) => {
|
|
169
|
+
setActiveTab(val);
|
|
170
|
+
setActive('all');
|
|
171
|
+
setActiveFilter('');
|
|
172
|
+
|
|
173
|
+
setSearchQuery('')
|
|
174
|
+
}
|
|
175
|
+
const handleSearchQuery = (val) => {
|
|
176
|
+
setSearchQuery(val)
|
|
177
|
+
setActive('all')
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let 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'];
|
|
181
|
+
|
|
182
|
+
let title = pageInfo ? pageInfo.title : 'All Sets';
|
|
183
|
+
if (activeTab == "year") {
|
|
184
|
+
title = "Sets | By Year";
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const availableFilters = [
|
|
188
|
+
'Theme',
|
|
189
|
+
'Sub-Theme',
|
|
190
|
+
'Interest',
|
|
191
|
+
'Age Level'
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
const handleActiveFilter = (val) => {
|
|
195
|
+
setActiveFilter(val);
|
|
196
|
+
|
|
197
|
+
setActive('all');
|
|
198
|
+
|
|
199
|
+
setSearchQuery('')
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
<Fragment>
|
|
204
|
+
<StoreTitle>{title}</StoreTitle>
|
|
205
|
+
<Breadcrumbs categoryId={categoryId} customPage={shopby == "singles" ? "Mini-Figures" : title} />
|
|
206
|
+
{/* <ul className={classes.nav}>
|
|
207
|
+
<li className={classes.nav_item}>
|
|
208
|
+
<button
|
|
209
|
+
onClick={() => {
|
|
210
|
+
handleActiveTab('year')
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
{activeTab == 'year' ? <b>{byYearTitle}</b> : byYearTitle}
|
|
214
|
+
</button>
|
|
215
|
+
</li>
|
|
216
|
+
<li className={classes.nav_item}>
|
|
217
|
+
<button
|
|
218
|
+
onClick={() => {
|
|
219
|
+
handleActiveTab('all')
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
{activeTab == 'all' ? <b>{allSetsTitle}</b> : allSetsTitle}
|
|
223
|
+
</button>
|
|
224
|
+
</li>
|
|
225
|
+
</ul> */}
|
|
226
|
+
{shopby == "lego_set_name" && activeTab == "all" ? <><ul className={classes.nav}>
|
|
227
|
+
{availableFilters.map((group, index) => (
|
|
228
|
+
<li key={index} className={classes.nav_item}>
|
|
229
|
+
<button
|
|
230
|
+
onClick={() => {
|
|
231
|
+
handleActiveFilter(group)
|
|
232
|
+
}}
|
|
233
|
+
>
|
|
234
|
+
{activeFilter == group ? <b>{group}</b> : group}
|
|
235
|
+
</button>
|
|
236
|
+
</li>
|
|
237
|
+
))}<li className={classes.nav_item}>
|
|
238
|
+
<button
|
|
239
|
+
onClick={() => {
|
|
240
|
+
handleActiveFilter('')
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
{!activeFilter ? <b>A-Z</b> : 'A-Z'}
|
|
244
|
+
</button>
|
|
245
|
+
</li></ul>
|
|
246
|
+
|
|
247
|
+
</> : ''}
|
|
248
|
+
{!pageInfo.hide_title && <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
|
|
249
|
+
{title}
|
|
250
|
+
</h1>}
|
|
251
|
+
{activeTab == "year" && availableGroups ? <ul className={classes.nav}>
|
|
252
|
+
{availableGroups.map((group, index) => (
|
|
253
|
+
<li key={index} className={classes.nav_item}>
|
|
254
|
+
<button
|
|
255
|
+
onClick={() => {
|
|
256
|
+
handleActive(group)
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
{active == group ? <b>{group}</b> : group}
|
|
260
|
+
</button>
|
|
261
|
+
</li>
|
|
262
|
+
))}
|
|
263
|
+
<li className={classes.nav_item}>
|
|
264
|
+
<button
|
|
265
|
+
onClick={() => {
|
|
266
|
+
handleActive('all')
|
|
267
|
+
}}
|
|
268
|
+
>
|
|
269
|
+
{active == 'all' ? <b>All</b> : 'All'}
|
|
270
|
+
</button>
|
|
271
|
+
</li>
|
|
272
|
+
</ul> : ''}
|
|
273
|
+
{pageInfo.filter_group && <ul className={classes.nav}>
|
|
274
|
+
{availableGroups.map((group, index) => (
|
|
275
|
+
<li key={index} className={classes.nav_item}>
|
|
276
|
+
<button
|
|
277
|
+
onClick={() => {
|
|
278
|
+
handleActive(group)
|
|
279
|
+
}}
|
|
280
|
+
>
|
|
281
|
+
{active == group ? <b>{group}</b> : group}
|
|
282
|
+
</button>
|
|
283
|
+
</li>
|
|
284
|
+
))}
|
|
285
|
+
<li className={classes.nav_item}>
|
|
286
|
+
<button
|
|
287
|
+
onClick={() => {
|
|
288
|
+
handleActive('all')
|
|
289
|
+
}}
|
|
290
|
+
>
|
|
291
|
+
{active == 'all' ? <b>All</b> : 'All'}
|
|
292
|
+
</button>
|
|
293
|
+
</li>
|
|
294
|
+
</ul>}
|
|
295
|
+
<div className='border border-gray-100 px-6'>
|
|
296
|
+
{setsData ? (
|
|
297
|
+
<div
|
|
298
|
+
className={classes.toolbar}
|
|
299
|
+
>
|
|
300
|
+
<div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={handleSearchQuery} /></div>
|
|
301
|
+
{/* <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} /> */}
|
|
302
|
+
</div>
|
|
303
|
+
) : ''}
|
|
304
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
305
|
+
{!activeFilter && activeTab != "year" && <ul className='flex gap-2 justify-center flex-wrap'>
|
|
306
|
+
<li>
|
|
307
|
+
<button
|
|
308
|
+
className={cn(
|
|
309
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
310
|
+
'leading-4 font-medium text-base hover_bg-gray-50'
|
|
311
|
+
)}
|
|
312
|
+
onClick={() => {
|
|
313
|
+
handleActive('all')
|
|
314
|
+
}}
|
|
315
|
+
>
|
|
316
|
+
{active == 'all' ? <b>All</b> : 'All'}
|
|
317
|
+
</button>
|
|
318
|
+
</li>
|
|
319
|
+
{alpha.map((letter, index) => (
|
|
320
|
+
<li key={index}>
|
|
321
|
+
<button
|
|
322
|
+
className={cn(
|
|
323
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
324
|
+
'leading-4 font-medium text-base ',
|
|
325
|
+
setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
|
|
326
|
+
)}
|
|
327
|
+
onClick={() => {
|
|
328
|
+
handleActive(letter)
|
|
329
|
+
}}
|
|
330
|
+
disabled={setsLengthArr[letter] > 0 ? false : true}
|
|
331
|
+
>
|
|
332
|
+
{active == letter ? <b>{letter}</b> : letter}
|
|
333
|
+
</button>
|
|
334
|
+
</li>
|
|
335
|
+
))}
|
|
336
|
+
</ul>}
|
|
337
|
+
</section>
|
|
338
|
+
<Divider className="mb-5 px-4 mt-5" />
|
|
339
|
+
<section className='singles-container'>
|
|
340
|
+
<div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
|
|
341
|
+
{newSetsData && newSetsData.length ? setRelases : (searchQuery ? <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found for <b>{searchQuery}</b> search query.</div> : <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found.</div>)}
|
|
342
|
+
</div>
|
|
343
|
+
</section>
|
|
344
|
+
</div>
|
|
345
|
+
</Fragment>
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export default SetsData;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.nav {
|
|
2
|
+
composes: flex from global;
|
|
3
|
+
composes: flex-wrap from global;
|
|
4
|
+
margin: 50px 0 30px 0;
|
|
5
|
+
composes: gap-[10px] from global;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.nav_item {
|
|
9
|
+
composes: px-4 from global;
|
|
10
|
+
composes: py-2 from global;
|
|
11
|
+
composes: transition-colors from global;
|
|
12
|
+
composes: duration-150 from global;
|
|
13
|
+
composes: border from global;
|
|
14
|
+
composes: border-solid from global;
|
|
15
|
+
composes: leading-normal from global;
|
|
16
|
+
composes: text-base from global;
|
|
17
|
+
composes: text-colorDefault from global;
|
|
18
|
+
composes: bg-white from global;
|
|
19
|
+
composes: border-gray-100 from global;
|
|
20
|
+
border-radius: 5px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.toolbar {
|
|
24
|
+
composes: relative from global;
|
|
25
|
+
composes: ml-2xs from global;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
margin-top: 20px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tabs {
|
|
32
|
+
composes: flex from global;
|
|
33
|
+
composes: flex-wrap from global;
|
|
34
|
+
composes: mt-3 from global;
|
|
35
|
+
composes: gap-[15px] from global;
|
|
36
|
+
margin-bottom: 30px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tabs_item {
|
|
40
|
+
composes: px-4 from global;
|
|
41
|
+
composes: py-2 from global;
|
|
42
|
+
composes: transition-colors from global;
|
|
43
|
+
composes: duration-150 from global;
|
|
44
|
+
composes: border from global;
|
|
45
|
+
composes: border-solid from global;
|
|
46
|
+
composes: leading-normal from global;
|
|
47
|
+
composes: text-base from global;
|
|
48
|
+
composes: text-colorDefault from global;
|
|
49
|
+
composes: bg-white from global;
|
|
50
|
+
composes: border-gray-100 from global;
|
|
51
|
+
border-radius: 5px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.singlesWrapper {
|
|
55
|
+
column-count: 1;
|
|
56
|
+
display: flex;
|
|
57
|
+
width: 100%;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.singlesGroupWrapper {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media screen and (min-width: 768px) {
|
|
67
|
+
.singlesGroupWrapper {
|
|
68
|
+
width: 50%;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media screen and (min-width: 1023px) {
|
|
73
|
+
.singlesGroupWrapper {
|
|
74
|
+
width: 33.33%;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 './setsData.module.css';
|
|
7
|
+
import cn from 'classnames';
|
|
8
|
+
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
9
|
+
|
|
10
|
+
const SetsData = props => {
|
|
11
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'><Shimmer width="25%" height="6vh" /></h1>
|
|
16
|
+
<div className='border border-gray-100 px-6'>
|
|
17
|
+
<center>
|
|
18
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
19
|
+
<Shimmer width="95%" height="6vh" />
|
|
20
|
+
</section>
|
|
21
|
+
</center>
|
|
22
|
+
<Divider className="mb-5 px-4" />
|
|
23
|
+
<section className='singles-container'>
|
|
24
|
+
<div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
|
|
25
|
+
<div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
26
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
|
|
27
|
+
</div>
|
|
28
|
+
<div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
29
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
|
|
30
|
+
</div>
|
|
31
|
+
<div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
32
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
|
|
33
|
+
</div>
|
|
34
|
+
<div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
35
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
|
|
36
|
+
</div>
|
|
37
|
+
<div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
38
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
|
|
39
|
+
</div>
|
|
40
|
+
<div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
|
|
41
|
+
<div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</section>
|
|
45
|
+
</div>
|
|
46
|
+
</>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default SetsData;
|
|
@@ -110,7 +110,7 @@ const ShopBy = props => {
|
|
|
110
110
|
|
|
111
111
|
const talonProps = useShopBy({ activeFilter, searchQuery, active, setActive, currentSort, categoryId, shopby });
|
|
112
112
|
|
|
113
|
-
const { error, loading, dataResult, categoryUrlSuffix, categoryUrlKey, productType, filteredAvailableGroups, availableGroups, attributeData, alpha, category, activeFilters } = talonProps;
|
|
113
|
+
const { error, loading, dataResult, categoryUrlSuffix, categoryUrlKey, productType, filteredAvailableGroups, availableGroups, attributeData, alpha, category, activeFilters, pageInfo } = talonProps;
|
|
114
114
|
|
|
115
115
|
if (loading && !dataResult)
|
|
116
116
|
return <ShopByShimmer />;
|
|
@@ -233,7 +233,8 @@ const ShopBy = props => {
|
|
|
233
233
|
}
|
|
234
234
|
];
|
|
235
235
|
|
|
236
|
-
const title = attributeData ? (attributeData.attribute_code == "sc_baseball_parallel" ? "Parallel Sets" : (attributeData.attribute_code == "sc_baseball_inserts" ? "Insert Sets" : attributeData.label)) : "Shop By"
|
|
236
|
+
// const title = attributeData ? (attributeData.attribute_code == "sc_baseball_parallel" ? "Parallel Sets" : (attributeData.attribute_code == "sc_baseball_inserts" ? "Insert Sets" : attributeData.label)) : "Shop By"
|
|
237
|
+
const title = pageInfo ? pageInfo.title : '';
|
|
237
238
|
|
|
238
239
|
let availableFilterOption = [];
|
|
239
240
|
|
|
@@ -335,6 +335,19 @@ export const GET_PRODUCTS_BY_URL_KEY = gql`
|
|
|
335
335
|
amount_off
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
+
minimum_price {
|
|
339
|
+
final_price {
|
|
340
|
+
currency
|
|
341
|
+
value
|
|
342
|
+
}
|
|
343
|
+
regular_price {
|
|
344
|
+
currency
|
|
345
|
+
value
|
|
346
|
+
}
|
|
347
|
+
discount {
|
|
348
|
+
amount_off
|
|
349
|
+
}
|
|
350
|
+
}
|
|
338
351
|
}
|
|
339
352
|
sku
|
|
340
353
|
small_image {
|