@riosst100/pwa-marketplace 3.1.2 → 3.1.4

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 (76) 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/HelpCenter/helpCenter.js +151 -0
  13. package/src/components/HelpCenter/helpcenter.module.css +225 -0
  14. package/src/components/HelpCenter/index.js +1 -0
  15. package/src/components/HelpCenter/questionDetail.js +89 -0
  16. package/src/components/ProductContent/productContent.js +1 -1
  17. package/src/components/RMAPage/components/productItem.css +15 -0
  18. package/src/components/RMAPage/components/productItem.module.css +15 -0
  19. package/src/components/RelatedProducts/index.js +1 -0
  20. package/src/components/RelatedProducts/relatedProducts.js +44 -0
  21. package/src/components/SellerMegaMenu/__tests__/MegaMenu.spec.js +91 -0
  22. package/src/components/SellerMegaMenu/__tests__/MegaMenuItem.spec.js +123 -0
  23. package/src/components/SellerMegaMenu/__tests__/Submenu.spec.js +61 -0
  24. package/src/components/SellerMegaMenu/__tests__/SubmenuColumn.spec.js +50 -0
  25. package/src/components/SellerMegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +114 -0
  26. package/src/components/SellerMegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +71 -0
  27. package/src/components/SellerMegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +59 -0
  28. package/src/components/SellerMegaMenu/__tests__/__snapshots__/SubmenuColumn.spec.js.snap +34 -0
  29. package/src/components/SellerMegaMenu/customSubmenuColumn.js +75 -0
  30. package/src/components/SellerMegaMenu/customSubmenuColumn.module.css +29 -0
  31. package/src/components/SellerMegaMenu/shopByColumn.js +121 -0
  32. package/src/components/SellerProducts/productContent.js +2 -4
  33. package/src/components/SetsData/setsData.js +0 -25
  34. package/src/components/ShopBy/shopBy.js +3 -78
  35. package/src/components/ShopBySets/shopBySets.js +2 -2
  36. package/src/components/ShowMore/showMore.js +3 -49
  37. package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderHistoryPage.gql.js +1 -15
  38. package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js +0 -11
  39. package/src/overwrites/peregrine/lib/talons/RelatedProducts/productReview.gql.js +89 -0
  40. package/src/overwrites/peregrine/lib/talons/RelatedProducts/useRelatedProducts.js +833 -0
  41. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +0 -16
  42. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +1 -5
  43. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +118 -62
  44. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +3 -50
  45. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +1 -7
  46. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/editModal.js +41 -0
  47. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/index.js +1 -0
  48. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productDetail.js +80 -0
  49. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productDetail.module.css +33 -0
  50. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productForm.js +153 -0
  51. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productForm.module.css +52 -0
  52. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/errorMessage.js +31 -0
  53. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/errorMessage.module.css +13 -0
  54. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/quantity.js +40 -0
  55. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +21 -92
  56. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +6 -2
  57. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +0 -21
  58. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/Reviews/reviewModal.js +8 -0
  59. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +3 -3
  60. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +4 -85
  61. package/src/talons/HelpCenter/helpCenter.gql.js +93 -0
  62. package/src/talons/HelpCenter/useHelpCenter.js +59 -0
  63. package/src/talons/ProductContent/productContent.gql.js +0 -16
  64. package/src/talons/ProductContent/useProductContent.js +0 -4
  65. package/src/talons/RelatedProducts/relatedProducts.gql.js +209 -0
  66. package/src/talons/RelatedProducts/useRelatedProducts.js +112 -0
  67. package/src/talons/SellerProducts/productContent.gql.js +1 -17
  68. package/src/talons/SellerProducts/useProductContent.js +1 -36
  69. package/src/components/AttributesBlock/attributesBlock.js +0 -54
  70. package/src/components/AttributesBlock/attributesBlock.module.css +0 -28
  71. package/src/components/ShopBy/shopBy copy.js +0 -172
  72. package/src/components/SubCategory/customSubCategory.js +0 -45
  73. package/src/components/SubCategory/customSubCategory.module.css +0 -22
  74. package/src/talons/AttributesBlock/attributesBlock.gql.js +0 -15
  75. package/src/talons/AttributesBlock/useAttributesBlock.js +0 -38
  76. package/src/talons/SubCategory/useCustomSubCategory.js +0 -50
