@riosst100/pwa-marketplace 2.1.4 → 2.1.6
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 +7 -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/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 +48 -11
- 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/product.gql.js +5 -2
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +23 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/useProduct.js +121 -0
- 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 +107 -105
- 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/TrainsSets/useTrainsSets.js +0 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: root from '@magento/venia-ui/lib/components/clickable.module.css';
|
|
3
|
+
|
|
4
|
+
/* composes: border from global; */
|
|
5
|
+
/* composes: border-solid from global; */
|
|
6
|
+
/* composes: border-strong from global; */
|
|
7
|
+
/* composes: h-[3rem] from global; */
|
|
8
|
+
/* composes: min-w-[3rem] from global; */
|
|
9
|
+
/* composes: px-2xs from global; */
|
|
10
|
+
/* composes: py-0 from global; */
|
|
11
|
+
/* composes: rounded-sm from global; */
|
|
12
|
+
position: relative;
|
|
13
|
+
border: 1px solid rgb(230 233 234);
|
|
14
|
+
border-radius: 2px;
|
|
15
|
+
padding: .5rem;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.variantImageSwatch {
|
|
20
|
+
width: 24px;
|
|
21
|
+
height: 24px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.root:hover {
|
|
25
|
+
border-color: rgba(247, 107, 28);
|
|
26
|
+
color: rgba(247, 107, 28);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.label {
|
|
30
|
+
padding-left: 0.4rem;
|
|
31
|
+
padding-right: 5px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.root_selected {
|
|
35
|
+
composes: root;
|
|
36
|
+
|
|
37
|
+
/* composes: bg-gray-900 from global;
|
|
38
|
+
composes: text-white from global; */
|
|
39
|
+
border-color: rgba(247, 107, 28);
|
|
40
|
+
color: rgba(247, 107, 28);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.root_focused {
|
|
44
|
+
composes: root;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.root_selected_focused {
|
|
48
|
+
composes: root_selected;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.root_outOfStock,
|
|
52
|
+
.root_selected_outOfStock {
|
|
53
|
+
composes: root;
|
|
54
|
+
composes: bg-disabledTile from global;
|
|
55
|
+
composes: opacity-50 from global;
|
|
56
|
+
composes: border-2 from global;
|
|
57
|
+
composes: border-solid from global;
|
|
58
|
+
composes: border-gray-400 from global;
|
|
59
|
+
composes: text-gray-600 from global;
|
|
60
|
+
}
|
|
61
|
+
.root_outOfStock:after,
|
|
62
|
+
.root_selected_outOfStock:after {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
border-top: 2px solid rgb(var(--venia-global-color-gray-400));
|
|
66
|
+
width: 62px;
|
|
67
|
+
transform: rotate(-45deg);
|
|
68
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { arrayOf, func, object, shape, string } from 'prop-types';
|
|
3
|
+
import Tile from './tile';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import defaultClasses from './tileList.module.css';
|
|
7
|
+
|
|
8
|
+
const TileList = props => {
|
|
9
|
+
const {
|
|
10
|
+
getItemKey,
|
|
11
|
+
selectedValue = {},
|
|
12
|
+
items,
|
|
13
|
+
onSelectionChange,
|
|
14
|
+
isEverythingOutOfStock,
|
|
15
|
+
outOfStockVariants,
|
|
16
|
+
setHoveredMedia,
|
|
17
|
+
filteredVariants
|
|
18
|
+
} = props;
|
|
19
|
+
|
|
20
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
21
|
+
|
|
22
|
+
const tiles = useMemo(
|
|
23
|
+
() =>
|
|
24
|
+
items.map(item => {
|
|
25
|
+
const value_index = item.value_index;
|
|
26
|
+
|
|
27
|
+
const itemVariant = filteredVariants.filter(variant => {
|
|
28
|
+
return variant.attributes.some(attribute => attribute.value_index === value_index);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const isSelected = item.label === selectedValue.label;
|
|
32
|
+
let isOptionOutOfStock;
|
|
33
|
+
if (outOfStockVariants && outOfStockVariants.length > 0) {
|
|
34
|
+
const flatOutOfStockArray = outOfStockVariants.flat();
|
|
35
|
+
isOptionOutOfStock = flatOutOfStockArray.includes(
|
|
36
|
+
item.value_index
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Tile
|
|
42
|
+
key={getItemKey(item)}
|
|
43
|
+
isSelected={isSelected}
|
|
44
|
+
item={item}
|
|
45
|
+
setHoveredMedia={setHoveredMedia}
|
|
46
|
+
itemVariant={itemVariant}
|
|
47
|
+
onClick={onSelectionChange}
|
|
48
|
+
isEverythingOutOfStock={isEverythingOutOfStock}
|
|
49
|
+
isOptionOutOfStock={isOptionOutOfStock}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}),
|
|
53
|
+
[
|
|
54
|
+
getItemKey,
|
|
55
|
+
selectedValue.label,
|
|
56
|
+
items,
|
|
57
|
+
onSelectionChange,
|
|
58
|
+
isEverythingOutOfStock,
|
|
59
|
+
outOfStockVariants
|
|
60
|
+
]
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return <div className={classes.root}>{tiles}</div>;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
TileList.propTypes = {
|
|
67
|
+
classes: shape({
|
|
68
|
+
root: string
|
|
69
|
+
}),
|
|
70
|
+
getItemKey: func,
|
|
71
|
+
selectedValue: object,
|
|
72
|
+
items: arrayOf(object),
|
|
73
|
+
onSelectionChange: func
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
TileList.displayName = 'TileList';
|
|
77
|
+
|
|
78
|
+
export default TileList;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import defaultClasses from './tileList.module.css';
|
|
7
|
+
|
|
8
|
+
const TileListShimmer = props => {
|
|
9
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
10
|
+
|
|
11
|
+
const tiles = useMemo(() => {
|
|
12
|
+
return Array.from({ length: 3 })
|
|
13
|
+
.fill(null)
|
|
14
|
+
.map((value, index) => {
|
|
15
|
+
return <Shimmer width={3} height={3} key={`tile-${index}`} />;
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
|
|
19
|
+
return <div className={classes.root}>{tiles}</div>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
TileListShimmer.defaultProps = {
|
|
23
|
+
classes: {}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
TileListShimmer.propTypes = {
|
|
27
|
+
classes: shape({
|
|
28
|
+
root: string
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default TileListShimmer;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
|
|
3
|
-
export const ADD_TO_FAVORITE_SELLER_LIST = gql`
|
|
4
|
-
mutation AddSellerToFavoriteList(
|
|
5
|
-
$sellerId: ID!
|
|
6
|
-
) {
|
|
7
|
-
addSellerToFavoritelist(
|
|
8
|
-
sellerId: $sellerId
|
|
9
|
-
) {
|
|
10
|
-
favorite {
|
|
11
|
-
id
|
|
12
|
-
customer_id
|
|
13
|
-
creation_time
|
|
14
|
-
status
|
|
15
|
-
}
|
|
16
|
-
error
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
export const GET_SELLER_IN_FAVORITE_LISTS = gql`
|
|
22
|
-
query GetProductsInWishlistsForGallery {
|
|
23
|
-
customerWishlistProducts @client
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
addToFavoriteSellerMutation: ADD_TO_FAVORITE_SELLER_LIST,
|
|
29
|
-
getSellerInFavoriteListsQuery: GET_SELLER_IN_FAVORITE_LISTS
|
|
30
|
-
};
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
export const ADD_TO_FAVORITE_SELLER_LIST = gql`
|
|
4
|
+
mutation AddSellerToFavoriteList(
|
|
5
|
+
$sellerId: ID!
|
|
6
|
+
) {
|
|
7
|
+
addSellerToFavoritelist(
|
|
8
|
+
sellerId: $sellerId
|
|
9
|
+
) {
|
|
10
|
+
favorite {
|
|
11
|
+
id
|
|
12
|
+
customer_id
|
|
13
|
+
creation_time
|
|
14
|
+
status
|
|
15
|
+
}
|
|
16
|
+
error
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const GET_SELLER_IN_FAVORITE_LISTS = gql`
|
|
22
|
+
query GetProductsInWishlistsForGallery {
|
|
23
|
+
customerWishlistProducts @client
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
addToFavoriteSellerMutation: ADD_TO_FAVORITE_SELLER_LIST,
|
|
29
|
+
getSellerInFavoriteListsQuery: GET_SELLER_IN_FAVORITE_LISTS
|
|
30
|
+
};
|
|
@@ -51,19 +51,14 @@ export const useLegoSets = props => {
|
|
|
51
51
|
}, [introspectionData]);
|
|
52
52
|
const filters = getFiltersFromSearch(search);
|
|
53
53
|
|
|
54
|
-
// console.log(search)
|
|
55
|
-
|
|
56
54
|
// Construct the filter arg object.
|
|
57
55
|
const newFilters = {};
|
|
58
56
|
filters.forEach((values, key) => {
|
|
59
57
|
newFilters[key] = getFilterInput(values, filterTypeMap.get(key));
|
|
60
|
-
// console.log(key)
|
|
61
|
-
// console.log(values)
|
|
62
58
|
|
|
63
59
|
if (key == "sc_baseball_release") {
|
|
64
60
|
for(let item of values) {
|
|
65
61
|
if(item) {
|
|
66
|
-
// console.log(item.split(',')[0])
|
|
67
62
|
const data = search.split('&');
|
|
68
63
|
data.pop();
|
|
69
64
|
activeFilters.push(
|
|
@@ -133,7 +133,6 @@ export const useTrainsSets = props => {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
if (activeTab == "trains_gauge") {
|
|
136
|
-
console.log(activeFilter + ' dan '+set.trains_gauge)
|
|
137
136
|
return set.trains_gauge.search(new RegExp('<'+activeFilter+'>', "i")) != -1;
|
|
138
137
|
}
|
|
139
138
|
|
|
@@ -177,8 +176,6 @@ export const useTrainsSets = props => {
|
|
|
177
176
|
})
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
console.log(filteredSets)
|
|
181
|
-
|
|
182
179
|
return searchQuery || activeFilter ? filteredSets : trainsSets;
|
|
183
180
|
}, [trainsSets, searchQuery, activeFilter]);
|
|
184
181
|
|