@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,153 @@
1
+ import React, { Fragment } from 'react';
2
+ import { FormattedMessage, useIntl } from 'react-intl';
3
+ import { useProductForm } from '@magento/peregrine/lib/talons/CartPage/ProductListing/EditModal/useProductForm';
4
+
5
+ import { useStyle } from '@magento/venia-ui/lib/classify';
6
+ import FormError from '@magento/venia-ui/lib/components/FormError';
7
+ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
8
+ import Options from '@magento/venia-ui/lib/components/ProductOptions';
9
+ import QuantityStepper from '@magento/venia-ui/lib/components/QuantityStepper';
10
+ import defaultClasses from './productForm.module.css';
11
+ import Dialog from '@magento/venia-ui/lib/components/Dialog';
12
+ import ProductDetail from './productDetail';
13
+
14
+ const ProductForm = props => {
15
+ const {
16
+ item: cartItem,
17
+ setIsCartUpdating,
18
+ variantPrice,
19
+ setVariantPrice,
20
+ setActiveEditItem
21
+ } = props;
22
+ const { formatMessage } = useIntl();
23
+ const talonProps = useProductForm({
24
+ cartItem,
25
+ setIsCartUpdating,
26
+ setVariantPrice,
27
+ setActiveEditItem
28
+ });
29
+ const {
30
+ configItem,
31
+ errors,
32
+ handleOptionSelection,
33
+ handleSubmit,
34
+ outOfStockVariants,
35
+ isLoading,
36
+ isSaving,
37
+ isDialogOpen,
38
+ handleClose,
39
+ configurableThumbnailSource
40
+ } = talonProps;
41
+
42
+ const classes = useStyle(defaultClasses, props.classes);
43
+ const dialogButtonsDisabled = isLoading;
44
+ const dialogSubmitButtonDisabled = isSaving;
45
+ const dialogFormProps = {
46
+ initialValues: cartItem
47
+ };
48
+
49
+ const message = isLoading
50
+ ? formatMessage({
51
+ id: 'productForm.fetchingProductOptions',
52
+ defaultMessage: 'Fetching Product Options...'
53
+ })
54
+ ? isSaving
55
+ : formatMessage({
56
+ id: 'productForm.updatingCart',
57
+ defaultMessage: 'Updating Cart...'
58
+ })
59
+ : null;
60
+
61
+ const maybeLoadingIndicator =
62
+ isLoading || isSaving ? (
63
+ <LoadingIndicator
64
+ classes={{
65
+ root: classes.loading
66
+ }}
67
+ >
68
+ {message}
69
+ </LoadingIndicator>
70
+ ) : null;
71
+
72
+ if (cartItem && !isLoading && !configItem) {
73
+ return (
74
+ <span className={classes.dataError}>
75
+ <FormattedMessage
76
+ id={'productForm.dataError'}
77
+ defaultMessage={
78
+ 'Something went wrong. Please refresh and try again.'
79
+ }
80
+ />
81
+ </span>
82
+ );
83
+ }
84
+
85
+ const dialogContent =
86
+ cartItem && configItem ? (
87
+ <div>
88
+ <FormError
89
+ classes={{
90
+ root: classes.errorContainer
91
+ }}
92
+ errors={Array.from(errors.values())}
93
+ scrollOnError={false}
94
+ allowErrorMessages={true}
95
+ />
96
+ <ProductDetail
97
+ item={cartItem}
98
+ variantPrice={variantPrice}
99
+ configurableThumbnailSource={configurableThumbnailSource}
100
+ />
101
+ <Options
102
+ classes={{
103
+ root: classes.optionRoot
104
+ }}
105
+ onSelectionChange={handleOptionSelection}
106
+ options={configItem.configurable_options}
107
+ selectedValues={cartItem.configurable_options}
108
+ outOfStockVariants={outOfStockVariants}
109
+ />
110
+ <h3 className={classes.quantityLabel}>
111
+ <FormattedMessage
112
+ id={'productForm.quantity'}
113
+ defaultMessage={'Quantity'}
114
+ />
115
+ </h3>
116
+ <QuantityStepper
117
+ classes={{
118
+ root: classes.quantityRoot
119
+ }}
120
+ initialValue={cartItem.quantity}
121
+ itemId={cartItem.id}
122
+ />
123
+ </div>
124
+ ) : null;
125
+
126
+ return (
127
+ <Fragment>
128
+ <Dialog
129
+ classes={{
130
+ contents: classes.contents
131
+ }}
132
+ confirmText={'Update'}
133
+ confirmTranslationId={'productForm.submit'}
134
+ formProps={dialogFormProps}
135
+ isOpen={isDialogOpen}
136
+ onCancel={handleClose}
137
+ onConfirm={handleSubmit}
138
+ shouldDisableAllButtons={dialogButtonsDisabled}
139
+ shouldDisableConfirmButton={dialogSubmitButtonDisabled}
140
+ shouldUnmountOnHide={false}
141
+ title={formatMessage({
142
+ id: 'editModal.headerText',
143
+ defaultMessage: 'Edit Item'
144
+ })}
145
+ >
146
+ {maybeLoadingIndicator}
147
+ {dialogContent}
148
+ </Dialog>
149
+ </Fragment>
150
+ );
151
+ };
152
+
153
+ export default ProductForm;
@@ -0,0 +1,52 @@
1
+ .contents {
2
+ composes: contents from '@magento/venia-ui/lib/components/Dialog/dialog.module.css';
3
+
4
+ composes: relative from global;
5
+ }
6
+
7
+ .optionRoot {
8
+ composes: border-b from global;
9
+ composes: border-solid from global;
10
+ composes: border-subtle from global;
11
+ composes: px-0 from global;
12
+ composes: py-xs from global;
13
+ }
14
+
15
+ .quantityLabel {
16
+ composes: font-medium from global;
17
+ composes: leading-normal from global;
18
+ composes: mb-sm from global;
19
+ composes: pt-xs from global;
20
+ composes: text-colorDefault from global;
21
+ }
22
+
23
+ .quantityRoot {
24
+ composes: root from '@magento/venia-ui/lib/components/QuantityStepper/quantityStepper.module.css';
25
+ grid-template-columns: auto 4rem auto;
26
+ composes: justify-start from global;
27
+ composes: px-xs from global;
28
+ composes: py-0 from global;
29
+ }
30
+
31
+ .loading {
32
+ composes: root from '@magento/venia-ui/lib/components/LoadingIndicator/indicator.module.css';
33
+
34
+ composes: absolute from global;
35
+ composes: h-unset from global;
36
+ composes: left-0 from global;
37
+ composes: text-center from global;
38
+ composes: top-2/4 from global;
39
+ composes: z-mask from global;
40
+ transform: translateY(-50%);
41
+ }
42
+
43
+ .dataError {
44
+ composes: inline-block from global;
45
+ composes: leading-normal from global;
46
+ composes: pt-xs from global;
47
+ composes: text-error from global;
48
+ }
49
+
50
+ .errorContainer {
51
+ composes: pt-xs from global;
52
+ }
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { shape, string } from 'prop-types';
3
+ import { useStyle } from '@magento/venia-ui/lib/classify';
4
+ import defaultClasses from './errorMessage.module.css';
5
+
6
+ const ErrorMessage = props => {
7
+ const { error } = props;
8
+ const classes = useStyle(defaultClasses, props.classes);
9
+
10
+ if (!error || !error.message) {
11
+ return null;
12
+ }
13
+
14
+ return <div className={classes.root}>{error.message}</div>;
15
+ };
16
+
17
+ ErrorMessage.defaultProps = {
18
+ classes: null,
19
+ error: null
20
+ };
21
+
22
+ ErrorMessage.propTypes = {
23
+ classes: shape({
24
+ root: string
25
+ }),
26
+ error: shape({
27
+ message: string
28
+ })
29
+ };
30
+
31
+ export default ErrorMessage;
@@ -0,0 +1,13 @@
1
+ .root {
2
+ composes: border-l-4 from global;
3
+ composes: border-solid from global;
4
+ composes: border-error from global;
5
+ composes: font-medium from global;
6
+ composes: leading-normal from global;
7
+ composes: mb-xs from global;
8
+ composes: pl-xs from global;
9
+ composes: pr-0 from global;
10
+ composes: py-xs from global;
11
+ composes: text-error from global;
12
+ composes: text-sm from global;
13
+ }
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Form } from 'informed';
3
+ import { func, number, string } from 'prop-types';
4
+ import QuantityStepper from '@magento/venia-ui/lib/components/QuantityStepper';
5
+
6
+ const Quantity = props => {
7
+ return (
8
+ <Form
9
+ initialValues={{
10
+ quantity: props.initialValue
11
+ }}
12
+ >
13
+ <QuantityStepper {...props} />
14
+ </Form>
15
+ );
16
+ };
17
+
18
+ Quantity.propTypes = {
19
+ initialValue: number,
20
+ itemId: string,
21
+ label: string,
22
+ min: number,
23
+ onChange: func,
24
+ message: string
25
+ };
26
+
27
+ Quantity.defaultProps = {
28
+ label: 'Quantity',
29
+ min: 0,
30
+ initialValue: 1,
31
+ onChange: () => { }
32
+ };
33
+
34
+ /**
35
+ * @deprecated - moved to component directory in 12.4.0
36
+ * @see QuantityStepper
37
+ */
38
+ export const QuantityFields = QuantityStepper;
39
+
40
+ export default Quantity;
@@ -21,7 +21,7 @@ const SCROLL_OFFSET = 150;
21
21
  * @param {Object} props.filters - filters to display
