@riosst100/pwa-marketplace 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/components/AlphaFilter/alphaFilter.js +14 -3
- package/src/components/AlphaFilter/alphaFilter.shimmer.js +50 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +1 -1
- package/src/components/CrossSeller/crossSellerBuy.js +19 -0
- package/src/components/CrossSeller/index.js +15 -0
- package/src/components/CrossSeller/item.js +79 -0
- package/src/components/CrossSeller/logo_seller.png +0 -0
- package/src/components/CrossSeller/starIcon.js +14 -0
- package/src/components/CrossSeller/verifyIcon.js +12 -0
- package/src/components/CustomSortBy/productSort.module.css +65 -0
- package/src/components/CustomSortBy/productSort.shimmer.js +28 -0
- package/src/components/CustomSortBy/productSort.shimmer.module.css +10 -0
- package/src/components/CustomSubCategory/subCategory.js +48 -0
- package/src/components/CustomSubCategory/subCategory.module.css +22 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilter.js +47 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilter.module.css +22 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilters.js +50 -0
- package/src/components/FilterTop/CurrentTopFilters/currentTopFilters.module.css +21 -0
- package/src/components/FilterTop/CurrentTopFilters/index.js +1 -0
- package/src/components/FilterTop/CustomFilters/customFilters.js +68 -30
- package/src/components/FilterTop/FilterBlockList/filterBlockList.js +50 -0
- package/src/components/FilterTop/FilterBlockList/filterBlockList.module.css +8 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItem.js +40 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItem.module.css +14 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.js +91 -0
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.module.css +23 -0
- package/src/components/FilterTop/FilterBlockList/index.js +1 -0
- package/src/components/FilterTop/filterTop.js +131 -13
- package/src/components/FilterTop/filterTop.module.css +23 -58
- package/src/components/FilterTop/filterTop.shimmer.js +24 -24
- package/src/components/FilterTop/filterTopBlock.js +54 -0
- package/src/components/FilterTop/index.js +2 -2
- package/src/components/FilterTopBackup/CustomFilters/customFilter.js +83 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilter.module.css +22 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +132 -0
- package/src/components/FilterTopBackup/CustomFilters/customFilters.module.css +23 -0
- package/src/components/FilterTopBackup/CustomFilters/index.js +1 -0
- package/src/components/FilterTopBackup/filterTop.js +14 -0
- package/src/components/FilterTopBackup/filterTop.module.css +23 -0
- package/src/components/FilterTopBackup/filterTop.shimmer.js +24 -0
- package/src/components/FilterTopBackup/index.js +2 -0
- package/src/components/RelatedProduct/index.js +16 -0
- package/src/components/RelatedProduct/relatedProduct.js +112 -0
- package/src/components/RelatedProduct/sample.json +154 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +0 -13
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +1 -1
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +3 -2
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +3 -1
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.js +2 -2
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +13 -1
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.js +2 -2
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +1 -1
- package/src/talons/CustomFilters/useCustomFilters.js +163 -5
- package/src/talons/FilterTop/customFilters.gql.js +45 -0
- package/src/talons/FilterTop/filterTop.gql.js +45 -0
- package/src/talons/FilterTop/index.js +1 -0
- package/src/talons/FilterTop/useFilterTop.js +330 -0
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.6.
|
|
4
|
+
"version": "1.6.2",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"pwa-studio": {
|
|
7
7
|
"targets": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.6.5",
|
|
13
13
|
"iconsax-react": "^0.0.8",
|
|
14
|
-
"react-phone-number-input": "^3.3.9"
|
|
14
|
+
"react-phone-number-input": "^3.3.9",
|
|
15
|
+
"react-slick": "^0.30.2"
|
|
15
16
|
},
|
|
16
17
|
"license": "MIT",
|
|
17
18
|
"private": false
|
|
@@ -15,7 +15,7 @@ import ProductSort from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/
|
|
|
15
15
|
import CustomSortBy from '@riosst100/pwa-marketplace/src/components/CustomSortBy';
|
|
16
16
|
|
|
17
17
|
const AlphaFilter = props => {
|
|
18
|
-
const {items, handleActiveLetter} = props;
|
|
18
|
+
const {items, handleActiveLetter, activeLetter} = props;
|
|
19
19
|
|
|
20
20
|
const groupSinglesFirstLetter = (data) => {
|
|
21
21
|
return data.reduce((acc, item) => {
|
|
@@ -39,6 +39,12 @@ const AlphaFilter = props => {
|
|
|
39
39
|
<ul className='flex gap-2 justify-center flex-wrap'>
|
|
40
40
|
{alpha.map((letter, index) => (
|
|
41
41
|
<li key={index}>
|
|
42
|
+
{activeLetter == letter ? <button
|
|
43
|
+
className={cn(
|
|
44
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
45
|
+
'leading-4 font-medium text-base ',
|
|
46
|
+
availableLetter.includes(letter) ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
|
|
47
|
+
)}><b>{letter}</b></button> :
|
|
42
48
|
<button
|
|
43
49
|
className={cn(
|
|
44
50
|
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
@@ -51,10 +57,15 @@ const AlphaFilter = props => {
|
|
|
51
57
|
disabled={availableLetter.includes(letter) > 0 ? false : true}
|
|
52
58
|
>
|
|
53
59
|
{letter}
|
|
54
|
-
</button>
|
|
60
|
+
</button>}
|
|
55
61
|
</li>
|
|
56
62
|
))}
|
|
57
63
|
<li>
|
|
64
|
+
{activeLetter == 'all' ? <button
|
|
65
|
+
className={cn(
|
|
66
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
67
|
+
'leading-4 font-medium text-base hover_bg-gray-50',
|
|
68
|
+
)}><b>All</b></button> :
|
|
58
69
|
<button
|
|
59
70
|
className={cn(
|
|
60
71
|
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
@@ -65,7 +76,7 @@ const AlphaFilter = props => {
|
|
|
65
76
|
}}
|
|
66
77
|
>
|
|
67
78
|
All
|
|
68
|
-
</button>
|
|
79
|
+
</button>}
|
|
69
80
|
</li>
|
|
70
81
|
</ul>
|
|
71
82
|
</section>
|
|
@@ -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 './collectibleGameSets.module.css';
|
|
7
|
+
import cn from 'classnames';
|
|
8
|
+
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
9
|
+
|
|
10
|
+
const CollectibleGameSets = 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 py-10'>
|
|
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-semibold 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-semibold 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-semibold 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-semibold 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-semibold 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-semibold 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 CollectibleGameSets;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Item from './item';
|
|
3
|
+
|
|
4
|
+
const crossSellerBuy = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<h3 className='capitalize font-semibold text-xl mb-[30px]'>
|
|
8
|
+
Also Available
|
|
9
|
+
</h3>
|
|
10
|
+
<div className='flex flex-col gap-y-5'>
|
|
11
|
+
{[...Array(6)].map(() => (
|
|
12
|
+
<Item />
|
|
13
|
+
))}
|
|
14
|
+
</div>
|
|
15
|
+
</>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default crossSellerBuy
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form } from 'informed';
|
|
3
|
+
import Button from '@magento/venia-ui/lib/components/Button';
|
|
4
|
+
import Image from '@magento/venia-ui/lib/components/Image';
|
|
5
|
+
import QuantityStepper from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/QuantityStepper';
|
|
6
|
+
import Verify from './verifyIcon';
|
|
7
|
+
import Star from './starIcon';
|
|
8
|
+
import logoImage from './logo_seller.png';
|
|
9
|
+
|
|
10
|
+
const item = () => {
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<div className='flex flex-col gap-y-4 lg_flex-row justify-between bg-white rounded-lg border border-gray-100 p-[15px]'>
|
|
14
|
+
<div className='seller_info-container flex flex-row gap-x-[15px]'>
|
|
15
|
+
<div className='logo_wrapper w-[100px] h-[100px]'>
|
|
16
|
+
<Image
|
|
17
|
+
alt='seller name'
|
|
18
|
+
className="relative mt-[-5px]"
|
|
19
|
+
src={logoImage}
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
<div className='flex flex-col gap-y-[15px]'>
|
|
23
|
+
<div className='seller_summary-wrapper flex flex-row gap-x-2.5 items-center'>
|
|
24
|
+
<div className='seller_name text-lg font-semibold leading-6'>
|
|
25
|
+
Zen Market
|
|
26
|
+
</div>
|
|
27
|
+
<div className='seller_badge flex flex-row gap-x-[5px] items-center leading-6'>
|
|
28
|
+
<Verify />
|
|
29
|
+
<span className='text-xs font-medium text-gray-600-transparent capitalize'>
|
|
30
|
+
Verified
|
|
31
|
+
</span>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div className='rating_sales flex flex-row gap-x-[5px] items-center'>
|
|
35
|
+
<Star />
|
|
36
|
+
<span className='font-normal text-[14px] text-gray-200'>
|
|
37
|
+
4.7 (Sales 120)
|
|
38
|
+
</span>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div className='price_container'>
|
|
44
|
+
<div className='price text-lg font-semibold'>
|
|
45
|
+
$34.19
|
|
46
|
+
</div>
|
|
47
|
+
<span className='shipping_note text-xs text-gray-200'>
|
|
48
|
+
Shipping method is calculated on checkout
|
|
49
|
+
</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div className='form_wrapper'>
|
|
53
|
+
<Form
|
|
54
|
+
data-cy="FormAddToCartCrossSeller"
|
|
55
|
+
onSubmit={() => { }}
|
|
56
|
+
className="flex flex-row gap-x-7"
|
|
57
|
+
>
|
|
58
|
+
<QuantityStepper
|
|
59
|
+
min={1}
|
|
60
|
+
// message={'error quantity'}
|
|
61
|
+
/>
|
|
62
|
+
<Button
|
|
63
|
+
data-cy="addToCartButton"
|
|
64
|
+
classes={{
|
|
65
|
+
content: 'normal-case font-semibold text-[16px]'
|
|
66
|
+
}}
|
|
67
|
+
priority="high"
|
|
68
|
+
type="button"
|
|
69
|
+
>
|
|
70
|
+
Add To Cart
|
|
71
|
+
</Button>
|
|
72
|
+
</Form>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default item
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const starIcon = () => {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
+
<path d="M8.00985 2.04754L9.03651 4.10087C9.17651 4.38671 9.54985 4.66087 9.86485 4.71337L11.7257 5.02254C12.9157 5.22087 13.1957 6.08421 12.3382 6.93587L10.8915 8.38254C10.6465 8.62754 10.5123 9.10004 10.5882 9.43837L11.0023 11.2292C11.329 12.6467 10.5765 13.195 9.32235 12.4542L7.57818 11.4217C7.26318 11.235 6.74401 11.235 6.42318 11.4217L4.67901 12.4542C3.43068 13.195 2.67235 12.6409 2.99901 11.2292L3.41318 9.43837C3.48901 9.10004 3.35485 8.62754 3.10985 8.38254L1.66318 6.93587C0.811513 6.08421 1.08568 5.22087 2.27568 5.02254L4.13651 4.71337C4.44568 4.66087 4.81901 4.38671 4.95901 4.10087L5.98568 2.04754C6.54568 0.933372 7.45568 0.933372 8.00985 2.04754Z" fill="#F7C317" stroke="#F7C317" stroke-linecap="round" stroke-linejoin="round" />
|
|
8
|
+
</svg>
|
|
9
|
+
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default starIcon
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const verifyIcon = () => (
|
|
4
|
+
<>
|
|
5
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M8.9584 2.04185C9.5334 1.55018 10.4751 1.55018 11.0584 2.04185L12.3751 3.17518C12.6251 3.39185 13.0917 3.56685 13.4251 3.56685H14.8417C15.7251 3.56685 16.4501 4.29185 16.4501 5.17518V6.59185C16.4501 6.91685 16.6251 7.39185 16.8417 7.64185L17.9751 8.95851C18.4667 9.53351 18.4667 10.4752 17.9751 11.0585L16.8417 12.3752C16.6251 12.6252 16.4501 13.0918 16.4501 13.4252V14.8418C16.4501 15.7252 15.7251 16.4502 14.8417 16.4502H13.4251C13.1001 16.4502 12.6251 16.6252 12.3751 16.8418L11.0584 17.9752C10.4834 18.4668 9.54173 18.4668 8.9584 17.9752L7.64173 16.8418C7.39173 16.6252 6.92506 16.4502 6.59173 16.4502H5.15006C4.26673 16.4502 3.54173 15.7252 3.54173 14.8418V13.4168C3.54173 13.0918 3.36673 12.6252 3.1584 12.3752L2.0334 11.0502C1.55007 10.4752 1.55007 9.54185 2.0334 8.96685L3.1584 7.64185C3.36673 7.39185 3.54173 6.92518 3.54173 6.60018V5.16685C3.54173 4.28351 4.26673 3.55851 5.15006 3.55851H6.59173C6.91673 3.55851 7.39173 3.38351 7.64173 3.16685L8.9584 2.04185Z" fill="#4E31DB" stroke="#4E31DB" stroke-linecap="round" stroke-linejoin="round" />
|
|
7
|
+
<path d="M6.9834 10.0001L8.99173 12.0167L13.0167 7.9834" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
8
|
+
</svg>
|
|
9
|
+
</>
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
export default verifyIcon
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: relative from global;
|
|
3
|
+
composes: ml-2xs from global;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.menu {
|
|
7
|
+
composes: absolute from global;
|
|
8
|
+
composes: bg-clip-padding from global;
|
|
9
|
+
composes: bg-white from global;
|
|
10
|
+
composes: border from global;
|
|
11
|
+
composes: border-solid from global;
|
|
12
|
+
composes: border-gray-100 from global;
|
|
13
|
+
composes: list-none from global;
|
|
14
|
+
composes: mb-0 from global;
|
|
15
|
+
composes: min-w-[10rem] from global;
|
|
16
|
+
composes: mt-0.5 from global;
|
|
17
|
+
composes: mx-0 from global;
|
|
18
|
+
composes: right-0 from global;
|
|
19
|
+
composes: rounded from global;
|
|
20
|
+
composes: shadow-menu from global;
|
|
21
|
+
composes: text-colorDefault from global;
|
|
22
|
+
composes: text-left from global;
|
|
23
|
+
composes: top-[110%] from global;
|
|
24
|
+
composes: z-menu from global;
|
|
25
|
+
composes: p-2.5 from global;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.menuItem {
|
|
29
|
+
composes: hover_bg-gray-100 from global;
|
|
30
|
+
composes: rounded-[5px] from global;
|
|
31
|
+
composes: relative from global;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.sortButton {
|
|
35
|
+
composes: rounded-[5px] from global;
|
|
36
|
+
composes: p-2.5 from global;
|
|
37
|
+
|
|
38
|
+
composes: min-w-[154px] from global;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.desktopText {
|
|
42
|
+
composes: hidden from global;
|
|
43
|
+
|
|
44
|
+
composes: lg_inline-flex from global;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sortText {
|
|
48
|
+
composes: leading-normal from global;
|
|
49
|
+
composes: text-colorDefault from global;
|
|
50
|
+
composes: text-base from global;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.desktopIconWrapper {
|
|
54
|
+
transform: translateX(10px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.desktopIcon {
|
|
58
|
+
/* composes: icon from '../Icon/icon.module.css'; */
|
|
59
|
+
|
|
60
|
+
composes: stroke-gray-500 from global;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.mobileText {
|
|
64
|
+
composes: lg_hidden from global;
|
|
65
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 './productSort.shimmer.module.css';
|
|
7
|
+
|
|
8
|
+
const ProductSortShimmer = props => {
|
|
9
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className={classes.root} aria-live="polite" aria-busy="true">
|
|
13
|
+
<Shimmer
|
|
14
|
+
classes={{ root_button: classes.sortButtonShimmer }}
|
|
15
|
+
type="button"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
ProductSortShimmer.propTypes = {
|
|
22
|
+
classes: shape({
|
|
23
|
+
root: string,
|
|
24
|
+
sortButtonShimmer: string
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default ProductSortShimmer;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useSubCategory } from '@riosst100/pwa-marketplace/src/talons/SubCategory/useSubCategory';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
5
|
+
import defaultClasses from './subCategory.module.css';
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import { useFilterSidebar } from '@magento/peregrine/lib/talons/FilterSidebar';
|
|
8
|
+
import CollectibleGameSets from '@riosst100/pwa-marketplace/src/components/CollectibleGameSets/collectibleGameSets';
|
|
9
|
+
|
|
10
|
+
const SubCategory = props => {
|
|
11
|
+
const { children } = props;
|
|
12
|
+
|
|
13
|
+
const talonProps = useSubCategory({ children });
|
|
14
|
+
|
|
15
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
normalizedData
|
|
19
|
+
} = talonProps;
|
|
20
|
+
|
|
21
|
+
const subCategory = [];
|
|
22
|
+
|
|
23
|
+
normalizedData && normalizedData.map(({ text, path }, index) => {
|
|
24
|
+
subCategory.push(
|
|
25
|
+
<Link
|
|
26
|
+
key={index}
|
|
27
|
+
to={resourceUrl(path)}
|
|
28
|
+
>
|
|
29
|
+
<li className={classes.item}>{text}</li>
|
|
30
|
+
</Link>
|
|
31
|
+
)
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return subCategory.length ? <ul className={classes.root}>{subCategory}</ul> : '';
|
|
35
|
+
|
|
36
|
+
// const [activeTab, setActiveTab] = useState('singles')
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<ul className={classes.root}>
|
|
41
|
+
<li className={classes.item}>All Sets</li>
|
|
42
|
+
<li className={classes.item}>Expansion Sets</li>
|
|
43
|
+
</ul>
|
|
44
|
+
</>
|
|
45
|
+
)
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default SubCategory;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: flex from global;
|
|
3
|
+
composes: flex-wrap from global;
|
|
4
|
+
composes: mt-3 from global;
|
|
5
|
+
composes: gap-[15px] from global;
|
|
6
|
+
margin-bottom: 10px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.item {
|
|
10
|
+
composes: px-4 from global;
|
|
11
|
+
composes: py-2 from global;
|
|
12
|
+
composes: transition-colors from global;
|
|
13
|
+
composes: duration-150 from global;
|
|
14
|
+
composes: border from global;
|
|
15
|
+
composes: border-solid from global;
|
|
16
|
+
composes: leading-normal from global;
|
|
17
|
+
composes: text-base from global;
|
|
18
|
+
composes: text-colorDefault from global;
|
|
19
|
+
composes: bg-white from global;
|
|
20
|
+
composes: border-gray-100 from global;
|
|
21
|
+
border-radius: 5px;
|
|
22
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { shape, string, func } from 'prop-types';
|
|
4
|
+
import { X as Remove } from 'react-feather';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
8
|
+
import Trigger from '@magento/venia-ui/lib/components/Trigger';
|
|
9
|
+
import defaultClasses from '../FilterBlockList/filterTopItem.module.css';
|
|
10
|
+
|
|
11
|
+
const CurrentTopFilter = props => {
|
|
12
|
+
const { group, item, removeItem, onRemove } = props;
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
14
|
+
|
|
15
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
16
|
+
|
|
17
|
+
const handleClick = useCallback(() => {
|
|
18
|
+
removeItem({ group, item });
|
|
19
|
+
if (typeof onRemove === 'function') {
|
|
20
|
+
onRemove(group, item);
|
|
21
|
+
}
|
|
22
|
+
}, [group, item, removeItem, onRemove]);
|
|
23
|
+
|
|
24
|
+
const ariaLabel = formatMessage(
|
|
25
|
+
{
|
|
26
|
+
id: 'filterModal.action.clearFilterItem.ariaLabel',
|
|
27
|
+
defaultMessage: 'Clear filter "{name}"'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: item.label ? item.label : item.title
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<span className={classes.item} data-cy="CurrentTopFilter-root">
|
|
36
|
+
<Trigger
|
|
37
|
+
action={handleClick}
|
|
38
|
+
aria-label={ariaLabel}
|
|
39
|
+
data-cy="CurrentTopFilter-trigger"
|
|
40
|
+
>
|
|
41
|
+
All
|
|
42
|
+
</Trigger>
|
|
43
|
+
</span>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default CurrentTopFilter;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
min-height: 24px;
|
|
3
|
+
composes: border from global;
|
|
4
|
+
composes: border-gray-100 from global;
|
|
5
|
+
composes: font-semibold from global;
|
|
6
|
+
composes: gap-2xs from global;
|
|
7
|
+
composes: grid-flow-col from global;
|
|
8
|
+
composes: inline-grid from global;
|
|
9
|
+
composes: items-center from global;
|
|
10
|
+
composes: justify-center from global;
|
|
11
|
+
composes: px-2 from global;
|
|
12
|
+
composes: py-1 from global;
|
|
13
|
+
composes: rounded-md from global;
|
|
14
|
+
/* composes: text-white from global; */
|
|
15
|
+
composes: text-base from global;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* TODO @TW: cannot compose */
|
|
19
|
+
.root svg {
|
|
20
|
+
/* composes: stroke-white from global; */
|
|
21
|
+
stroke: rgb(var(--venia-global-color-gray-600));
|
|
22
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { func, shape, string } from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import CurrentTopFilter from './currentTopFilter';
|
|
7
|
+
import defaultClasses from '../FilterBlockList/filterTopItem.module.css';
|
|
8
|
+
|
|
9
|
+
const CurrentTopFilters = props => {
|
|
10
|
+
const { filterApi, filterState, onRemove, currentGroup } = props;
|
|
11
|
+
const { removeItem } = filterApi;
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
|
|
14
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
15
|
+
|
|
16
|
+
// create elements and params at the same time for efficiency
|
|
17
|
+
const filterElements = useMemo(() => {
|
|
18
|
+
const elements = [];
|
|
19
|
+
for (const [group, items] of filterState) {
|
|
20
|
+
for (const item of items) {
|
|
21
|
+
const { title, value } = item || {};
|
|
22
|
+
const key = `${group}::${title}_${value}`;
|
|
23
|
+
|
|
24
|
+
const customAttributeLandingPage = ['card_set', 'sc_baseball_release'];
|
|
25
|
+
|
|
26
|
+
if (group === currentGroup && !customAttributeLandingPage.includes(group)) {
|
|
27
|
+
elements.push(
|
|
28
|
+
<CurrentTopFilter
|
|
29
|
+
group={group}
|
|
30
|
+
item={item}
|
|
31
|
+
removeItem={removeItem}
|
|
32
|
+
onRemove={onRemove}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return elements;
|
|
40
|
+
}, [filterState, removeItem, onRemove]);
|
|
41
|
+
|
|
42
|
+
const currentFiltersAriaLabel = formatMessage({
|
|
43
|
+
id: 'filterModal.currentFilters.ariaLabel',
|
|
44
|
+
defaultMessage: 'Current Filters'
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return filterElements && filterElements.length ? filterElements : <span className={classes.item}><b>All</b></span>
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default CurrentTopFilters;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: px-[10px] from global;
|
|
3
|
+
composes: py-2 from global;
|
|
4
|
+
composes: overflow-auto from global;
|
|
5
|
+
composes: flex from global;
|
|
6
|
+
composes: flex-wrap from global;
|
|
7
|
+
composes: gap-2 from global;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* TODO @TW: cannot compose */
|
|
11
|
+
.root:empty {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.item {
|
|
16
|
+
composes: float-left from global;
|
|
17
|
+
composes: pb-0 from global;
|
|
18
|
+
composes: pl-0 from global;
|
|
19
|
+
composes: pr-2 from global;
|
|
20
|
+
composes: pt-2 from global;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './currentFilter';
|