@riosst100/pwa-marketplace 1.3.2 → 1.3.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 (165) hide show
  1. package/.github/workflows/dependabot.yml +28 -28
  2. package/package.json +18 -18
  3. package/src/componentOverrideMapping.js +14 -0
  4. package/src/components/BecomeSellerLink/becomeSellerLink.js +1 -1
  5. package/src/components/BecomeSellerLink/becomeSellerLink.module.css +0 -4
  6. package/src/components/CurrencySwitcher/currencySwitcher.himmer.js +6 -0
  7. package/src/components/CurrencySwitcher/currencySwitcher.module.css +102 -0
  8. package/src/components/CurrencySwitcher/index.js +107 -0
  9. package/src/components/CurrencySwitcher/switcherItem.js +47 -0
  10. package/src/components/CurrencySwitcher/switcherItem.module.css +20 -0
  11. package/src/components/FilterOption/FilterOptionModal.module.css +90 -0
  12. package/src/components/FilterOption/filterOptionModal.js +48 -0
  13. package/src/components/FilterOptionModal/filterOptionModal.js +66 -0
  14. package/src/components/Header/becomeSellerLink.module.css +0 -4
  15. package/src/components/Header/websiteSwitcher.js +0 -1
  16. package/src/components/Header/websiteSwitcher.module.css +107 -111
  17. package/src/components/WebsiteSwitcher/websiteSwitcher.js +18 -6
  18. package/src/components/WebsiteSwitcher/websiteSwitcher.module.css +107 -111
  19. package/src/overwrites/peregrine/lib/talons/FilterModal/useFilterList.js +62 -0
  20. package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenuItem.js +66 -0
  21. package/src/overwrites/peregrine/lib/talons/MegaMenu/useSubMenu.js +20 -0
  22. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +0 -2
  23. package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/index.js +1 -0
  24. package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +77 -0
  25. package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.module.css +39 -0
  26. package/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound/noProductsFound.png +0 -0
  27. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.gql.js +17 -0
  28. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +91 -0
  29. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.module.css +77 -0
  30. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +12 -14
  31. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.shimmer.js +74 -0
  32. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/001.jpg +0 -0
  33. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/002.jpg +0 -0
  34. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/003.jpg +0 -0
  35. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/004.jpg +0 -0
  36. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/005.jpg +0 -0
  37. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/006.jpg +0 -0
  38. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/007.jpg +0 -0
  39. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/008.jpg +0 -0
  40. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/009.jpg +0 -0
  41. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/010.jpg +0 -0
  42. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/011.jpg +0 -0
  43. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/012.jpg +0 -0
  44. package/src/overwrites/venia-ui/lib/RootComponents/Category/images/index.js +12 -0
  45. package/src/overwrites/venia-ui/lib/RootComponents/Category/index.js +6 -0
  46. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +112 -0
  47. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +32 -0
  48. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.shimmer.js +24 -0
  49. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/index.js +2 -0
  50. package/src/overwrites/venia-ui/lib/components/Checkbox/checkbox.js +78 -0
  51. package/src/overwrites/venia-ui/lib/components/Checkbox/checkbox.module.css +73 -0
  52. package/src/overwrites/venia-ui/lib/components/Checkbox/index.js +1 -0
  53. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.js +60 -0
  54. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.module.css +21 -0
  55. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +65 -0
  56. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.module.css +17 -0
  57. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/index.js +1 -0
  58. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterDefault.js +18 -18
  59. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterDefault.module.css +0 -0
  60. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItem.js +79 -0
  61. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadio.js +76 -0
  62. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadio.module.css +0 -0
  63. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadioGroup.js +86 -0
  64. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterList.js +265 -0
  65. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterList.module.css +20 -0
  66. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/index.js +1 -0
  67. package/src/overwrites/venia-ui/lib/components/FilterModal/filterBlock.js +135 -0
  68. package/src/overwrites/venia-ui/lib/components/FilterModal/filterBlock.module.css +25 -0
  69. package/src/overwrites/venia-ui/lib/components/FilterModal/filterFooter.js +49 -0
  70. package/src/overwrites/venia-ui/lib/components/FilterModal/filterFooter.module.css +10 -0
  71. package/src/overwrites/venia-ui/lib/components/FilterModal/filterModal.js +166 -0
  72. package/src/overwrites/venia-ui/lib/components/FilterModal/filterModal.module.css +87 -0
  73. package/src/overwrites/venia-ui/lib/components/FilterModal/filterSearch.module.css +3 -0
  74. package/src/overwrites/venia-ui/lib/components/FilterModal/index.js +1 -0
  75. package/src/overwrites/venia-ui/lib/components/FilterSidebar/__tests__/filterSidebar.spec.js +246 -0
  76. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +10 -10
  77. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.module.css +57 -0
  78. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.shimmer.js +24 -0
  79. package/src/overwrites/venia-ui/lib/components/FilterSidebar/index.js +2 -0
  80. package/src/overwrites/venia-ui/lib/components/Gallery/addToCartButton.js +116 -0
  81. package/src/overwrites/venia-ui/lib/components/Gallery/addToCartButton.module.css +38 -0
  82. package/src/overwrites/venia-ui/lib/components/Gallery/gallery.js +56 -0
  83. package/src/overwrites/venia-ui/lib/components/Gallery/gallery.module.css +28 -0
  84. package/src/overwrites/venia-ui/lib/components/Gallery/gallery.shimmer.js +39 -0
  85. package/src/overwrites/venia-ui/lib/components/Gallery/index.js +3 -0
  86. package/src/overwrites/venia-ui/lib/components/Gallery/item.js +204 -0
  87. package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +109 -0
  88. package/src/overwrites/venia-ui/lib/components/Gallery/item.shimmer.js +38 -0
  89. package/src/overwrites/venia-ui/lib/components/Gallery/star.js +12 -0
  90. package/src/overwrites/venia-ui/lib/components/Header/accountTrigger.js +98 -0
  91. package/src/overwrites/venia-ui/lib/components/Header/cartTrigger.js +116 -0
  92. package/src/overwrites/venia-ui/lib/components/Header/header.js +12 -9
  93. package/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.js +22 -8
  94. package/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.module.css +107 -0
  95. package/src/overwrites/venia-ui/lib/components/Header/wishlistTrigger.js +23 -0
  96. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +1 -1
  97. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +0 -1
  98. package/src/overwrites/venia-ui/lib/components/Pagination/index.js +1 -0
  99. package/src/overwrites/venia-ui/lib/components/Pagination/navButton.js +65 -0
  100. package/src/overwrites/venia-ui/lib/components/Pagination/pagination.js +107 -0
  101. package/src/overwrites/venia-ui/lib/components/Pagination/tile.js +41 -0
  102. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.js +74 -0
  103. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.module.css +9 -0
  104. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/index.js +1 -0
  105. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.js +82 -0
  106. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.module.css +9 -0
  107. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/index.js +1 -0
  108. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.js +85 -0
  109. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.module.css +9 -0
  110. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/index.js +1 -0
  111. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/index.js +1 -0
  112. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +104 -0
  113. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +22 -0
  114. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/index.js +1 -0
  115. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.js +74 -0
  116. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.module.css +9 -0
  117. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/index.js +1 -0
  118. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.js +99 -0
  119. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +13 -0
  120. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/index.js +1 -0
  121. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.js +88 -0
  122. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +13 -0
  123. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/index.js +1 -0
  124. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +94 -0
  125. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.module.css +13 -0
  126. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +67 -0
  127. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/AttributeType/index.js +1 -0
  128. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +64 -0
  129. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +9 -0
  130. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/CustomAttributes/index.js +1 -0
  131. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/index.js +1 -0
  132. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.gql.js +7 -0
  133. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +413 -0
  134. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.module.css +203 -0
  135. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.js +180 -0
  136. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.module.css +102 -0
  137. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.shimmer.js +51 -0
  138. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.shimmer.module.css +7 -0
  139. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/index.js +1 -0
  140. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/thumbnail.js +108 -0
  141. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/thumbnail.module.css +47 -0
  142. package/src/overwrites/venia-ui/lib/components/ProductSort/index.js +2 -0
  143. package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.js +233 -0
  144. package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.module.css +65 -0
  145. package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.shimmer.js +28 -0
  146. package/src/overwrites/venia-ui/lib/components/ProductSort/productSort.shimmer.module.css +10 -0
  147. package/src/overwrites/venia-ui/lib/components/ProductSort/sortItem.js +57 -0
  148. package/src/overwrites/venia-ui/lib/components/ProductSort/sortItem.module.css +23 -0
  149. package/src/overwrites/venia-ui/lib/components/QuantityStepper/index.js +1 -0
  150. package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.js +94 -0
  151. package/src/overwrites/venia-ui/lib/components/QuantityStepper/quantityStepper.module.css +78 -0
  152. package/src/overwrites/venia-ui/lib/components/RichContent/index.js +1 -0
  153. package/src/overwrites/venia-ui/lib/components/RichContent/plainHtmlRenderer.js +17 -0
  154. package/src/overwrites/venia-ui/lib/components/RichContent/richContent.js +59 -0
  155. package/src/overwrites/venia-ui/lib/components/RichContent/richContent.module.css +146 -0
  156. package/src/overwrites/venia-ui/lib/components/RichContent/richContentRenderers.js +7 -0
  157. package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.module.css +1 -2
  158. package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +3 -2
  159. package/src/overwrites/venia-ui/lib/components/TextInput/field.module.css +50 -0
  160. package/src/overwrites/venia-ui/lib/components/TextInput/index.js +1 -0
  161. package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +48 -0
  162. package/src/overwrites/venia-ui/lib/components/TextInput/textInput.module.css +21 -0
  163. package/src/talons/FilterOption/useFilterOptionModal.js +11 -0
  164. package/src/talons/FilterOptionModal/useFilterOptionModal.js +11 -0
  165. package/src/theme/vars.js +12 -0