22
22
  */
23
23
  const FilterSidebar = props => {
24
- const { filters, filterCountToOpen, allowedFilters, prefixes, hideFilters } = props;
24
+ const { filters, filterCountToOpen, prefixes } = props;
25
25
  const talonProps = useFilterSidebar({ filters });
26
26
  const {
27
27
  filterApi,
@@ -34,10 +34,6 @@ const FilterSidebar = props => {
34
34
  handleReset
35
35
  } = talonProps;
36
36
 
37
- // console.log(filters)
38
- // console.log('filterCountToOpen'+filterCountToOpen)
39
- // console.log('hideFilters'+hideFilters)
40
-
41
37
  const filterRef = useRef();
42
38
  const classes = useStyle(defaultClasses, props.classes);
43
39
 
@@ -85,37 +81,6 @@ const FilterSidebar = props => {
85
81
  [handleApply, filterRef]
86
82
  );
87
83
 
88
- const allowedFiltersArr = [];
89
-
90
- allowedFilters?.length && allowedFilters.map((val, index) => {
91
- allowedFiltersArr.push(val.code);
92
- });
93
-
94
- // const ordering = ['card_artist','card_product_type', 'card_type'];
95
- // const sorted = new Map(
96
- // [...filterItems.entries()].sort((a, b) => {
97
- // const keyA = a[0];
98
- // const keyB = b[0];
99
-
100
- // const matchA = ordering.findIndex(o => keyA.endsWith(o));
101
- // const matchB = ordering.findIndex(o => keyB.endsWith(o));
102
-
103
- // const orderA = matchA === -1 ? Infinity : matchA;
104
- // const orderB = matchB === -1 ? Infinity : matchB;
105
-
106
- // // jika dua-duanya tidak match ordering → sort alphabetis
107
- // if (orderA === Infinity && orderB === Infinity) {
108
- // return keyA.localeCompare(keyB);
109
- // }
110
-
111
- // // urutkan sesuai ordering
112
- // return orderA - orderB;
113
- // })
114
- // );
115
-
116
- // // console.log([...sorted.entries()]);
117
- // const filterItems = [...sorted.entries()];
118
-
119
84
  const removePrefix = (attrCode) => {
120
85
  if (prefixes) {
121
86
  return prefixes.reduce((s, p) =>
@@ -132,61 +97,26 @@ const FilterSidebar = props => {
132
97
  const blockState = filterState.get(group);
133
98
  const groupName = filterNames.get(group);
134
99
  const frontendInput = filterFrontendInput.get(group);
135
-
136
- if (!allowedFiltersArr.length || allowedFiltersArr.length && allowedFiltersArr.includes(removePrefix(group))) {
137
- console.log('removePrefix(group)',removePrefix(group))
138
- // if (!hideFilters.includes(group) && groupName && !group.includes('card_release') && !group.includes('card_set') && !group.includes('sc_set_name')) {
139
-
140
- // if (!allowedFiltersArr?.length && group != "category_uid" || allowedFiltersArr?.length && allowedFiltersArr.includes(group)) {
141
- let subFilter = null;
142
- // if (group.includes('sc_release') || group.includes('card_release')) {
143
- // let subGroup = '';
144
- // if (group.includes('card_release')) {
145
- // subGroup = group.replace('card_release', 'card_set');
146
- // }
147
-
148
- // if (group.includes('sc_release')) {
149
- // subGroup = group.replace('sc_release', 'sc_set_name');
150
- // }
151
-
152
- // const subBlockState = filterState.get(subGroup);
153
- // const subFrontendInput = filterFrontendInput.get(subGroup);
154
- // const subFilterItems = filterItems.get(subGroup);
155
-
156
- // subFilter = {
157
- // key: subGroup,
158
- // filterApi: filterApi,
159
- // filterState: subBlockState,
160
- // filterFrontendInput: subFrontendInput,
161
- // group: subGroup,
162
- // isSubFilter: true,
163
- // items: subFilterItems,
164
- // name: '',
165
- // onApply: handleApplyFilter,
166
- // initialOpen: true
167
- // };
168
-
169
- // }
170
100
 
171
- return (
172
- <FilterBlock
173
- key={group}
174
- filterApi={filterApi}
175
- filterState={blockState}
176
- allowedSubFilters={[]}
177
- filterFrontendInput={frontendInput}
178
- group={group}
179
- subFilterItems={subFilterItems?.subFilters}
180
- filterItems={filterItems}
181
- subFilter={subFilter}
182
- items={items}
183
- name={groupName}
184
- onApply={group == "category_uid" ? handleCategoryApplyFilter : handleApplyFilter}
185
- initialOpen={true}
186
- />
187
- );
188
- // }
189
- }
101
+ let subFilter = null;
102
+
103
+ return (
104
+ <FilterBlock
105
+ key={group}
106
+ filterApi={filterApi}
107
+ filterState={blockState}
108
+ allowedSubFilters={[]}
109
+ filterFrontendInput={frontendInput}
110
+ group={group}
111
+ subFilterItems={subFilterItems?.subFilters}
112
+ filterItems={filterItems}
113
+ subFilter={subFilter}
114
+ items={items}
115
+ name={groupName}
116
+ onApply={group == "category_uid" ? handleCategoryApplyFilter : handleApplyFilter}
117
+ initialOpen={true}
118
+ />
119
+ );
190
120
  }),
191
121
  [
192
122
  filterApi,
@@ -235,14 +165,13 @@ const FilterSidebar = props => {
235
165
  <Filter size={15} className='text-gray-900' />
236
166
  </h2>
237
167
  </div>
238
- {hideFilters ? <ul className={classes.blocks}>No filters available.</ul> : <>
239
168
  <CurrentFilters
240
169
  filterApi={filterApi}
241
170
  filterNames={filterNames}
242
171
  filterState={filterState}
243
172
  onRemove={handleApplyFilter}
244
173
  />
245
- <ul className={classes.blocks}>{filtersList}</ul></>}
174
+ <ul className={classes.blocks}>{filtersList}</ul>
246
175
  </div>
247
176
  </aside>
248
177
  );
@@ -38,7 +38,7 @@ const MegaMenuItem = props => {
38
38
 
39
39
  const classes = useStyle(defaultClasses, props.classes);
40
40
  const categoryUrl = resourceUrl(
41
- `/${category.url_path}${categoryUrlSuffix || ''}`
41
+ `/${category.children.length ? category.children[0].url_path : category.url_path}${categoryUrlSuffix || ''}`
42
42
  );
43
43
 
44
44
  const talonProps = useMegaMenuItem({
@@ -130,7 +130,11 @@ const MegaMenuItem = props => {
130
130
  )}
131
131
  data-cy="MegaMenu-MegaMenuItem-link"
132
132
  to={categoryUrl}
133
- onClick={onNavigate}
133
+ onClick={e => {
134
+ handleClickOutside(e);
135
+ handleCloseSubMenu();
136
+ onNavigate();
137
+ }}
134
138
  >
135
139
  {category.name}
136
140
  {/* {maybeDownArrowIcon} */}
@@ -85,27 +85,6 @@ const Submenu = props => {
85
85
  );
86
86
  });
87
87
 
88
- // const shopByItems2 = [
89
- // {
90
- // name: 'Shop By Franchise',
91
- // items: [
92
- // {
93
- // name: 'Hasbro',
94
- // url: '/'
95
- // }
96
- // ]
97
- // },
98
- // {
99
- // name: 'Shop By Franchise',
100
- // items: [
101
- // {
102
- // name: 'Hasbro',
103
- // url: '/'
104
- // }
105
- // ]
106
- // }
107
- // ];
108
-
109
88
  const shopBy = shopByItems.map((shopBy, index) => {
110
89
  const keyboardProps =
111
90
  index === shopByItems.length - 1 ? talonProps.keyboardProps : {};
@@ -76,6 +76,8 @@ const ReviewModal = (props) => {
76
76
  // if (onSubmit) {
77
77
  // onSubmit({ ...formState, ratings });
78
78
  // }
79
+ console.log('formState',formState)
80
+ console.log('e',e)
79
81
  setSubmitting(true);
80
82
  const input = {
81
83
  nickname: formState.nickname,
@@ -117,18 +119,24 @@ const ReviewModal = (props) => {
117
119
  return { url, label };
118
120
  };
119
121
 
122
+ console.log('ratings',ratings)
123
+
120
124
  const ratingStars = useMemo(() => {
125
+ console.log('ratingsMetadata22',ratingsMetadata)
121
126
  if (!ratingsMetadata) {
122
127
  return '';
123
128
  }
124
129
 
125
130
  // Find value (1-5) for selected value_id
126
131
  const selectedValue = ratings && ratingsMetadata.values.find(v => v.value_id === ratings) || '';
132
+ console.log('selectedValue',selectedValue)
127
133
 
128
134
  let starButtons = [];
129
135
 
130
136
  [1,2,3,4,5].map(star => {
131
137
  const valObj = ratingsMetadata.values.find(v => v.value === String(star));
138
+ console.log('String(star)',String(star))
139
+ console.log('valObj',valObj)
132
140
  if (valObj) {
133
141
  starButtons.push(
134
142
  <button
@@ -26,7 +26,6 @@ import { SearchNormal } from 'iconsax-react';
26
26
  import cn from 'classnames';
27
27
  import Pagination from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Pagination';
28
28
  import { ReviewModal } from './Reviews'
29
- import { useCartContext } from '@magento/peregrine/lib/context/cart';
30
29
 
31
30
  const errorIcon = (
32
31
  <Icon
@@ -39,7 +38,7 @@ const errorIcon = (
39
38
  const searchIcon = <Icon src={SearchIcon} size={24} />;
40
39
 
41
40
  const OrderHistoryPage = props => {
42
- const talonProps = useOrderHistoryPage();
41
+ const talonProps = useOrderHistoryPage();
43
42
  const {
44
43
  errorMessage,
45
44
  loadMoreOrders,
@@ -52,7 +51,6 @@ const OrderHistoryPage = props => {
52
51
  searchText,
53
52
  pageControl
54
53
  } = talonProps;
55
-
56
54
  const [, { addToast }] = useToasts();
57
55
  const { formatMessage } = useIntl();
58
56
  const [reviewOrder, setReviewOrder] = useState(null);
@@ -168,6 +166,8 @@ const OrderHistoryPage = props => {
168
166
  }
169
167
  }, [addToast, errorMessage]);
170
168
 
169
+ console.log('reviewOrder',reviewOrder)
170
+
171
171
  return (
172
172
  <OrderHistoryContextProvider>
173
173
  <ReviewModal