@@ -0,0 +1,121 @@
1
+ import React, { useMemo } from 'react';
2
+ import { Link } from 'react-router-dom';
3
+
4
+ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
5
+
6
+ import { useStyle } from '@magento/venia-ui/lib/classify';
7
+ import defaultClasses from './submenuColumn.module.css';
8
+ import PropTypes from 'prop-types';
9
+ import { useIntl } from 'react-intl';
10
+ import cn from 'classnames';
11
+
12
+ const ShopByColumn = props => {
13
+ const classes = useStyle(defaultClasses, props.classes);
14
+
15
+ const { formatMessage } = useIntl();
16
+
17
+ const {
18
+ shopBy,
19
+ category,
20
+ categoryUrlSuffix,
21
+ handleCloseSubMenu,
22
+ onNavigate
23
+ } = props;
24
+
25
+ const { url_path } = category;
26
+
27
+ let items = null;
28
+
29
+ const itemCountToShow = 9999;
30
+
31
+ if (shopBy.items.length) {
32
+ const childrenItems = shopBy.items.map((shopByItem, index) => {
33
+
34
+ if (index >= itemCountToShow) {
35
+ return null;
36
+ }
37
+
38
+ const { name, option_id } = shopByItem;
39
+ // const categoryUrl = resourceUrl(
40
+ // `/${url_path}${categoryUrlSuffix || ''}`
41
+ // );
42
+
43
+ // setting keyboardProps if it is last child of that shopBy
44
+ const keyboardProps =
45
+ index === shopBy.items.length - 1
46
+ ? props.keyboardProps
47
+ : {};
48
+
49
+ const categoryUrl =
50
+ `/${shopByItem.url_path}`
51
+ ;
52
+
53
+ return (
54
+ <li key={index} className={cn(classes.submenuChildItem, 'mt-0')}>
55
+ <Link
56
+ {...keyboardProps}
57
+ // className={isActive ? classes.linkActive : classes.link}
58
+ className={classes.link}
59
+ data-cy="MegaMenu-ShopByColumn-link"
60
+ to={categoryUrl}
61
+ onClick={() => {
62
+ handleCloseSubMenu();
63
+ onNavigate();
64
+ }}
65
+ >
66
+ {name}
67
+ </Link>
68
+ </li>
69
+ );
70
+ });
71
+
72
+ items = <ul className={classes.submenuChild}>{childrenItems}</ul>;
73
+ }
74
+
75
+ const viewAll = useMemo(() => {
76
+ if (shopBy.items.length <= itemCountToShow) {
77
+ return null;
78
+ }
79
+
80
+ const label = formatMessage({
81
+ id: 'filterList.viewAll',
82
+ defaultMessage: 'View All'
83
+ });
84
+
85
+ const categoryUrl = resourceUrl(
86
+ `/shop/${shopBy.code}`
87
+ );
88
+
89
+ return (
90
+ <li className={classes.submenuChildItem}>
91
+ <Link
92
+ // className={isActive ? classes.linkActive : classes.link}
93
+ className={classes.link}
94
+ data-cy="MegaMenu-ShopByColumn-link"
95
+ to={categoryUrl}
96
+ onClick={handleCloseSubMenu}
97
+ >
98
+ {label}
99
+ </Link>
100
+ </li>
101
+ );
102
+ }, [
103
+ // handleViewAll,
104
+ shopBy,
105
+ itemCountToShow,
106
+ formatMessage,
107
+ // classes
108
+ ]);
109
+
110
+ return (
111
+ <div className={classes.submenuItems}>
112
+ <div className={classes.submenuColumn}>
113
+ <span className={classes.heading}>{shopBy.name}</span>
114
+ {items}
115
+ {viewAll}
116
+ </div>
117
+ </div>
118
+ );
119
+ };
120
+
121
+ export default ShopByColumn;
@@ -25,7 +25,6 @@ import Gallery, { GalleryShimmer } from '@magento/venia-ui/lib/components/Galler
25
25
  import Pagination from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Pagination';