@@ -0,0 +1,77 @@
1
+ import React, { useMemo } from 'react';
2
+ import { number, string, shape } from 'prop-types';
3
+ import { FormattedMessage, useIntl } from 'react-intl';
4
+ import { Link } from 'react-router-dom';
5
+ import { useNoProductsFound } from '@magento/peregrine/lib/talons/RootComponents/Category';
6
+ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
7
+
8
+ import Image from '@magento/venia-ui/lib/components/Image';
9
+ import { useStyle } from '@magento/venia-ui/lib/classify';
10
+ import noProductsFound from './noProductsFound.png';
11
+ import defaultClasses from './noProductsFound.module.css';
12
+
13
+ const NoProductsFound = props => {
14
+ const { categoryId } = props;
15
+ const classes = useStyle(defaultClasses, props.classes);
16
+
17
+ const { formatMessage } = useIntl();
18
+ const talonProps = useNoProductsFound({
19
+ categoryId
20
+ });
21
+
22
+ const { recommendedCategories } = talonProps;
23
+
24
+ const categoryItems = useMemo(() => {
25
+ return recommendedCategories.map(category => {
26
+ const uri = resourceUrl(
27
+ `/${category.url_path}${category.url_suffix}`
28
+ );
29
+
30
+ return (
31
+ <li key={category.uid} className={classes.listItem}>
32
+ <Link to={uri}>{category.name}</Link>
33
+ </li>
34
+ );
35
+ });
36
+ }, [classes, recommendedCategories]);
37
+
38
+ const headerText = formatMessage({
39
+ id: 'noProductsFound.noProductsFound',
40
+ defaultMessage: "Sorry! We couldn't find any products."
41
+ });
42
+
43
+ return (
44
+ <div className={classes.root} data-cy="NoProductsFound-root">
45
+ <Image
46
+ alt={headerText}
47
+ classes={{ image: classes.image, root: classes.imageContainer }}
48
+ src={noProductsFound}
49
+ />
50
+ <h2 className={classes.title}>{headerText}</h2>
51
+ <div className={classes.categories}>
52
+ <p>
53
+ <FormattedMessage
54
+ id={'noProductsFound.tryOneOfTheseCategories'}
55
+ defaultMessage={'Try one of these categories'}
56
+ />
57
+ </p>
58
+ <ul className={classes.list}>{categoryItems}</ul>
59
+ </div>
60
+ </div>
61
+ );
62
+ };
63
+
64
+ export default NoProductsFound;
65
+
66
+ NoProductsFound.propTypes = {
67
+ categoryId: number,
68
+ classes: shape({
69
+ root: string,
70
+ title: string,
71
+ list: string,
72
+ categories: string,
73
+ listItem: string,
74
+ image: string,
75
+ imageContainer: string
76
+ })
77
+ };
@@ -0,0 +1,39 @@
1
+ .root {
2
+ composes: flex from global;
3
+ composes: flex-col from global;
4
+ composes: h-screen from global;
5
+ composes: items-center from global;
6
+ composes: justify-center from global;
7
+ }
8
+
9
+ .title {
10
+ composes: font-semibold from global;
11
+ composes: text-colorDefault from global;
12
+ composes: text-center from global;
13
+ }
14
+
15
+ .categories {
16
+ composes: mt-md from global;
17
+ }
18
+
19
+ .list {
20
+ composes: mt-xs from global;
21
+ }
22
+
23
+ .listItem {
24
+ composes: mb-2xs from global;
25
+ composes: text-center from global;
26
+ composes: underline from global;
27
+
28
+ composes: last_mb-0 from global;
29
+ }
30
+
31
+ .imageContainer {
32
+ composes: mb-md from global;
33
+ }
34
+
35
+ .image {
36
+ composes: h-[200px] from global;
37
+ composes: max-w-[200px] from global;
38
+ composes: w-[200px] from global;
39
+ }
@@ -0,0 +1,17 @@
1
+ import { gql } from '@apollo/client';
2
+
3
+ export const GET_PAGE_SIZE = gql`
4
+ query getPageSize {
5
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
6
+ storeConfig {
7
+ store_code
8
+ grid_per_page
9
+ }
10
+ }
11
+ `;
12
+
13
+ export default {
14
+ queries: {
15
+ getPageSize: GET_PAGE_SIZE
16
+ }
17
+ };
@@ -0,0 +1,91 @@
1
+ import React, { Fragment } from 'react';
2
+ import { shape, string } from 'prop-types';
3
+ import { useCategory } from '@magento/peregrine/lib/talons/RootComponents/Category';
4
+ import { useStyle } from '@magento/venia-ui/lib/classify';
5
+
6
+ import CategoryContent from './categoryContent';
7
+ import defaultClasses from './category.module.css';
8
+ import { Meta } from '@magento/venia-ui/lib/components/Head';
9
+ import { GET_PAGE_SIZE } from './category.gql';
10
+ import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
11
+ import { useIntl } from 'react-intl';
12
+
13
+ const MESSAGES = new Map().set(
14
+ 'NOT_FOUND',
15
+ "Looks like the category you were hoping to find doesn't exist. Sorry about that."
16
+ );
17
+
18
+ const Category = props => {
19
+ const { uid } = props;
20
+ const { formatMessage } = useIntl();
21
+
22
+ const talonProps = useCategory({
23
+ id: uid,
24
+ queries: {
25
+ getPageSize: GET_PAGE_SIZE
26
+ }
27
+ });
28
+
29
+ const {
30
+ error,
31
+ metaDescription,
32
+ loading,
33
+ categoryData,
34
+ pageControl,
35
+ sortProps,
36
+ pageSize,
37
+ categoryNotFound
38
+ } = talonProps;
39
+
40
+ const classes = useStyle(defaultClasses, props.classes);
41
+
42
+ if (!categoryData) {
43
+ if (error && pageControl.currentPage === 1) {
44
+ if (process.env.NODE_ENV !== 'production') {
45
+ console.error(error);
46
+ }
47
+
48
+ return <ErrorView />;
49
+ }
50
+ }
51
+ if (categoryNotFound) {
52
+ return (
53
+ <ErrorView
54
+ message={formatMessage({
55
+ id: 'category.notFound',
56
+ defaultMessage: MESSAGES.get('NOT_FOUND')
57
+ })}
58
+ />
59
+ );
60
+ }
61
+
62
+ return (
63
+ <Fragment>
64
+ <Meta name="description" content={metaDescription} />
65
+ <CategoryContent
66
+ categoryId={uid}
67
+ classes={classes}
68
+ data={categoryData}
69
+ isLoading={loading}
70
+ pageControl={pageControl}
71
+ sortProps={sortProps}
72
+ pageSize={pageSize}
73
+ />
74
+ </Fragment>
75
+ );
76
+ };
77
+
78
+ Category.propTypes = {
79
+ classes: shape({
80
+ gallery: string,
81
+ root: string,
82
+ title: string
83
+ }),
84
+ uid: string
85
+ };
86
+
87
+ Category.defaultProps = {
88
+ uid: 'Mg=='
89
+ };
90
+
91
+ export default Category;
@@ -0,0 +1,77 @@
1
+ .root {
2
+ composes: p-0 from global;
3
+ }
4
+
5
+ .title {
6
+ composes: font-semibold from global;
7
+ composes: text-[24px] from global;
8
+ composes: leading-[24px] from global;
9
+ padding: 20px 0px 20px;
10
+ }
11
+
12
+ .pagination {
13
+ composes: relative from global;
14
+ composes: bottom-0 from global;
15
+ }
16
+
17
+ .placeholder {
18
+ composes: h-screen from global;
19
+ }
20
+
21
+ .categoryTitle {
22
+ composes: font-semibold from global;
23
+ }
24
+
25
+ .heading {
26
+ composes: flex from global;
27
+ composes: flex-wrap from global;
28
+ composes: justify-center from global;
29
+ composes: pb-2xs from global;
30
+
31
+ composes: lg_flex-nowrap from global;
32
+ composes: lg_items-center from global;
33
+ composes: lg_justify-between from global;
34
+ composes: lg_pb-[30px] from global;
35
+ composes: lg_w-full from global;
36
+ }
37
+
38
+ .categoryContent {
39
+ composes: lg_flex-grow from global;
40
+ }
41
+
42
+ .categoryInfo {
43
+ flex-basis: 100%;
44
+ composes: leading-tight from global;
45
+ composes: max-w-[75vw] from global;
46
+ composes: mx-0 from global;
47
+ composes: my-xs from global;
48
+ composes: text-center from global;
49
+ composes: text-[14px] from global;
50
+ composes: lg_m-0 from global;
51
+ composes: lg_text-left from global;
52
+ }
53
+
54
+ .headerButtons {
55
+ composes: flex from global;
56
+ composes: justify-center from global;
57
+ composes: pb-sm from global;
58
+ flex-basis: 100%;
59
+
60
+ composes: lg_justify-end from global;
61
+ composes: lg_pb-0 from global;
62
+ }
63
+
64
+ .contentWrapper {
65
+ composes: w-full from global;
66
+ composes: lg_mt-[50px] from global;
67
+ composes: lg_flex from global;
68
+ composes: gap-[30px] from global;
69
+ }
70
+
71
+ .sidebar {
72
+ composes: hidden from global;
73
+
74
+ composes: lg_flex from global;
75
+ composes: lg_self-start from global;
76
+ width: 500px;
77
+ }
@@ -6,23 +6,23 @@ import { useIsInViewport } from '@magento/peregrine/lib/hooks/useIsInViewport';
6
6
  import { useCategoryContent } from '@magento/peregrine/lib/talons/RootComponents/Category';
