@riosst100/pwa-marketplace 1.3.9 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +4 -1
- package/src/components/AttributesBlock/attributesBlock.js +54 -0
- package/src/components/AttributesBlock/attributesBlock.module.css +28 -0
- package/src/components/BrandSlider/brandSlider.js +91 -0
- package/src/components/BrandSlider/index.js +1 -0
- package/src/components/BrandSlider/item.js +43 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +52 -0
- package/src/components/CollectibleGameSets/index.js +1 -0
- package/src/components/CollectibleGameSetsPage/collectibleGameSetsPage.js +10 -0
- package/src/components/CollectibleGameSetsPage/index.js +1 -0
- package/src/components/Divider/index.js +11 -0
- package/src/components/SellerDetail/sellerDetail.js +1 -1
- package/src/components/SellerReviewItem/sellerReviewItem.js +51 -51
- package/src/components/SubCategory/subCategory.js +1 -1
- package/src/intercept.js +7 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js +24 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +8 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +10 -1
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.module.css +1 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +10 -1
- package/src/overwrites/venia-ui/lib/components/Button/button.js +100 -0
- package/src/overwrites/venia-ui/lib/components/Button/button.module.css +128 -0
- package/src/overwrites/venia-ui/lib/components/Button/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterList.js +2 -2
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.module.css +2 -1
- package/src/overwrites/venia-ui/lib/components/Header/header.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.js +55 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/customSubmenuColumn.module.css +29 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +6 -3
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.js +51 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +3 -20
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +2 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +62 -11
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/productReview.js +55 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +238 -46
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.module.css +1 -5
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.js +23 -4
- package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.module.css +3 -7
- package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.js +60 -0
- package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/RichText/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/RichText/richText.js +21 -0
- package/src/overwrites/venia-ui/lib/components/RichText/richText.module.css +19 -0
- package/src/talons/AttributesBlock/attributesBlock.gql.js +15 -0
- package/src/talons/AttributesBlock/useAttributesBlock.js +37 -0
- package/src/talons/CollectibleGameSets/collectibleGameSets.gql.js +27 -0
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +65 -0
- package/src/theme/vars.js +2 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-1 from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
composes: grid-flow-col from global;
|
|
5
|
+
composes: items-center from global;
|
|
6
|
+
composes: justify-items-center from global;
|
|
7
|
+
composes: leading-normal from global;
|
|
8
|
+
composes: m-0 from global;
|
|
9
|
+
composes: text-colorDefault from global;
|
|
10
|
+
grid-template-areas: 'input label';
|
|
11
|
+
grid-template-columns: min-content 1fr;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.input {
|
|
15
|
+
composes: appearance-none from global;
|
|
16
|
+
composes: bg-clip-content from global;
|
|
17
|
+
composes: bg-transparent from global;
|
|
18
|
+
composes: border-8 from global;
|
|
19
|
+
composes: border-solid from global;
|
|
20
|
+
composes: border-transparent from global;
|
|
21
|
+
composes: h-[1.5rem] from global;
|
|
22
|
+
composes: m-0 from global;
|
|
23
|
+
composes: rounded-full from global;
|
|
24
|
+
composes: w-[1.5rem] from global;
|
|
25
|
+
composes: z-foreground from global;
|
|
26
|
+
grid-area: input;
|
|
27
|
+
|
|
28
|
+
composes: active_outline-none from global;
|
|
29
|
+
/* composes: active_shadow-radioActive from global; */
|
|
30
|
+
|
|
31
|
+
composes: checked_bg-brand-dark from global;
|
|
32
|
+
|
|
33
|
+
composes: focus_outline-none from global;
|
|
34
|
+
/* composes: focus_shadow-radioFocus from global; */
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.icon {
|
|
38
|
+
composes: h-[14px] from global;
|
|
39
|
+
composes: w-[14px] from global;
|
|
40
|
+
composes: z-surface from global;
|
|
41
|
+
grid-area: input;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* TODO @TW: cannot compose */
|
|
45
|
+
.icon svg {
|
|
46
|
+
/* composes: stroke-gray-600 from global; */
|
|
47
|
+
stroke: rgb(var(--venia-global-color-gray-600));
|
|
48
|
+
width: 14px;
|
|
49
|
+
height: 14px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.label {
|
|
53
|
+
composes: justify-self-start from global;
|
|
54
|
+
composes: text-base from global;
|
|
55
|
+
grid-area: label;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* TODO @TW: cannot compose */
|
|
59
|
+
.input:checked + .icon svg {
|
|
60
|
+
/* composes: stroke-brand-base from global; */
|
|
61
|
+
stroke: rgb(var(--venia-brand-color-1-700));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.input_shimmer {
|
|
65
|
+
composes: h-[14px] from global;
|
|
66
|
+
composes: m-0 from global;
|
|
67
|
+
composes: rounded-full from global;
|
|
68
|
+
composes: w-[14px] from global;
|
|
69
|
+
composes: z-foreground from global;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './richText';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
4
|
+
import defaultClasses from './richText.module.css';
|
|
5
|
+
import cn from 'classnames';
|
|
6
|
+
|
|
7
|
+
const toHTML = str => ({ __html: str });
|
|
8
|
+
|
|
9
|
+
const RichText = (props) => {
|
|
10
|
+
const { content, rootClassName } = props;
|
|
11
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={cn(classes.root, rootClassName)}
|
|
16
|
+
dangerouslySetInnerHTML={toHTML(content)}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default RichText;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: leading-tight from global;
|
|
3
|
+
composes: px-2xs from global;
|
|
4
|
+
composes: py-0 from global;
|
|
5
|
+
composes: text-sm from global;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* TODO @TW: cannot compose */
|
|
9
|
+
.root p {
|
|
10
|
+
margin: 0 0 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* TODO @TW: cannot compose */
|
|
14
|
+
.root ul {
|
|
15
|
+
/* composes: list-disc from global; */
|
|
16
|
+
list-style-type: disc;
|
|
17
|
+
margin: 0 0 1rem;
|
|
18
|
+
padding-left: 2.5rem;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
export const GET_STORE_CONFIG_DATA = gql`
|
|
4
|
+
query GetStoreConfigForBreadcrumbs {
|
|
5
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
6
|
+
storeConfig {
|
|
7
|
+
store_code
|
|
8
|
+
category_url_suffix
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
getStoreConfigQuery: GET_STORE_CONFIG_DATA
|
|
15
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useQuery } from '@apollo/client';
|
|
3
|
+
|
|
4
|
+
import mergeOperations from '@magento/peregrine/lib/util/shallowMerge';
|
|
5
|
+
|
|
6
|
+
import DEFAULT_OPERATIONS from './attributesBlock.gql';
|
|
7
|
+
|
|
8
|
+
const getPath = (path, suffix) => {
|
|
9
|
+
if (path) {
|
|
10
|
+
return `/${path}${suffix || ''}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// If there is no path this is just a dead link.
|
|
14
|
+
return '#';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const useAttributesBlock = props => {
|
|
18
|
+
const { attributesBlock } = props;
|
|
19
|
+
|
|
20
|
+
const operations = mergeOperations(DEFAULT_OPERATIONS, props.operations);
|
|
21
|
+
const { getStoreConfigQuery } = operations;
|
|
22
|
+
|
|
23
|
+
const { data: storeConfigData } = useQuery(getStoreConfigQuery, {
|
|
24
|
+
fetchPolicy: 'cache-and-network'
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const categoryUrlSuffix = useMemo(() => {
|
|
28
|
+
if (storeConfigData) {
|
|
29
|
+
return storeConfigData.storeConfig.category_url_suffix;
|
|
30
|
+
}
|
|
31
|
+
}, [storeConfigData]);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
categoryUrlSuffix,
|
|
35
|
+
getPath
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
export const GET_STORE_CONFIG_DATA = gql`
|
|
4
|
+
query getStoreConfigData {
|
|
5
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
6
|
+
storeConfig {
|
|
7
|
+
store_code
|
|
8
|
+
product_url_suffix
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const GET_COLLECTIBLE_GAME_QUERY = gql`
|
|
14
|
+
query getCollectibleGameSets($categoryUrlKey: String!) {
|
|
15
|
+
collectibleGameSets(categoryUrlKey: $categoryUrlKey) {
|
|
16
|
+
card_set
|
|
17
|
+
card_game
|
|
18
|
+
card_set_abbreviation
|
|
19
|
+
card_release_year
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
getStoreConfigData: GET_STORE_CONFIG_DATA,
|
|
26
|
+
getCollectibleGameQuery: GET_COLLECTIBLE_GAME_QUERY
|
|
27
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client';
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { useLocation } from 'react-router-dom';
|
|
4
|
+
import { useAppContext } from '@magento/peregrine/lib/context/app';
|
|
5
|
+
|
|
6
|
+
import mergeOperations from '@magento/peregrine/lib/util/shallowMerge';
|
|
7
|
+
import DEFAULT_OPERATIONS from './collectibleGameSets.gql';
|
|
8
|
+
|
|
9
|
+
export const useCollectibleGameSets = props => {
|
|
10
|
+
|
|
11
|
+
const operations = mergeOperations(DEFAULT_OPERATIONS, null);
|
|
12
|
+
const { getStoreConfigData, getCollectibleGameQuery } = operations;
|
|
13
|
+
const { pathname } = useLocation();
|
|
14
|
+
const [
|
|
15
|
+
,
|
|
16
|
+
{
|
|
17
|
+
actions: { setPageLoading }
|
|
18
|
+
}
|
|
19
|
+
] = useAppContext();
|
|
20
|
+
|
|
21
|
+
const { data: storeConfigData } = useQuery(getStoreConfigData, {
|
|
22
|
+
fetchPolicy: 'cache-and-network',
|
|
23
|
+
nextFetchPolicy: 'cache-first'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const slug = pathname.split('/').pop();
|
|
27
|
+
const productUrlSuffix = storeConfigData?.storeConfig?.product_url_suffix;
|
|
28
|
+
const categoryUrlKey = productUrlSuffix ? slug.replace(productUrlSuffix, '') : slug;
|
|
29
|
+
|
|
30
|
+
const { error, loading, data } = useQuery(getCollectibleGameQuery, {
|
|
31
|
+
fetchPolicy: 'cache-and-network',
|
|
32
|
+
nextFetchPolicy: 'cache-first',
|
|
33
|
+
skip: !storeConfigData,
|
|
34
|
+
variables: {
|
|
35
|
+
categoryUrlKey
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const isBackgroundLoading = !!data && loading;
|
|
40
|
+
|
|
41
|
+
const collectibleGameSets = useMemo(() => {
|
|
42
|
+
if (!data) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const collectibleGameSets = data.collectibleGameSets;
|
|
47
|
+
|
|
48
|
+
if (!collectibleGameSets) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return collectibleGameSets;
|
|
53
|
+
}, [data, categoryUrlKey]);
|
|
54
|
+
|
|
55
|
+
// Update the page indicator if the GraphQL query is in flight.
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
setPageLoading(isBackgroundLoading);
|
|
58
|
+
}, [isBackgroundLoading, setPageLoading]);
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
error,
|
|
62
|
+
loading,
|
|
63
|
+
collectibleGameSets
|
|
64
|
+
};
|
|
65
|
+
};
|
package/src/theme/vars.js
CHANGED
|
@@ -6,6 +6,7 @@ export const orange = '#F7C317';
|
|
|
6
6
|
export const gray100 = '#B9AEC5';
|
|
7
7
|
export const gray600 = '#1BA387';
|
|
8
8
|
export const gray700 = '#999999';
|
|
9
|
+
export const primary900 = "#292D32";
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
textPrimary,
|
|
@@ -16,4 +17,5 @@ export default {
|
|
|
16
17
|
gray100,
|
|
17
18
|
gray600,
|
|
18
19
|
gray700,
|
|
20
|
+
primary900,
|
|
19
21
|
}
|