26
26
  import SellerMegaMenu from '@riosst100/pwa-marketplace/src/components/SellerMegaMenu';
27
27
  import AlphaFilter from '@riosst100/pwa-marketplace/src/components/AlphaFilter';
28
- import CustomSubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/customSubCategory';
29
28
  import SubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/subCategory';
30
29
  import { useLocation, useHistory } from 'react-router-dom';
31
30
  import { getFiltersFromSearch } from '@magento/peregrine/lib/talons/FilterModal/helpers';
@@ -86,7 +85,7 @@ const ProductContent = props => {
86
85
  const shouldShowFilterShimmer = filters === null;
87
86
 
88
87
  const sidebar = shouldShowFilterButtons ? (
89
- <FilterSidebar hideFilters={false} children={[]} filters={filters} allowedFilters={[]} />
88
+ <FilterSidebar children={[]} filters={filters} />
90
89
  ) : shouldShowFilterShimmer ? (
91
90
  <FilterSidebarShimmer />
92
91
  ) : null;
@@ -269,11 +268,10 @@ const ProductContent = props => {
269
268
  </div>
270
269
  <>
271
270
  {currentFilter && <AlphaFilter isSingles={isSingles} items={items} handleActiveLetter={handleActiveLetter} activeLetter={activeLetter} />}
272
- {!currentFilter && <CustomSubCategory categoryName={category ? category.name : null} customSubCategory={category ? category.custom_subcategory : null} />}
273
271
  {shopby != "gauge" && category?.name != "Collectible Card Games" ? <SubCategory parent={parent} children={children} /> : ''}
274
272
 
275
273
  </>
276
- <FilterTop shopby={shopby} filters={filters} category={category} children={children} allowedFilters={category ? category.allowed_filters : []} />
274
+ <FilterTop shopby={shopby} filters={filters} category={category} children={children} />
277
275
  </div>
278
276
  <div className='w-full flex items-start gap-x-[30px]'>
279
277
  <div className={classes.contentWrapper}>
@@ -50,21 +50,6 @@ const SetsData = props => {
50
50
  // Sorting
51
51
  const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
52
52
  const [currentSort] = sortProps;
53
- // const [sortBy, setSortBy] = useState({
54
- // sortText: 'All (A-Z)',
55
- // value: 'all'
56
- // });
57
-
58
- // let availableSortBy = [
59
- // {
60
- // 'label': 'All (A-Z)',
61
- // 'value': 'all'
62
- // },
63
- // {
64
- // 'label': 'By Year',
65
- // 'value': 'newest'
66
- // }
67
- // ];
68
53
 
69
54
  const classes = useStyle(defaultClasses);
70
55
 
@@ -100,14 +85,7 @@ const SetsData = props => {
100
85
  return result;
101
86
  }
102
87
 
103
- let allSetsTitle = "Sets";
104
88
  let attributeCode = attributeData ? attributeData.attribute_code : '';
105
- let byYearTitle = "By Year";
106
- // if (shopby == "singles") {
107
- // attributeCode = "lego_set_name";
108
- // // allSetsTitle = "Singles";
109
- // byYearTitle = "By Year";
110
- // }
111
89
 
112
90
  let newfilterSearchArr = search ? search.split('&') : [];
113
91
  newfilterSearchArr = newfilterSearchArr.filter(function(data) {
@@ -258,9 +236,6 @@ const SetsData = props => {
258
236
 
259
237
  const label = filterArr[0];
260
238
  const optionId = filterArr[1];
261
- if (label == "Singles") {
262
- isSingles = true;
263
- }
264
239
  if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
265
240
  activeFilters.push(
266
241
  {
@@ -1,38 +1,9 @@
1
1
  import React, { Fragment, useEffect, Suspense, useMemo, useRef, useState } from 'react';
2
- import { FormattedMessage } from 'react-intl';
3
- import { array, number, shape, string } from 'prop-types';
4
-
5
- import { useIsInViewport } from '@magento/peregrine/lib/hooks/useIsInViewport';
6
- import { useCategoryContent } from '@magento/peregrine/lib/talons/RootComponents/Category';
7
-
8
2
  import { useStyle } from '@magento/venia-ui/lib/classify';
9
3
  import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs';
10
- import FilterModalOpenButton, {
11
- FilterModalOpenButtonShimmer
12
- } from '@magento/venia-ui/lib/components/FilterModalOpenButton';
13
- import { FilterSidebarShimmer } from '@magento/venia-ui/lib/components/FilterSidebar';
14
- import Gallery, { GalleryShimmer } from '@magento/venia-ui/lib/components/Gallery';
15
- import Pagination from '@magento/venia-ui/lib/components/Pagination';
16
- import ProductSort, { ProductSortShimmer } from '@magento/venia-ui/lib/components/ProductSort';
17
- import RichContent from '@magento/venia-ui/lib/components/RichContent';
18
- import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
19
- import SortedByContainer, {
20
- SortedByContainerShimmer
21
- } from '@magento/venia-ui/lib/components/SortedByContainer';
22
- import NoProductsFound from '@magento/venia-ui/lib/RootComponents/Category/NoProductsFound';
23
4
  import cn from 'classnames';
24
- import ProductListTab, { ProductListTabShimmer } from '@riosst100/pwa-marketplace/src/components/ProductListTab';
25
- import SubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/subCategory';
26
- import AttributesBlock from '@riosst100/pwa-marketplace/src/components/AttributesBlock/attributesBlock';
27
-
28
- import BrandSlider from '@riosst100/pwa-marketplace/src/components/BrandSlider';
29
- import CollectibleGameSets from '@riosst100/pwa-marketplace/src/components/CollectibleGameSets/collectibleGameSets';
30
5
  import { useLocation } from 'react-router-dom';
31
6
  import { getFiltersFromSearch } from '@magento/peregrine/lib/talons/FilterModal/helpers';
32
- import CustomSubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/customSubCategory';
33
- import AlphaFilter from '@riosst100/pwa-marketplace/src/components/AlphaFilter';
34
- import ShopByFilters from '@riosst100/pwa-marketplace/src/components/ShopByFilters';
35
-
36
7
  import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
37
8
  import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
38
9
  import { Link } from 'react-router-dom';
@@ -45,10 +16,6 @@ import ArraySearchInput from '@riosst100/pwa-marketplace/src/components/ArraySea
45
16
  import { useCustomSort } from '@riosst100/pwa-marketplace/src/hooks/useCustomSort';
46
17
  import { useShopBy } from '@riosst100/pwa-marketplace/src/talons/ShopBy/useShopBy';
47
18
 
48
- const FilterModal = React.lazy(() => import('@magento/venia-ui/lib/components/FilterModal'));
49
- const FilterSidebar = React.lazy(() =>
50
- import('@magento/venia-ui/lib/components/FilterSidebar')
51
- );
52
19
  const FilterTop = React.lazy(() =>
53
20
  import('@riosst100/pwa-marketplace/src/components/FilterTop')
54
21
  );
@@ -57,33 +24,8 @@ const ShopBy = props => {
57
24
  const {
58
25
  categoryId,
59
26
  shopby
60
- // data,
61
- // isLoading,
62
- // pageControl,
63
- // sortProps,
64
- // pageSize
65
27
  } = props || {};
66
- // const [currentSort] = sortProps;
67
-
68
- // const talonProps = useCategoryContent({
69
- // categoryId,
70
- // data,
71
- // pageSize
72
- // });
73
-
74
- // const {
75
- // availableSortMethods,
76
- // categoryName,
77
- // categoryDescription,
78
- // filters,
79
- // items,
80
- // children,
81
- // parent,
82
- // totalCount,
83
- // totalPagesFromData,
84
- // attributesBlock,
85
- // category,
86
- // } = talonProps;
28
+
87
29
  useEffect(() => {
88
30
  window.scrollTo(0, 0);
89
31
  }, []);
@@ -102,12 +44,6 @@ const ShopBy = props => {
102
44
 
103
45
  const [currentSort] = sortProps;
104
46
 
105
- // const [sortBy, setSortBy] = useState({
106
- // sortText: 'All (A-Z)',
107
- // value: 'all'
108
- // });
109
-
110
-
111
47
  const classes = useStyle(defaultClasses);
112
48
 
113
49
  const talonProps = useShopBy({ activeFilter, searchQuery, active, setActive, currentSort, categoryId, shopby });
@@ -217,21 +153,13 @@ const ShopBy = props => {
217
153
  setSearchQuery('')
218
154
  }
219
155
 
220
- // let availableSortBy = [
221
- // {
222
- // 'label': 'All (A-Z)',
223
- // 'value': 'all'
224
- // }
225
- // ];
226
-
227
156
  let availableSortBy = [
228
157
  {
229
158
  'label': 'All (A-Z)',
230
159
  'value': 'all'
231
160
  }
232
161
  ];
233
-
234
- // const title = attributeData ? (attributeData.attribute_code == "sc_baseball_parallel" ? "Parallel Sets" : (attributeData.attribute_code == "sc_baseball_inserts" ? "Insert Sets" : attributeData.label)) : "Shop By"
162
+
235
163
  const title = pageInfo ? pageInfo.label : '';
236
164
 
237
165
  let availableFilterOption = [];
@@ -347,9 +275,6 @@ const ShopBy = props => {
347
275
 
348
276
  const label = filterArr[0];
349
277
  const optionId = filterArr[1];
350
- if (label == "Singles") {
351
- isSingles = true;
352
- }
353
278
  if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
354
279
  activeFilters.push(
355
280
  {
@@ -367,7 +292,7 @@ const ShopBy = props => {
367
292
  <Fragment>
368
293
  <StoreTitle>{title}</StoreTitle>
369
294
  <Breadcrumbs categoryId={categoryId} customPage={title} currentFilter={activeFilters} />
370
- {category?.url_path.includes('model-railway') && <FilterTop shopby={shopby} filters={[]} category={category} children={[]} allowedFilters={category ? category.allowed_filters : []} />}
295
+ {category?.url_path.includes('model-railway') && <FilterTop shopby={shopby} filters={[]} category={category} children={[]} />}
371
296
  {/* <ShopByFilters handleActiveFilter={handleActiveFilter} activeFilter={activeFilter} category={category} /> */}
372
297
  {availableFilterOption.length ?
373
298
  <ul className={classes.nav}>
@@ -179,14 +179,14 @@ const ShopBySets = props => {
179
179
  } else if (productType == "artist") {
180
180
  title = "By Artist";
181
181
  } else if (shopby == "release_year") {
182
- title = "By Year";
182
+ title = "Year";
183
183
  }
184
184
 
185
185
 
186
186
  return (
187
187
  <Fragment>
188
188
  <StoreTitle>{title}</StoreTitle>
189
- <Breadcrumbs categoryId={categoryId} customPage={shopby == "secret_lair" ? "Secret Lair" : (shopby == "expansion_sets" ? "Expansion Sets" : (shopby == "release_year" ? "By Year" : "All Set3s"))} />
189
+ <Breadcrumbs categoryId={categoryId} customPage={shopby == "secret_lair" ? "Secret Lair" : (shopby == "expansion_sets" ? "Expansion Sets" : (shopby == "release_year" ? "Year" : "All Set3s"))} />
190
190
  {shopby != "release_year" && productType != "secret_lair" && productType != "expansion_sets" && <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
191
191
  {title}
192
192
  </h1>}
@@ -1,4 +1,4 @@
1
- import React, { Fragment, Suspense, useMemo, useRef, useState } from 'react';
1
+ import React, { Fragment, useState } from 'react';
2
2
 
3
3
  import { useStyle } from '@magento/venia-ui/lib/classify';
4
4
  import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs';
@@ -7,7 +7,7 @@ import { useLocation } from 'react-router-dom';
7
7
  import { getFiltersFromSearch } from '@magento/peregrine/lib/talons/FilterModal/helpers';
8
8
 
9
9
  import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
10
- import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
10
+ import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
11
11
  import { Link } from 'react-router-dom';
12
12
  import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
13
13
  import defaultClasses from '@riosst100/pwa-marketplace/src/components/ShopBy/shopBy.module.css';
@@ -18,10 +18,6 @@ import ArraySearchInput from '@riosst100/pwa-marketplace/src/components/ArraySea
18
18
  import { useCustomSort } from '@riosst100/pwa-marketplace/src/hooks/useCustomSort';
19
19
  import { useShowMore } from '@riosst100/pwa-marketplace/src/talons/ShowMore/useShowMore';
20
20
 
21
- const FilterModal = React.lazy(() => import('@magento/venia-ui/lib/components/FilterModal'));
22
- const FilterSidebar = React.lazy(() =>
23
- import('@magento/venia-ui/lib/components/FilterSidebar')
24
- );
25
21
  const FilterTop = React.lazy(() =>
26
22
  import('@riosst100/pwa-marketplace/src/components/FilterTop')
27
23
  );
@@ -30,33 +26,7 @@ const ShowMore = props => {
30
26
  const {
31
27
  categoryId,
32
28
  shopby
33
- // data,
34
- // isLoading,
35
- // pageControl,
36
- // sortProps,
37
- // pageSize
38
29
  } = props || {};
39
- // const [currentSort] = sortProps;
40
-
41
- // const talonProps = useCategoryContent({
42
- // categoryId,
43
- // data,
44
- // pageSize
45
- // });
46
-
47
- // const {
48
- // availableSortMethods,
49
- // categoryName,
50
- // categoryDescription,
51
- // filters,
52
- // items,
53
- // children,
54
- // parent,
55
- // totalCount,
56
- // totalPagesFromData,
57
- // attributesBlock,
58
- // category,
59
- // } = talonProps;
60
30
 
61
31
  const [active, setActive] = useState('all')
62
32
  const [activeTab, setActiveTab] = useState('all');
@@ -72,11 +42,6 @@ const ShowMore = props => {
72
42
 
73
43
  const [currentSort] = sortProps;
74
44
 
75
- // const [sortBy, setSortBy] = useState({
76
- // sortText: 'All (A-Z)',
77
- // value: 'all'
78
- // });
79
-
80
45
 
81
46
  const classes = useStyle(defaultClasses);
82
47
 
@@ -188,13 +153,6 @@ const ShowMore = props => {
188
153
  setSearchQuery('')
189
154
  }
190
155
 
191
- // let availableSortBy = [
192
- // {
193
- // 'label': 'All (A-Z)',
194
- // 'value': 'all'
195
- // }
196
- // ];
197
-
198
156
  let availableSortBy = [
199
157
  {
200
158
  'label': 'All (A-Z)',
@@ -202,7 +160,6 @@ const ShowMore = props => {
202
160
  }
203
161
  ];
204
162
 
205
- // const title = attributeData ? (attributeData.attribute_code == "sc_baseball_parallel" ? "Parallel Sets" : (attributeData.attribute_code == "sc_baseball_inserts" ? "Insert Sets" : attributeData.label)) : "Shop By"
206
163
  const title = pageInfo ? pageInfo.label : '';
207
164
 
208
165
  let availableFilterOption = [];
@@ -318,9 +275,6 @@ const ShowMore = props => {
318
275
 
319
276
  const label = filterArr[0];
320
277
  const optionId = filterArr[1];
321
- if (label == "Singles") {
322
- isSingles = true;
323
- }
324
278
  if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
325
279
  activeFilters.push(
326
280
  {
@@ -338,7 +292,7 @@ const ShowMore = props => {
338
292
  <Fragment>
339
293
  <StoreTitle>{title}</StoreTitle>
340
294
  <Breadcrumbs categoryId={categoryId} customPage={title} currentFilter={activeFilters} />
341
- {category?.url_path.includes('model-railway') && <FilterTop shopby={shopby} filters={[]} category={category} children={[]} allowedFilters={category ? category.allowed_filters : []} />}
295
+ {category?.url_path.includes('model-railway') && <FilterTop shopby={shopby} filters={[]} category={category} children={[]} />}
342
296
  {availableFilterOption.length ?
343
297
  <ul className={classes.nav}>
344
298
  {availableFilterOption.map((filter, index) => (
@@ -20,9 +20,6 @@ const CustomerOrdersFragment = gql`
20
20
  }
21
21
  items {
22
22
  id
23
- is_preorder
24
- pre_order_deposit
25
- pre_order_payment_type
26
23
  product_image_url
27
24
  product_name
28
25
  product_sale_price {
@@ -115,17 +112,6 @@ export const GET_CUSTOMER_ORDERS = gql`
115
112
  ${CustomerOrdersFragment}
116
113
  `;
117
114
 
118
- export const COMPLETE_PREORDER = gql`
119
- mutation CompletePreorder($input: CompletePreorderInput!) {
120
- completePreorder(input: $input) {
121
- cart_id
122
- message
123
- success
124
- }
125
- }
126
- `;
127
-
128
115
  export default {
129
- getCustomerOrdersQuery: GET_CUSTOMER_ORDERS,
130
- completePreorderMutation: COMPLETE_PREORDER
116
+ getCustomerOrdersQuery: GET_CUSTOMER_ORDERS
131
117
  };
@@ -44,14 +44,3 @@ export default {
44
44
  getProductThumbnailsQuery: GET_PRODUCT_THUMBNAILS,
45
45
  getConfigurableThumbnailSource: GET_CONFIGURABLE_THUMBNAIL_SOURCE
46
46
  };
47
-
48
- // Mutation to complete preorder
49
- export const COMPLETE_PREORDER = gql`
50
- mutation CompletePreorder($input: CompletePreorderInput!) {
51
- completePreorder(input: $input) {
52
- cart_id
53
- message
54
- success
55
- }
56
- }
57
- `;
@@ -0,0 +1,89 @@
1
+ import { gql } from '@apollo/client';
2
+
3
+ const GET_PRODUCT_REVIEW_RATINGS_METADATA = gql`
4
+ query getProductReviewRatingsMetadata {
5
+ productReviewRatingsMetadata {
6
+ items {
7
+ id
8
+ name
9
+ values {
10
+ value
11
+ value_id
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `;
17
+
18
+ const CREATE_PRODUCT_REVIEW = gql`
19
+ mutation CreateProductReview($input: CreateProductReviewInput!) {
20
+ createProductReview(input: $input) {
21
+ review {
22
+ average_rating
23
+ created_at
24
+ nickname
25
+ product {
26
+ uuid: uid
27
+ uid
28
+ name
29
+ sku
30
+ }
31
+ ratings_breakdown {
32
+ name
33
+ value
34
+ }
35
+ summary
36
+ text
37
+ }
38
+ }
39
+ }
40
+ `;
41
+
42
+ const GET_PRODUCT_REVIEWS = gql`
43
+ query getProductReviews($url_key: String) {
44
+ products(
45
+ filter: { url_key: { eq: $url_key } }
46
+ pageSize: 20
47
+ currentPage: 1
48
+ ) {
49
+ items {
50
+ uid
51
+ rating_summary
52
+ review_count
53
+ reviews(pageSize: 20, currentPage: 1){
54
+ items {
55
+ average_rating
56
+ created_at
57
+ nickname
58
+ summary
59
+ text
60
+ product {
61
+ uid
62
+ name
63
+ sku
64
+ }
65
+ ratings_breakdown {
66
+ name
67
+ value
68
+ }
69
+ }
70
+ page_info {
71
+ total_pages
72
+ current_page
73
+ page_size
74
+ }
75
+ }
76
+ }
77
+ page_info {
78
+ total_pages
79
+ current_page
80
+ }
81
+ }
82
+ }
83
+ `;
84
+
85
+ export default {
86
+ getProductReviews: GET_PRODUCT_REVIEWS,
87
+ createProductReview: CREATE_PRODUCT_REVIEW,
88
+ getProductReviewRatingsMetadata: GET_PRODUCT_REVIEW_RATINGS_METADATA
89
+ };