7
7
 
8
8
  import { useStyle } from '@magento/venia-ui/lib/classify';
9
- import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs';
9
+ import Breadcrumbs from '../../components/Breadcrumbs';
10
10
  import FilterModalOpenButton, {
11
11
  FilterModalOpenButtonShimmer
12
12
  } from '@magento/venia-ui/lib/components/FilterModalOpenButton';
13
13
  import { FilterSidebarShimmer } from '@magento/venia-ui/lib/components/FilterSidebar';
14
14
  import Gallery, { GalleryShimmer } from '@magento/venia-ui/lib/components/Gallery';
15
15
  import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
16
- import Pagination from '@magento/venia-ui/lib/components/Pagination';
17
- import ProductSort, { ProductSortShimmer } from '@magento/venia-ui/lib/components/ProductSort';
16
+ import Pagination from '../../components/Pagination';
17
+ import ProductSort, { ProductSortShimmer } from '../../components/ProductSort';
18
18
  import RichContent from '@magento/venia-ui/lib/components/RichContent';
19
19
  import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
20
20
  import SortedByContainer, {
21
21
  SortedByContainerShimmer
22
22
  } from '@magento/venia-ui/lib/components/SortedByContainer';
23
- import defaultClasses from '@magento/venia-ui/lib/RootComponents/Category/category.module.css';
24
- import NoProductsFound from '@magento/venia-ui/lib/RootComponents/Category/NoProductsFound';
25
- import SubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/subCategory';
23
+ import defaultClasses from './category.module.css';
24
+ import NoProductsFound from './NoProductsFound';
25
+ import cn from 'classnames';
26
26
 
