@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
package/package.json
CHANGED
|
@@ -65,4 +65,10 @@ module.exports = componentOverrideMapping = {
|
|
|
65
65
|
[`@magento/venia-ui/lib/components/OrderHistoryPage/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/OrderHistoryPage/index.js',
|
|
66
66
|
[`@magento/venia-ui/lib/components/TextArea/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/TextArea/index.js',
|
|
67
67
|
[`@magento/venia-ui/lib/components/WishlistPage/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/WishlistPage/index.js',
|
|
68
|
+
[`@magento/venia-ui/lib/components/ProductOptions/options.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/ProductOptions/options.js',
|
|
69
|
+
[`@magento/venia-ui/lib/components/Price/price.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Price/price.js',
|
|
70
|
+
[`@magento/peregrine/lib/talons/MagentoRoute/useMagentoRoute.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/MagentoRoute/useMagentoRoute.js',
|
|
71
|
+
[`@magento/peregrine/lib/talons/ProductOptions/useOption.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductOptions/useOption.js',
|
|
72
|
+
[`@magento/peregrine/lib/talons/ProductOptions/useTile.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductOptions/useTile.js',
|
|
73
|
+
[`@magento/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js'
|
|
68
74
|
};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import { element, func, shape, string } from 'prop-types';
|
|
3
|
-
import { Heart } from 'react-feather';
|
|
4
|
-
import { useAddToFavoriteListButton } from '@riosst100/pwa-marketplace/src/talons/FavoriteSeller/AddToListButton/useAddToFavoriteListButton';
|
|
5
|
-
import { useButton } from 'react-aria';
|
|
6
|
-
|
|
7
|
-
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
|
-
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
9
|
-
import defaultClasses from './addToListButton.module.css';
|
|
10
|
-
import { useCommonToasts } from '@magento/venia-ui/lib/components/Wishlist/AddToListButton/useCommonToasts';
|
|
11
|
-
|
|
12
|
-
const HeartIcon = <Heart color='#f76b1c' size={14} variant="Outline" className='stroke-[#f76b1c]' />;
|
|
13
|
-
|
|
14
|
-
const AddToFavoriteListButton = props => {
|
|
15
|
-
const talonProps = useAddToFavoriteListButton(props);
|
|
16
|
-
const buttonRef = useRef();
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
buttonProps,
|
|
20
|
-
buttonText,
|
|
21
|
-
errorToastProps,
|
|
22
|
-
isSelected,
|
|
23
|
-
loginToastProps,
|
|
24
|
-
successToastProps
|
|
25
|
-
} = talonProps;
|
|
26
|
-
|
|
27
|
-
useCommonToasts({ errorToastProps, loginToastProps, successToastProps });
|
|
28
|
-
const { buttonProps: ariaButtonProps } = useButton(buttonProps, buttonRef);
|
|
29
|
-
|
|
30
|
-
const classes = useStyle(defaultClasses, props.classes);
|
|
31
|
-
const buttonClass = isSelected ? classes.root_selected : classes.root;
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<button ref={buttonRef} className={buttonClass} {...ariaButtonProps}>
|
|
35
|
-
{props.icon}
|
|
36
|
-
</button>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export default AddToFavoriteListButton;
|
|
41
|
-
|
|
42
|
-
AddToFavoriteListButton.defaultProps = {
|
|
43
|
-
icon: HeartIcon
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
AddToFavoriteListButton.propTypes = {
|
|
47
|
-
afterAdd: func,
|
|
48
|
-
beforeAdd: func,
|
|
49
|
-
classes: shape({
|
|
50
|
-
root: string,
|
|
51
|
-
root_selected: string
|
|
52
|
-
}),
|
|
53
|
-
icon: element
|
|
54
|
-
};
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { element, func, shape, string } from 'prop-types';
|
|
3
|
+
import { Heart } from 'react-feather';
|
|
4
|
+
import { useAddToFavoriteListButton } from '@riosst100/pwa-marketplace/src/talons/FavoriteSeller/AddToListButton/useAddToFavoriteListButton';
|
|
5
|
+
import { useButton } from 'react-aria';
|
|
6
|
+
|
|
7
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
9
|
+
import defaultClasses from './addToListButton.module.css';
|
|
10
|
+
import { useCommonToasts } from '@magento/venia-ui/lib/components/Wishlist/AddToListButton/useCommonToasts';
|
|
11
|
+
|
|
12
|
+
const HeartIcon = <Heart color='#f76b1c' size={14} variant="Outline" className='stroke-[#f76b1c]' />;
|
|
13
|
+
|
|
14
|
+
const AddToFavoriteListButton = props => {
|
|
15
|
+
const talonProps = useAddToFavoriteListButton(props);
|
|
16
|
+
const buttonRef = useRef();
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
buttonProps,
|
|
20
|
+
buttonText,
|
|
21
|
+
errorToastProps,
|
|
22
|
+
isSelected,
|
|
23
|
+
loginToastProps,
|
|
24
|
+
successToastProps
|
|
25
|
+
} = talonProps;
|
|
26
|
+
|
|
27
|
+
useCommonToasts({ errorToastProps, loginToastProps, successToastProps });
|
|
28
|
+
const { buttonProps: ariaButtonProps } = useButton(buttonProps, buttonRef);
|
|
29
|
+
|
|
30
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
31
|
+
const buttonClass = isSelected ? classes.root_selected : classes.root;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<button ref={buttonRef} className={buttonClass} {...ariaButtonProps}>
|
|
35
|
+
{props.icon}
|
|
36
|
+
</button>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default AddToFavoriteListButton;
|
|
41
|
+
|
|
42
|
+
AddToFavoriteListButton.defaultProps = {
|
|
43
|
+
icon: HeartIcon
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
AddToFavoriteListButton.propTypes = {
|
|
47
|
+
afterAdd: func,
|
|
48
|
+
beforeAdd: func,
|
|
49
|
+
classes: shape({
|
|
50
|
+
root: string,
|
|
51
|
+
root_selected: string
|
|
52
|
+
}),
|
|
53
|
+
icon: element
|
|
54
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
.root {
|
|
2
|
-
composes: gap-x-2xs from global;
|
|
3
|
-
composes: inline-flex from global;
|
|
4
|
-
composes: items-center from global;
|
|
5
|
-
min-height: 3rem;
|
|
6
|
-
composes: min-w-[3rem] from global;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.root_selected {
|
|
10
|
-
composes: root;
|
|
11
|
-
|
|
12
|
-
--selectedColor: rgb(var(--venia-global-color-red-400));
|
|
13
|
-
--fill: var(--selectedColor);
|
|
14
|
-
--stroke: var(--selectedColor);
|
|
15
|
-
|
|
16
|
-
composes: no-underline from global;
|
|
17
|
-
}
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-x-2xs from global;
|
|
3
|
+
composes: inline-flex from global;
|
|
4
|
+
composes: items-center from global;
|
|
5
|
+
min-height: 3rem;
|
|
6
|
+
composes: min-w-[3rem] from global;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.root_selected {
|
|
10
|
+
composes: root;
|
|
11
|
+
|
|
12
|
+
--selectedColor: rgb(var(--venia-global-color-red-400));
|
|
13
|
+
--fill: var(--selectedColor);
|
|
14
|
+
--stroke: var(--selectedColor);
|
|
15
|
+
|
|
16
|
+
composes: no-underline from global;
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './addToListButton';
|
|
1
|
+
export { default } from './addToListButton';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { AlertCircle, Check, Info } from 'react-feather';
|
|
3
|
-
import { useToasts } from '@magento/peregrine';
|
|
4
|
-
|
|
5
|
-
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
6
|
-
|
|
7
|
-
const CheckIcon = <Icon size={20} src={Check} />;
|
|
8
|
-
const ErrorIcon = <Icon size={20} src={AlertCircle} />;
|
|
9
|
-
const InfoIcon = <Icon size={20} src={Info} />;
|
|
10
|
-
|
|
11
|
-
export const useCommonToasts = props => {
|
|
12
|
-
const { errorToastProps, loginToastProps, successToastProps } = props;
|
|
13
|
-
|
|
14
|
-
const [, { addToast }] = useToasts();
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (loginToastProps) {
|
|
18
|
-
addToast({ ...loginToastProps, icon: InfoIcon });
|
|
19
|
-
}
|
|
20
|
-
}, [addToast, loginToastProps]);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (successToastProps) {
|
|
24
|
-
addToast({ ...successToastProps, icon: CheckIcon });
|
|
25
|
-
}
|
|
26
|
-
}, [addToast, successToastProps]);
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (errorToastProps) {
|
|
30
|
-
addToast({ ...errorToastProps, icon: ErrorIcon });
|
|
31
|
-
}
|
|
32
|
-
}, [addToast, errorToastProps]);
|
|
33
|
-
};
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { AlertCircle, Check, Info } from 'react-feather';
|
|
3
|
+
import { useToasts } from '@magento/peregrine';
|
|
4
|
+
|
|
5
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
6
|
+
|
|
7
|
+
const CheckIcon = <Icon size={20} src={Check} />;
|
|
8
|
+
const ErrorIcon = <Icon size={20} src={AlertCircle} />;
|
|
9
|
+
const InfoIcon = <Icon size={20} src={Info} />;
|
|
10
|
+
|
|
11
|
+
export const useCommonToasts = props => {
|
|
12
|
+
const { errorToastProps, loginToastProps, successToastProps } = props;
|
|
13
|
+
|
|
14
|
+
const [, { addToast }] = useToasts();
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (loginToastProps) {
|
|
18
|
+
addToast({ ...loginToastProps, icon: InfoIcon });
|
|
19
|
+
}
|
|
20
|
+
}, [addToast, loginToastProps]);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (successToastProps) {
|
|
24
|
+
addToast({ ...successToastProps, icon: CheckIcon });
|
|
25
|
+
}
|
|
26
|
+
}, [addToast, successToastProps]);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (errorToastProps) {
|
|
30
|
+
addToast({ ...errorToastProps, icon: ErrorIcon });
|
|
31
|
+
}
|
|
32
|
+
}, [addToast, errorToastProps]);
|
|
33
|
+
};
|
|
@@ -1,132 +1,130 @@
|
|
|
1
|
-
import React, { useCallback, 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 CustomFilter from './customFilter';
|
|
7
|
-
import defaultClasses from './customFilters.module.css';
|
|
8
|
-
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
9
|
-
import { Link } from 'react-router-dom';
|
|
10
|
-
import { useCustomFilters } from '@riosst100/pwa-marketplace/src/talons/CustomFilters/useCustomFilters';
|
|
11
|
-
|
|
12
|
-
const CustomFilters = props => {
|
|
13
|
-
const { onRemove, clearAll, category, filters } = props;
|
|
14
|
-
const classes = useStyle(defaultClasses, props.classes);
|
|
15
|
-
const { formatMessage } = useIntl();
|
|
16
|
-
|
|
17
|
-
const talonProps = useCustomFilters({ filters });
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
customFiltersData,
|
|
21
|
-
categoryUrlSuffix,
|
|
22
|
-
search,
|
|
23
|
-
pathname,
|
|
24
|
-
filterApi,
|
|
25
|
-
// filterItems,
|
|
26
|
-
// filterNames,
|
|
27
|
-
// filterFrontendInput,
|
|
28
|
-
filterState
|
|
29
|
-
} = talonProps;
|
|
30
|
-
|
|
31
|
-
const params = search ? JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}') : {};
|
|
32
|
-
|
|
33
|
-
const { removeItem } = filterApi;
|
|
34
|
-
|
|
35
|
-
const activeFilters = useMemo(() => {
|
|
36
|
-
const elements = [];
|
|
37
|
-
for (const [group, items] of filterState) {
|
|
38
|
-
for (const item of items) {
|
|
39
|
-
elements.push(
|
|
40
|
-
{
|
|
41
|
-
group: group,
|
|
42
|
-
item: item,
|
|
43
|
-
removeItem: removeItem
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return elements;
|
|
50
|
-
}, [filterState, removeItem]);
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// const path =
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
export default CustomFilters;
|
|
1
|
+
import React, { useCallback, 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 CustomFilter from './customFilter';
|
|
7
|
+
import defaultClasses from './customFilters.module.css';
|
|
8
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
9
|
+
import { Link } from 'react-router-dom';
|
|
10
|
+
import { useCustomFilters } from '@riosst100/pwa-marketplace/src/talons/CustomFilters/useCustomFilters';
|
|
11
|
+
|
|
12
|
+
const CustomFilters = props => {
|
|
13
|
+
const { onRemove, clearAll, category, filters } = props;
|
|
14
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
15
|
+
const { formatMessage } = useIntl();
|
|
16
|
+
|
|
17
|
+
const talonProps = useCustomFilters({ filters });
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
customFiltersData,
|
|
21
|
+
categoryUrlSuffix,
|
|
22
|
+
search,
|
|
23
|
+
pathname,
|
|
24
|
+
filterApi,
|
|
25
|
+
// filterItems,
|
|
26
|
+
// filterNames,
|
|
27
|
+
// filterFrontendInput,
|
|
28
|
+
filterState
|
|
29
|
+
} = talonProps;
|
|
30
|
+
|
|
31
|
+
const params = search ? JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}') : {};
|
|
32
|
+
|
|
33
|
+
const { removeItem } = filterApi;
|
|
34
|
+
|
|
35
|
+
const activeFilters = useMemo(() => {
|
|
36
|
+
const elements = [];
|
|
37
|
+
for (const [group, items] of filterState) {
|
|
38
|
+
for (const item of items) {
|
|
39
|
+
elements.push(
|
|
40
|
+
{
|
|
41
|
+
group: group,
|
|
42
|
+
item: item,
|
|
43
|
+
removeItem: removeItem
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return elements;
|
|
50
|
+
}, [filterState, removeItem]);
|
|
51
|
+
|
|
52
|
+
// const handleClick = useCallback(() => {
|
|
53
|
+
// removeItem({ group, item });
|
|
54
|
+
// }, [group, item, removeItem]);
|
|
55
|
+
|
|
56
|
+
// create elements and params at the same time for efficiency
|
|
57
|
+
const filterElements = useMemo(() => {
|
|
58
|
+
const elements = [];
|
|
59
|
+
customFiltersData && customFiltersData.map((filter, index) => {
|
|
60
|
+
const { label, attribute_code, options } = filter || {};
|
|
61
|
+
|
|
62
|
+
const group = attribute_code;
|
|
63
|
+
|
|
64
|
+
// const handleClick = useCallback(() => {
|
|
65
|
+
// removeItem({ group, item });
|
|
66
|
+
// if (typeof onRemove === 'function') {
|
|
67
|
+
// onRemove(group, item);
|
|
68
|
+
// }
|
|
69
|
+
// }, [group, item, removeItem, onRemove]);
|
|
70
|
+
|
|
71
|
+
if (options.length) {
|
|
72
|
+
const items = [];
|
|
73
|
+
options.map((item, index) => {
|
|
74
|
+
const { label, value } = item
|
|
75
|
+
// const path = '/';
|
|
76
|
+
|
|
77
|
+
// const path = resourceUrl(
|
|
78
|
+
// `/${category.url_path}${categoryUrlSuffix || ''}?${attribute_code}[filter]=${label},${value}`
|
|
79
|
+
// );
|
|
80
|
+
// const keyAttr = `${attribute_code}[filter]`;
|
|
81
|
+
|
|
82
|
+
if (params) {
|
|
83
|
+
Object.keys(params).forEach(function(key, index) {
|
|
84
|
+
if (index > 1) {
|
|
85
|
+
delete params[key];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (value != "all") {
|
|
91
|
+
params[`${attribute_code}[filter]`] = `${label},${value}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const finalParams = params ? Object.keys(params).map(key => `${key}=${params[key]}`).join('&') : '';
|
|
95
|
+
const path = pathname + finalParams;
|
|
96
|
+
|
|
97
|
+
if (value != "all") {
|
|
98
|
+
items.push(
|
|
99
|
+
<li key={index}>
|
|
100
|
+
<Link
|
|
101
|
+
to={path}
|
|
102
|
+
>
|
|
103
|
+
<span className={classes.item}>{label}</span>
|
|
104
|
+
</Link>
|
|
105
|
+
</li>
|
|
106
|
+
)
|
|
107
|
+
} else {
|
|
108
|
+
items.push(
|
|
109
|
+
<li key={index}>
|
|
110
|
+
<span className={classes.item} onClick={removeItem({ group, item })}>{label}</span>
|
|
111
|
+
</li>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
elements.push(
|
|
117
|
+
<ul key={index} className={classes.root}>{items}</ul>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
return elements;
|
|
123
|
+
}, [customFiltersData]);
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<>{filterElements}</>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default CustomFilters;
|
|
@@ -24,8 +24,7 @@ const SCROLL_OFFSET = 150;
|
|
|
24
24
|
const FilterTop = props => {
|
|
25
25
|
const { shopby, filters, filterCountToOpen, allowedFilters, category } = props;
|
|
26
26
|
const [filterBy, setFilterBy] = useState('');
|
|
27
|
-
|
|
28
|
-
// console.log(filterBy)
|
|
27
|
+
|
|
29
28
|
const talonProps = useFilterTop({ shopby, filters, category, filterBy, setFilterBy });
|
|
30
29
|
const {
|
|
31
30
|
filterApi,
|
|
@@ -47,8 +46,6 @@ const FilterTop = props => {
|
|
|
47
46
|
|
|
48
47
|
// const filtersSearch = getFiltersFromSearch(search);
|
|
49
48
|
|
|
50
|
-
// console.log(search)
|
|
51
|
-
|
|
52
49
|
// filters.forEach((values, key) => {
|
|
53
50
|
// newFilters[key] = getFilterInput(values, filterTypeMap.get(key));
|
|
54
51
|
// });
|
|
@@ -104,10 +101,6 @@ const FilterTop = props => {
|
|
|
104
101
|
// });
|
|
105
102
|
// const allowedFiltersArr = ['card_rarity','card_print_version','card_set', 'card_product_type'];
|
|
106
103
|
|
|
107
|
-
// console.log(customFilters)
|
|
108
|
-
|
|
109
|
-
// console.log(filterItems)
|
|
110
|
-
|
|
111
104
|
const filtersList = useMemo(
|
|
112
105
|
() =>
|
|
113
106
|
Array.from(filterItems, ([group, items], iteration) => {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
3
|
+
|
|
4
|
+
const LinkToOtherStores = (props) => {
|
|
5
|
+
|
|
6
|
+
const { productDetails } = props;
|
|
7
|
+
|
|
8
|
+
const linkToOtherStores = productDetails?.link_to_other_stores;
|
|
9
|
+
|
|
10
|
+
// Convert the JSON string to an array
|
|
11
|
+
const storesArray = JSON.parse(linkToOtherStores);
|
|
12
|
+
|
|
13
|
+
const getLogo = (stores) => {
|
|
14
|
+
let img = '';
|
|
15
|
+
if (stores == "Shopee") {
|
|
16
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/f/fe/Shopee.svg';
|
|
17
|
+
}
|
|
18
|
+
if (stores == "Tokopedia") {
|
|
19
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/a/a7/Tokopedia.svg';
|
|
20
|
+
}
|
|
21
|
+
if (stores == "Lazada") {
|
|
22
|
+
img = 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Lazada_%282019%29.svg/1200px-Lazada_%282019%29.svg.png';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return img;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let finalLinkToOtherStores = [];
|
|
29
|
+
|
|
30
|
+
if (storesArray && storesArray.length) {
|
|
31
|
+
storesArray.forEach((store) => {
|
|
32
|
+
if (store.product_link) {
|
|
33
|
+
const logo = getLogo(store.stores);
|
|
34
|
+
finalLinkToOtherStores.push(
|
|
35
|
+
<a href={store.product_link} className='platform_logo-wrapper rounded-md px-5 py-2.5 border border-gray-100 flex items-center' target="_blank">
|
|
36
|
+
{logo ? <img
|
|
37
|
+
alt={store.stores}
|
|
38
|
+
width={60}
|
|
39
|
+
height={30}
|
|
40
|
+
src={logo}
|
|
41
|
+
/> : store.stores }
|
|
42
|
+
</a>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return finalLinkToOtherStores && finalLinkToOtherStores.length ? <>
|
|
49
|
+
<section className='product_from-other-platform py-xs'>
|
|
50
|
+
<div className='text-sm flex mb-3'>
|
|
51
|
+
Also available in
|
|
52
|
+
</div>
|
|
53
|
+
<div className='platform-container flex gap-x-2.5'>
|
|
54
|
+
{finalLinkToOtherStores}
|
|
55
|
+
</div>
|
|
56
|
+
</section>
|
|
57
|
+
<Divider />
|
|
58
|
+
</> : '';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default LinkToOtherStores;
|
|
@@ -67,8 +67,6 @@ const NonSportCardsSets = props => {
|
|
|
67
67
|
|
|
68
68
|
const { error, loading, nonSportCardsSets, categoryUrlSuffix, categoryUrlKey, productType, filteredNonSportCardsSets, availableGroups, category } = talonProps;
|
|
69
69
|
|
|
70
|
-
console.log(filteredNonSportCardsSets)
|
|
71
|
-
|
|
72
70
|
if (loading && !nonSportCardsSets)
|
|
73
71
|
return <NonSportCardsSetsShimmer />;
|
|
74
72
|
if (error && !nonSportCardsSets) return <ErrorView />;
|
|
@@ -3,7 +3,9 @@ import Button from '@magento/venia-ui/lib/components/Button';
|
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import ModalRFQ from './modalRfq';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const RFQ = (props) => {
|
|
7
|
+
|
|
8
|
+
const { disabled } = props;
|
|
7
9
|
|
|
8
10
|
const [open, setOpen] = useState(false);
|
|
9
11
|
const { formatMessage } = useIntl();
|
|
@@ -17,6 +19,7 @@ const AuctionDetail = (props) => {
|
|
|
17
19
|
|
|
18
20
|
<Button
|
|
19
21
|
data-cy="ProductFullDetail-RFQ"
|
|
22
|
+
disabled={disabled}
|
|
20
23
|
classes={{
|
|
21
24
|
content: 'normal-case font-medium text-[16px]'
|
|
22
25
|
}}
|
|
@@ -28,7 +31,7 @@ const AuctionDetail = (props) => {
|
|
|
28
31
|
formatMessage({
|
|
29
32
|
id: 'productFullDetail.RequestQuote',
|
|
30
33
|
defaultMessage:
|
|
31
|
-
'
|
|
34
|
+
'Make An Offer'
|
|
32
35
|
})
|
|
33
36
|
}
|
|
34
37
|
</Button>
|
|
@@ -36,4 +39,4 @@ const AuctionDetail = (props) => {
|
|
|
36
39
|
)
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
export default
|
|
42
|
+
export default RFQ;
|