@riosst100/pwa-marketplace 3.1.3 → 3.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.
Files changed (73) hide show
  1. package/package.json +1 -1
  2. package/src/components/BrandLandingPage/brandLanding.js +0 -5
  3. package/src/components/CheckoutHeader/accountTrigger.js +104 -0
  4. package/src/components/CheckoutHeader/cartTrigger.js +110 -0
  5. package/src/components/CheckoutHeader/cartTrigger.module.css +47 -0
  6. package/src/components/CheckoutHeader/storeSwitcher.js +119 -0
  7. package/src/components/CheckoutHeader/storeSwitcher.module.css +107 -0
  8. package/src/components/CheckoutHeader/switcherItem.js +47 -0
  9. package/src/components/CheckoutHeader/wishlistTrigger.js +23 -0
  10. package/src/components/FilterListContent/filterListPage.js +0 -25
  11. package/src/components/FilterTop/filterTop.js +1 -1
  12. package/src/components/ProductContent/productContent.js +1 -1
  13. package/src/components/RMAPage/components/productItem.css +15 -0
  14. package/src/components/RMAPage/components/productItem.module.css +15 -0
  15. package/src/components/RelatedProducts/index.js +1 -0
  16. package/src/components/RelatedProducts/relatedProducts.js +44 -0
  17. package/src/components/SellerMegaMenu/__tests__/MegaMenu.spec.js +91 -0
  18. package/src/components/SellerMegaMenu/__tests__/MegaMenuItem.spec.js +123 -0
  19. package/src/components/SellerMegaMenu/__tests__/Submenu.spec.js +61 -0
  20. package/src/components/SellerMegaMenu/__tests__/SubmenuColumn.spec.js +50 -0
  21. package/src/components/SellerMegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +114 -0
  22. package/src/components/SellerMegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +71 -0
  23. package/src/components/SellerMegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +59 -0
  24. package/src/components/SellerMegaMenu/__tests__/__snapshots__/SubmenuColumn.spec.js.snap +34 -0
  25. package/src/components/SellerMegaMenu/customSubmenuColumn.js +75 -0
  26. package/src/components/SellerMegaMenu/customSubmenuColumn.module.css +29 -0
  27. package/src/components/SellerMegaMenu/shopByColumn.js +121 -0
  28. package/src/components/SellerProducts/productContent.js +2 -4
  29. package/src/components/SetsData/setsData.js +0 -25
  30. package/src/components/ShopBy/shopBy.js +3 -78
  31. package/src/components/ShopBySets/shopBySets.js +2 -2
  32. package/src/components/ShowMore/showMore.js +3 -49
  33. package/src/intercept.js +0 -14
  34. package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderHistoryPage.gql.js +1 -15
  35. package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js +0 -11
  36. package/src/overwrites/peregrine/lib/talons/RelatedProducts/productReview.gql.js +89 -0
  37. package/src/overwrites/peregrine/lib/talons/RelatedProducts/useRelatedProducts.js +833 -0
  38. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +0 -16
  39. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +1 -5
  40. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +118 -62
  41. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +3 -50
  42. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +1 -7
  43. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/editModal.js +41 -0
  44. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/index.js +1 -0
  45. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productDetail.js +80 -0
  46. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productDetail.module.css +33 -0
  47. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productForm.js +153 -0
  48. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productForm.module.css +52 -0
  49. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/errorMessage.js +31 -0
  50. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/errorMessage.module.css +13 -0
  51. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/quantity.js +40 -0
  52. package/src/overwrites/venia-ui/lib/components/FilterModal/filterBlock.js +4 -0
  53. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +21 -92
  54. package/src/overwrites/venia-ui/lib/components/Footer/sampleData.js +1 -1
  55. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +6 -2
  56. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +0 -21
  57. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/Reviews/reviewModal.js +8 -0
  58. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +3 -3
  59. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +4 -85
  60. package/src/talons/ProductContent/productContent.gql.js +0 -16
  61. package/src/talons/ProductContent/useProductContent.js +0 -4
  62. package/src/talons/RelatedProducts/relatedProducts.gql.js +209 -0
  63. package/src/talons/RelatedProducts/useRelatedProducts.js +112 -0
  64. package/src/talons/SellerProducts/productContent.gql.js +1 -17
  65. package/src/talons/SellerProducts/useProductContent.js +1 -36
  66. package/src/components/AttributesBlock/attributesBlock.js +0 -54
  67. package/src/components/AttributesBlock/attributesBlock.module.css +0 -28
  68. package/src/components/ShopBy/shopBy copy.js +0 -172
  69. package/src/components/SubCategory/customSubCategory.js +0 -45
  70. package/src/components/SubCategory/customSubCategory.module.css +0 -22
  71. package/src/talons/AttributesBlock/attributesBlock.gql.js +0 -15
  72. package/src/talons/AttributesBlock/useAttributesBlock.js +0 -38
  73. package/src/talons/SubCategory/useCustomSubCategory.js +0 -50