27
27
  const FilterModal = React.lazy(() => import('@magento/venia-ui/lib/components/FilterModal'));
28
28
  const FilterSidebar = React.lazy(() =>
@@ -53,9 +53,7 @@ const CategoryContent = props => {
53
53
  filters,
54
54
  items,
55
55
  totalCount,
56
- totalPagesFromData,
57
- children,
58
- parent
56
+ totalPagesFromData
59
57
  } = talonProps;
60
58
 
61
59
  const sidebarRef = useRef(null);
@@ -82,7 +80,7 @@ const CategoryContent = props => {
82
80
  ) : null;
83
81
 
84
82
  const sidebar = shouldShowFilterButtons ? (
85
- <FilterSidebar filters={filters} categoryName={categoryName} children={children} parent={parent} />
83
+ <FilterSidebar filters={filters} />
86
84
  ) : shouldShowFilterShimmer ? (
87
85
  <FilterSidebarShimmer />
88
86
  ) : null;
@@ -155,17 +153,17 @@ const CategoryContent = props => {
155
153
  return (
156
154
  <Fragment>
157
155
  <Breadcrumbs categoryId={categoryId} />
158
- <SubCategory children={children} />
156
+ {/* <SubCategory children={children} /> */}
159
157
  <StoreTitle>{categoryName}</StoreTitle>
160
158
  <article className={classes.root} data-cy="CategoryContent-root">
161
159
  <div className={classes.categoryHeader}>
162
160
  <h1 aria-live="polite" className={classes.title}>
163
- <div
161
+ <span
164
162
  className={classes.categoryTitle}
165
163
  data-cy="CategoryContent-categoryTitle"
166
164
  >
167
165
  {categoryTitle}
168
- </div>
166
+ </span>
169
167
  </h1>
170
168
  {categoryDescriptionElement}
171
169
  </div>
@@ -176,7 +174,7 @@ const CategoryContent = props => {
176
174
  </Suspense>
177
175
  </div>
178
176
  <div className={classes.categoryContent}>
179
- <div className={classes.heading}>
177
+ <div className={cn(classes.heading)}>
180
178
  <div
181
179
  data-cy="CategoryContent-categoryInfo"
182
180
  className={classes.categoryInfo}
@@ -0,0 +1,74 @@
1
+ import React, { Fragment } from 'react';
2
+ import { shape, string } from 'prop-types';
3
+
4
+ import { useStyle } from '@magento/venia-ui/lib/classify';
5
+ import BreadcrumbsShimmer from '../../components/Breadcrumbs/breadcrumbs.shimmer';
6
+ import { FilterModalOpenButtonShimmer } from '@magento/venia-ui/lib/components/FilterModalOpenButton';
7
+ import { FilterSidebarShimmer } from '@magento/venia-ui/lib/components/FilterSidebar';
8
+ import { GalleryShimmer } from '@magento/venia-ui/lib/components/Gallery';
9
+ import { ProductSortShimmer } from '../../components/ProductSort';
10
+ import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
11
+ import { SortedByContainerShimmer } from '@magento/venia-ui/lib/components/SortedByContainer';
12
+ import defaultClasses from './category.module.css';
13
+
14
+ const CategoryContentShimmer = props => {
15
+ const classes = useStyle(defaultClasses, props.classes);
16
+
17
+ const placeholderItems = Array.from({ length: 6 }).fill(null);
18
+
19
+ return (
20
+ <Fragment>
21
+ <BreadcrumbsShimmer />
22
+ <article className={classes.root}>
23
+ <div className={classes.categoryHeader}>
24
+ <h1 className={classes.title}>
25
+ <div className={classes.categoryTitle}>
26
+ <Shimmer width={5} />
27
+ </div>
28
+ </h1>
29
+ </div>
30
+ <div className={classes.contentWrapper}>
31
+ <div className={classes.sidebar}>
32
+ <FilterSidebarShimmer />
33
+ </div>
34
+ <div className={classes.categoryContent}>
35
+ <div className={classes.heading}>
36
+ <div className={classes.categoryInfo}>
37
+ <Shimmer width={5} />
38
+ </div>
39
+ <div className={classes.headerButtons}>
40
+ <FilterModalOpenButtonShimmer />
41
+ <ProductSortShimmer />
42
+ </div>
43
+ <SortedByContainerShimmer />
44
+ </div>
45
+ <section className={classes.gallery}>
46
+ <GalleryShimmer items={placeholderItems} />
47
+ </section>
48
+ </div>
49
+ </div>
50
+ </article>
51
+ </Fragment>
52
+ );
53
+ };
54
+
55
+ CategoryContentShimmer.defaultProps = {
56
+ classes: {}
57
+ };
58
+
59
+ CategoryContentShimmer.propTypes = {
60
+ classes: shape({
61
+ root: string,
62
+ categoryHeader: string,
63
+ title: string,
64
+ categoryTitle: string,
65
+ sidebar: string,
66
+ categoryContent: string,
67
+ heading: string,
68
+ categoryInfo: string,
69
+ headerButtons: string,
70
+ gallery: string
71
+ })
72
+ };
73
+
74
+ export default CategoryContentShimmer;
@@ -0,0 +1,12 @@
1
+ export { default as image001 } from './001.jpg';
2
+ export { default as image002 } from './002.jpg';
3
+ export { default as image003 } from './003.jpg';
4
+ export { default as image004 } from './004.jpg';
5
+ export { default as image005 } from './005.jpg';
6
+ export { default as image006 } from './006.jpg';
7
+ export { default as image007 } from './007.jpg';
8
+ export { default as image008 } from './008.jpg';
9
+ export { default as image009 } from './009.jpg';
10
+ export { default as image010 } from './010.jpg';
11
+ export { default as image011 } from './011.jpg';
12
+ export { default as image012 } from './012.jpg';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @RootComponent
3
+ * description = 'Basic Category Page'
4
+ * pageTypes = CATEGORY
5
+ */
6
+ export { default } from './category';
@@ -0,0 +1,112 @@
1
+ import React, { Fragment, useMemo } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import { string } from 'prop-types';
4
+ import { Link } from 'react-router-dom';
5
+
6
+ import { useBreadcrumbs } from '@magento/peregrine/lib/talons/Breadcrumbs/useBreadcrumbs';
7
+ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
8
+ import { useStyle } from '@magento/venia-ui/lib/classify';
9
+ import Shimmer from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.shimmer';
10
+ import defaultClasses from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css';
11
+ import { ArrowRight2 } from 'iconsax-react';
12
+ import cn from 'classnames';
13
+
14
+
15
+ /**
16
+ * Breadcrumbs! Generates a sorted display of category links.
17
+ *
18
+ * @param {String} props.categoryId the uid of the category for which to generate breadcrumbs
19
+ * @param {String} props.currentProduct the name of the product we're currently on, if any.
20
+ */
21
+ const Breadcrumbs = props => {
22
+ const classes = useStyle(defaultClasses, props.classes);
23
+
24
+ const { categoryId, currentProduct } = props;
25
+
26
+ const talonProps = useBreadcrumbs({ categoryId });
27
+
28
+ const DELIMITER = <ArrowRight2 size={13} className='inline-flex text-gray-200' />
29
+
30
+ const {
31
+ currentCategory,
32
+ currentCategoryPath,
33
+ hasError,
34
+ isLoading,
35
+ normalizedData,
36
+ handleClick
37
+ } = talonProps;
38
+
39
+ // For all links generate a fragment like "/ Text"
40
+ const links = useMemo(() => {
41
+ return normalizedData.map(({ text, path }) => {
42
+ return (
43
+ <Fragment key={text}>
44
+ <span className={classes.divider}>{DELIMITER}</span>
45
+ <Link
46
+ className={classes.link}
47
+ to={resourceUrl(path)}
48
+ onClick={handleClick}
49
+ >
50
+ {text}
51
+ </Link>
52
+ </Fragment>
53
+ );
54
+ });
55
+ }, [classes.divider, classes.link, handleClick, normalizedData]);
56
+
57
+ if (isLoading) {
58
+ return <Shimmer />;
59
+ }
60
+
61
+ // Don't display anything but the empty, static height div when there's an error.
62
+ if (hasError) {
63
+ return (
64
+ <div
65
+ className={classes.root}
66
+ aria-live="polite"
67
+ aria-busy="false"
68
+ />
69
+ );
70
+ }
71
+
72
+ // If we have a "currentProduct" it means we're on a PDP so we want the last
73
+ // category text to be a link. If we don't have a "currentProduct" we're on
74
+ // a category page so it should be regular text.
75
+ const currentCategoryLink = currentProduct ? (
76
+ <Link
77
+ className={classes.link}
78
+ to={resourceUrl(currentCategoryPath)}
79
+ onClick={handleClick}
80
+ >
81
+ {currentCategory}
82
+ </Link>
83
+ ) : (
84
+ <span className={cn(classes.currentCategory, 'text-blue-700 font-medium')}>{currentCategory}</span>
85
+ );
86
+
87
+ const currentProductNode = currentProduct ? (
88
+ <Fragment>
89
+ <span className={classes.divider}>{DELIMITER}</span>
90
+ <span className={classes.text}>{currentProduct}</span>
91
+ </Fragment>
92
+ ) : null;
93
+
94
+ return (
95
+ <div className={classes.root} aria-live="polite" aria-busy="false">
96
+ <Link className={classes.link} to="/">
97
+ <FormattedMessage id={'global.home'} defaultMessage={'Home'} />
98
+ </Link>
99
+ {links}
100
+ <span className={classes.divider}>{DELIMITER}</span>
101
+ {currentCategoryLink}
102
+ {currentProductNode}
103
+ </div>
104
+ );
105
+ };
106
+
107
+ export default Breadcrumbs;
108
+
109
+ Breadcrumbs.propTypes = {
110
+ categoryId: string.isRequired,
111
+ currentProduct: string
112
+ };
@@ -0,0 +1,32 @@
1
+ .root {
2
+ /* Permanent height to prevent pop-in. */
3
+ /* Show ellipses when overflowing. */
4
+ composes: flex from global;
5
+ composes: items-center from global;
6
+ composes: gap-[6px] from global;
7
+ composes: my-[30px] from global;
8
+ padding-top: 20px;
9
+ }
10
+
11
+ .text {
12
+ composes: text-[13px] from global;
13
+ composes: leading-[13px] from global;
14
+ composes: text-blue-700 from global;
15
+ composes: font-medium from global;
16
+ }
17
+
18
+ .divider {
19
+ composes: text-[13px] from global;
20
+ composes: leading-[13px] from global;
21
+ }
22
+
23
+ .link {
24
+ composes: text-[13px] from global;
25
+ composes: leading-[13px] from global;
26
+ composes: text-gray-200 from global;
27
+ }
28
+
29
+ .currentCategory {
30
+ composes: text-[13px] from global;
31
+ composes: leading-[13px] from global;
32
+ }