@@ -1,172 +0,0 @@
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 { Link } from 'react-router-dom';
5
- import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
6
- import defaultClasses from './shopBy.module.css';
7
- import { useStyle } from '@magento/venia-ui/lib/classify';
8
- import cn from 'classnames';
9
- import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
10
- import { ShopByShimmer } from '@riosst100/pwa-marketplace/src/components/ShopBy';
11
- import CustomSortBy from '@riosst100/pwa-marketplace/src/components/CustomSortBy';
12
- import ArraySearchInput from '@riosst100/pwa-marketplace/src/components/ArraySearchInput';
13
- import { useCustomSort } from '@riosst100/pwa-marketplace/src/hooks/useCustomSort';
14
- import { useShopBy } from '@riosst100/pwa-marketplace/src/talons/ShopBy/useShopBy';
15
-
16
- const ShopBy = props => {
17
- const [active, setActive] = useState('all');
18
-
19
- const [searchQuery, setSearchQuery] = useState('');
20
-
21
-
22
- const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: {
23
- sortText: 'All (A-Z)',
24
- value: 'all'
25
- }});
26
-
27
- const [currentSort] = sortProps;
28
-
29
- // const [sortBy, setSortBy] = useState({
30
- // sortText: 'All (A-Z)',
31
- // value: 'all'
32
- // });
33
-
34
-
35
- const classes = useStyle(defaultClasses);
36
-
37
- const talonProps = useShopBy({ searchQuery, setActive, currentSort });
38
-
39
- const { error, loading, dataResult, categoryUrlSuffix, categoryUrlKey, productType, filteredCollectibleGameSets, availableGroups, attributeData, alpha, category } = talonProps;
40
-
41
- if (loading && !dataResult)
42
- return <ShopByShimmer />;
43
- if (error && !dataResult) return <ErrorView />;
44
-
45
- if (!dataResult && !loading && !error) {
46
- return <ShopByShimmer />;
47
- }
48
-
49
- const newData = searchQuery ? filteredCollectibleGameSets : dataResult;
50
-
51
- const setRelases = availableGroups.map((group, index) => {
52
- const optionsResult = [];
53
-
54
- if (active === 'all' || active === group) {
55
- dataResult[group].map((option, index) => {
56
- const { label, value } = option;
57
-
58
- const categoryUrl = resourceUrl(
59
- `/${categoryUrlKey}${categoryUrlSuffix || ''}?${attributeData.attribute_code}[filter]=${label},${value}`
60
- );
61
-
62
- optionsResult.push(<li className='list-none'>
63
- <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
64
- {label}
65
- </Link>
66
- </li>)
67
- })
68
-
69
- return (
70
- <>
71
- {optionsResult ?
72
- <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
73
- <div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' >
74
- {group}
75
- </div>
76
- <div className={cn('singles_item-list flex flex-col')}>{optionsResult}</div>
77
- </div> : ''}
78
- </>
79
- );
80
- }
81
-
82
- return null;
83
- });
84
-
85
- const handleActive = (val) => {
86
- setActive(val);
87
-
88
- //
89
-
90
-
91
- setSearchQuery('')
92
- }
93
-
94
- let availableSortBy = [
95
- {
96
- 'label': 'All (A-Z)',
97
- 'value': 'all'
98
- }
99
- ];
100
-
101
- let title = "All Sets";
102
- if (productType == "expansion-sets") {
103
- title = "Expansion Sets";
104
- } else if (productType == "artist") {
105
- title = "Artist";
106
- }
107
-
108
- return (
109
- <Fragment>
110
- <StoreTitle>{title}</StoreTitle>
111
- <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
112
- {attributeData ? 'By ' + attributeData.label : 'Shop By'}
113
- </h1>
114
- <div className='border border-gray-100 px-6'>
115
- {dataResult ? (
116
- <div
117
- className={classes.toolbar}
118
- >
119
- <div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={setSearchQuery} /></div>
120
- <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} />
121
- </div>
122
- ) : ''}
123
- {productType != "expansion-sets" ? (
124
- <>
125
- <section className='single_list-indexing-container relative m-auto py-10'>
126
- <ul className='flex gap-2 justify-center flex-wrap'>
127
- <li>
128
- <button
129
- className={cn(
130
- 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
131
- 'leading-4 font-medium text-base hover_bg-gray-50'
132
- )}
133
- onClick={() => {
134
- handleActive('all')
135
- }}
136
- >
137
- {active == 'all' ? <b>All</b> : 'All'}
138
- </button>
139
- </li>
140
- {alpha.map((letter, index) => (
141
- <li key={index}>
142
- <button
143
- className={cn(
144
- 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
145
- 'leading-4 font-medium text-base ',
146
- availableGroups.includes(letter) > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
147
- )}
148
- onClick={() => {
149
- handleActive(letter)
150
- }}
151
- disabled={availableGroups.includes(letter) > 0 ? false : true}
152
- >
153
- {active == letter ? <b>{letter}</b> : letter}
154
- </button>
155
- </li>
156
- ))}
157
- </ul>
158
- </section>
159
- </>
160
- ) : ''}
161
- <Divider className="mb-5 px-4 mt-5" />
162
- <section className='singles-container'>
163
- <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
164
- {Object.keys(dataResult).length != 0 ? setRelases : (searchQuery ? <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No data found for <b>{searchQuery}</b> search query.</div> : <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No data found.</div>)}
165
- </div>
166
- </section>
167
- </div>
168
- </Fragment>
169
- );
170
- }
171
-
172
- export default ShopBy;
@@ -1,45 +0,0 @@
1
- import { useCustomSubCategory } from '@riosst100/pwa-marketplace/src/talons/SubCategory/useCustomSubCategory';
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 './customSubCategory.module.css';
6
- import { useStyle } from '@magento/venia-ui/lib/classify';
7
-
8
- const CustomSubCategory = props => {
9
- const { customSubCategory, categoryName } = props;
10
-
11
- const talonProps = useCustomSubCategory({ customSubCategory });
12
-
13
- const classes = useStyle(defaultClasses, props.classes);
14
-
15
- const {
16
- normalizedData
17
- } = talonProps;
18
-
19
- const subCategory = [];
20
-
21
- normalizedData && normalizedData.map(({ text, path }, index) => {
22
- if (text == categoryName) {
23
- subCategory.push(
24
- <span>
25
- <b>
26
- <li className={classes.item}>{text}</li>
27
- </b>
28
- </span>
29
- )
30
- } else {
31
- subCategory.push(
32
- <Link
33
- key={index}
34
- to={resourceUrl(path)}
35
- >
36
- <li className={classes.item}>{text}</li>
37
- </Link>
38
- )
39
- }
40
- });
41
-
42
- return subCategory.length ? <ul className={classes.root}>{subCategory}</ul> : '';
43
- };
44
-
45
- export default CustomSubCategory;
@@ -1,22 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
- };
@@ -1,38 +0,0 @@
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
- nextFetchPolicy: 'cache-first'
26
- });
27
-
28
- const categoryUrlSuffix = useMemo(() => {
29
- if (storeConfigData) {
30
- return storeConfigData.storeConfig.category_url_suffix;
31
- }
32
- }, [storeConfigData]);
33
-
34
- return {
35
- categoryUrlSuffix,
36
- getPath
37
- };
38
- };
@@ -1,50 +0,0 @@
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 './subCategory.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 useCustomSubCategory = props => {
18
- const { customSubCategory } = 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
- nextFetchPolicy: 'cache-first'
26
- });
27
-
28
- const categoryUrlSuffix = useMemo(() => {
29
- if (storeConfigData) {
30
- return storeConfigData.storeConfig.category_url_suffix;
31
- }
32
- }, [storeConfigData]);
33
-
34
- const normalizedData = useMemo(() => {
35
- if (customSubCategory) {
36
- return (
37
- customSubCategory.length &&
38
- customSubCategory
39
- .map(category => ({
40
- text: category.name,
41
- path: `/${category.path}`
42
- }))
43
- );
44
- }
45
- }, [categoryUrlSuffix, customSubCategory]);
46
-
47
- return {
48
- normalizedData: normalizedData || []
49
- };
50
- };