@riosst100/pwa-marketplace 1.8.0 → 1.8.2

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 (63) hide show
  1. package/i18n/id_ID.json +508 -508
  2. package/package.json +1 -2
  3. package/src/components/CustomSubCategory/subCategory.js +0 -14
  4. package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.module.css +1 -1
  5. package/src/components/FilterTop/filterTop.js +2 -2
  6. package/src/components/FilterTop/filterTop.module.css +1 -1
  7. package/src/components/FilterTopBackup/CustomFilters/customFilter.js +83 -83
  8. package/src/components/FilterTopBackup/CustomFilters/customFilter.module.css +21 -21
  9. package/src/components/FilterTopBackup/CustomFilters/customFilters.js +131 -131
  10. package/src/components/FilterTopBackup/CustomFilters/customFilters.module.css +22 -22
  11. package/src/components/FilterTopBackup/CustomFilters/index.js +1 -1
  12. package/src/components/FilterTopBackup/filterTop.js +14 -14
  13. package/src/components/FilterTopBackup/filterTop.module.css +22 -22
  14. package/src/components/FilterTopBackup/filterTop.shimmer.js +24 -24
  15. package/src/components/FilterTopBackup/index.js +2 -2
  16. package/src/components/Header/websiteSwitcher.shimmer.js +6 -6
  17. package/src/components/Header/websiteSwitcherItem.js +47 -47
  18. package/src/components/Header/websiteSwitcherItem.module.css +20 -20
  19. package/src/components/LegoSets/legoSets.js +21 -72
  20. package/src/components/PhoneTextInput/index.js +1 -1
  21. package/src/components/PhoneTextInput/phoneTextInput.js +62 -62
  22. package/src/components/ProductListTab/index.js +4 -4
  23. package/src/components/ProductListTab/productListTab.module.css +64 -64
  24. package/src/components/ProductListTab/productListTab.shimmer.js +24 -24
  25. package/src/components/SellerCountry/index.js +1 -1
  26. package/src/components/SellerCountry/sellerCountry.js +71 -71
  27. package/src/components/SellerCountry/sellerCountry.module.css +3 -3
  28. package/src/components/ShopByCategory/index.js +2 -2
  29. package/src/components/ShopByCategory/shopByCategory.js +69 -69
  30. package/src/components/ShopByCategory/shopByCategory.module.css +58 -58
  31. package/src/components/ShopByCategory/shopByCategory.shimmer.js +24 -24
  32. package/src/components/SubCategory/subCategory.js +1 -1
  33. package/src/components/WebsiteSwitcher/websiteSwitcher.shimmer.js +6 -6
  34. package/src/components/WebsiteSwitcher/websiteSwitcherItem.js +47 -47
  35. package/src/components/WebsiteSwitcher/websiteSwitcherItem.module.css +20 -20
  36. package/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js +96 -96
  37. package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenu.js +199 -199
  38. package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenuItem.js +66 -66
  39. package/src/overwrites/peregrine/lib/talons/MegaMenu/useSubMenu.js +20 -20
  40. package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +642 -642
  41. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/category.gql.js +49 -49
  42. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategory.js +227 -227
  43. package/src/overwrites/peregrine/lib/talons/RootComponents/Product/product.gql.js +31 -31
  44. package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +235 -235
  45. package/src/overwrites/venia-ui/lib/components/Header/cartTrigger.module.css +47 -47
  46. package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.js +60 -60
  47. package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.module.css +70 -70
  48. package/src/talons/AttributesBlock/attributesBlock.gql.js +15 -15
  49. package/src/talons/CustomFilters/customFilters.gql.js +45 -45
  50. package/src/talons/CustomFilters/useCustomFilters.js +5 -2
  51. package/src/talons/FilterTop/filterTop.gql.js +45 -45
  52. package/src/talons/FilterTop/index.js +1 -1
  53. package/src/talons/FilterTop/useFilterTop.js +9 -3
  54. package/src/talons/Header/websiteSwitcher.gql.js +45 -45
  55. package/src/talons/LegoSets/legoSets.gql.js +2 -2
  56. package/src/talons/LegoSets/useLegoSets.js +6 -56
  57. package/src/talons/SellerReview/sellerReview.gql.js +53 -53
  58. package/src/talons/ShopByCategory/index.js +1 -1
  59. package/src/talons/ShopByCategory/shopByCategory.gql.js +38 -38
  60. package/src/talons/ShopByCategory/useShopByCategory.js +69 -69
  61. package/src/talons/SubCategory/subCategory.gql.js +15 -15
  62. package/src/talons/SubCategory/useSubCategory.js +3 -3
  63. package/src/talons/WebsiteSwitcher/websiteSwitcher.gql.js +45 -45
@@ -1,23 +1,23 @@
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
- justify-content: center;
8
- }
9
-
10
- .item {
11
- composes: px-4 from global;
12
- composes: py-2 from global;
13
- composes: transition-colors from global;
14
- composes: duration-150 from global;
15
- composes: border from global;
16
- composes: border-solid from global;
17
- composes: leading-normal from global;
18
- composes: text-base from global;
19
- composes: text-colorDefault from global;
20
- composes: bg-white from global;
21
- composes: border-gray-100 from global;
22
- border-radius: 5px;
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
+ /* justify-content: center; */
8
+ }
9
+
10
+ .item {
11
+ composes: px-4 from global;
12
+ composes: py-2 from global;
13
+ composes: transition-colors from global;
14
+ composes: duration-150 from global;
15
+ composes: border from global;
16
+ composes: border-solid from global;
17
+ composes: leading-normal from global;
18
+ composes: text-base from global;
19
+ composes: text-colorDefault from global;
20
+ composes: bg-white from global;
21
+ composes: border-gray-100 from global;
22
+ border-radius: 5px;
23
23
  }
@@ -1,24 +1,24 @@
1
- import React from 'react';
2
- import { shape, string } from 'prop-types';
3
- import { useStyle } from '@magento/venia-ui/lib/classify';
4
-
5
- import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
6
- import defaultClasses from './filterTop.module.css';
7
-
8
- const FilterTop = props => {
9
- const classes = useStyle(defaultClasses, props.classes);
10
-
11
- return (
12
- <aside className={classes.root} aria-live="polite" aria-busy="true">
13
- <Shimmer width="95%" height="70vh" style={{ marginBottom: 25 }} />
14
- </aside>
15
- );
16
- };
17
-
18
- FilterTop.propTypes = {
19
- classes: shape({
20
- root: string
21
- })
22
- };
23
-
24
- export default FilterTop;
1
+ import React from 'react';
2
+ import { shape, string } from 'prop-types';
3
+ import { useStyle } from '@magento/venia-ui/lib/classify';
4
+
5
+ import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
6
+ import defaultClasses from './filterTop.module.css';
7
+
8
+ const FilterTop = props => {
9
+ const classes = useStyle(defaultClasses, props.classes);
10
+
11
+ return (
12
+ <aside className={classes.root} aria-live="polite" aria-busy="true">
13
+ <Shimmer width="95%" height="70vh" style={{ marginBottom: 25 }} />
14
+ </aside>
15
+ );
16
+ };
17
+
18
+ FilterTop.propTypes = {
19
+ classes: shape({
20
+ root: string
21
+ })
22
+ };
23
+
24
+ export default FilterTop;
@@ -1,2 +1,2 @@
1
- export { default } from './filterTop';
2
- export { default as FilterTopShimmer } from './filterTop.shimmer';
1
+ export { default } from './filterTop';
2
+ export { default as FilterTopShimmer } from './filterTop.shimmer';
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
- import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
3
-
4
- export default () => {
5
- return <Shimmer width={6} height={2.25} />;
6
- };
1
+ import React from 'react';
2
+ import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
3
+
4
+ export default () => {
5
+ return <Shimmer width={6} height={2.25} />;
6
+ };
@@ -1,47 +1,47 @@
1
- import React, { useCallback } from 'react';
2
- import { Check } from 'react-feather';
3
- import { bool, func, shape, string } from 'prop-types';
4
-
5
- import { useStyle } from '@magento/venia-ui/lib/classify';
6
- import Icon from '@magento/venia-ui/lib/components/Icon/icon';
7
- import defaultClasses from './websiteSwitcherItem.module.css';
8
-
9
- const WebsiteSwitcherItem = props => {
10
- const { active, onClick, option, option2, children } = props;
11
- const classes = useStyle(defaultClasses, props.classes);
12
-
13
- const handleClick = useCallback(() => {
14
- onClick(option, option2);
15
- }, [option, option2, onClick]);
16
-
17
- const activeIcon = active ? (
18
- <Icon data-cy="WebsiteSwitcherItem-activeIcon" size={20} src={Check} />
19
- ) : null;
20
-
21
- return (
22
- <button
23
- data-cy="WebsiteSwitcherItem-button"
24
- className={classes.root}
25
- disabled={active}
26
- onClick={handleClick}
27
- >
28
- <span className={classes.content}>
29
- <span className={classes.text}>{children}</span>
30
- {activeIcon}
31
- </span>
32
- </button>
33
- );
34
- };
35
-
36
- WebsiteSwitcherItem.propTypes = {
37
- active: bool,
38
- classes: shape({
39
- content: string,
40
- root: string,
41
- text: string
42
- }),
43
- onClick: func,
44
- option: string
45
- };
46
-
47
- export default WebsiteSwitcherItem;
1
+ import React, { useCallback } from 'react';
2
+ import { Check } from 'react-feather';
3
+ import { bool, func, shape, string } from 'prop-types';
4
+
5
+ import { useStyle } from '@magento/venia-ui/lib/classify';
6
+ import Icon from '@magento/venia-ui/lib/components/Icon/icon';
7
+ import defaultClasses from './websiteSwitcherItem.module.css';
8
+
9
+ const WebsiteSwitcherItem = props => {
10
+ const { active, onClick, option, option2, children } = props;
11
+ const classes = useStyle(defaultClasses, props.classes);
12
+
13
+ const handleClick = useCallback(() => {
14
+ onClick(option, option2);
15
+ }, [option, option2, onClick]);
16
+
17
+ const activeIcon = active ? (
18
+ <Icon data-cy="WebsiteSwitcherItem-activeIcon" size={20} src={Check} />
19
+ ) : null;
20
+
21
+ return (
22
+ <button
23
+ data-cy="WebsiteSwitcherItem-button"
24
+ className={classes.root}
25
+ disabled={active}
26
+ onClick={handleClick}
27
+ >
28
+ <span className={classes.content}>
29
+ <span className={classes.text}>{children}</span>
30
+ {activeIcon}
31
+ </span>
32
+ </button>
33
+ );
34
+ };
35
+
36
+ WebsiteSwitcherItem.propTypes = {
37
+ active: bool,
38
+ classes: shape({
39
+ content: string,
40
+ root: string,
41
+ text: string
42
+ }),
43
+ onClick: func,
44
+ option: string
45
+ };
46
+
47
+ export default WebsiteSwitcherItem;
@@ -1,20 +1,20 @@
1
- .root {
2
- composes: flex from global;
3
- composes: items-center from global;
4
- composes: w-full from global;
5
- }
6
-
7
- .content {
8
- composes: gap-3 from global;
9
- composes: grid from global;
10
- composes: grid-cols-[1fr] from global;
11
- composes: grid-flow-col from global;
12
- composes: items-center from global;
13
- composes: px-xs from global;
14
- composes: py-2xs from global;
15
- composes: w-full from global;
16
- }
17
-
18
- .text {
19
- composes: text-left from global;
20
- }
1
+ .root {
2
+ composes: flex from global;
3
+ composes: items-center from global;
4
+ composes: w-full from global;
5
+ }
6
+
7
+ .content {
8
+ composes: gap-3 from global;
9
+ composes: grid from global;
10
+ composes: grid-cols-[1fr] from global;
11
+ composes: grid-flow-col from global;
12
+ composes: items-center from global;
13
+ composes: px-xs from global;
14
+ composes: py-2xs from global;
15
+ composes: w-full from global;
16
+ }
17
+
18
+ .text {
19
+ composes: text-left from global;
20
+ }
@@ -20,20 +20,14 @@ const LegoSets = props => {
20
20
  const { location } = globalThis;
21
21
 
22
22
  const query = new URLSearchParams(location.search);
23
- const activeParam = query.get('active_tab') || null;
24
23
 
25
24
  const [active, setActive] = useState('all');
26
25
  const [activeTab, setActiveTab] = useState('all');
27
- const [activeFilter, setActiveFilter] = useState('Major Baseball League');
28
26
 
29
27
  const [searchQuery, setSearchQuery] = useState('');
30
-
31
- let availableLeagues = [];
32
- let availableBrands = [];
33
28
 
34
29
  const shopby = query.get('shopby') || null;
35
30
  const setType = query.get('set_type') || null;
36
- const brandsFilter = query.get('sc_brands[filter]') || null;
37
31
 
38
32
  let defaultSort = {
39
33
  sortText: 'All (A-Z)',
@@ -57,25 +51,25 @@ const LegoSets = props => {
57
51
  // Sorting
58
52
  const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
59
53
  const [currentSort] = sortProps;
60
- const [sortBy, setSortBy] = useState({
61
- sortText: 'All (A-Z)',
62
- value: 'all'
63
- });
64
-
65
- let availableSortBy = [
66
- {
67
- 'label': 'All (A-Z)',
68
- 'value': 'all'
69
- },
70
- {
71
- 'label': 'By Year',
72
- 'value': 'newest'
73
- }
74
- ];
54
+ // const [sortBy, setSortBy] = useState({
55
+ // sortText: 'All (A-Z)',
56
+ // value: 'all'
57
+ // });
58
+
59
+ // let availableSortBy = [
60
+ // {
61
+ // 'label': 'All (A-Z)',
62
+ // 'value': 'all'
63
+ // },
64
+ // {
65
+ // 'label': 'By Year',
66
+ // 'value': 'newest'
67
+ // }
68
+ // ];
75
69
 
76
70
  const classes = useStyle(defaultClasses);
77
71
 
78
- const talonProps = useLegoSets({ searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab, activeFilter });
72
+ const talonProps = useLegoSets({ searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab });
79
73
 
80
74
  const { error, loading, legoSets, categoryUrlSuffix, categoryUrlKey, productType, filteredLegoSets, availableGroups, category } = talonProps;
81
75
 
@@ -96,48 +90,11 @@ const LegoSets = props => {
96
90
  legoSets.map((setRelease, index) => {
97
91
  const { group, sets } = setRelease;
98
92
 
99
- // if (sets.length) {
100
- // sets.map((set, index) => {
101
- // // console.log(set)
102
- // if (set.sc_league) {
103
- // if (!availableLeagues.includes(set.sc_league)) {
104
- // availableLeagues.push(set.sc_league)
105
- // }
106
- // }
107
- // })
108
- // }
109
-
110
93
  setsLengthArr[group] = sets.length
111
94
  })
112
95
  }
113
96
  // }, [legoSets])
114
97
 
115
- if (legoSets && legoSets.length) {
116
- legoSets.map((setRelease, index) => {
117
- const { group, sets } = setRelease;
118
- if (active == 'all' || active != "all" && active == group) {
119
- if (sets.length) {
120
- sets.map((set, index) => {
121
- // console.log(set)
122
- if (set.sc_league) {
123
- if (!availableLeagues.includes(set.sc_league)) {
124
- availableLeagues.push(set.sc_league)
125
- }
126
- }
127
-
128
- if (set.sc_brands) {
129
- if (!availableBrands.includes(set.sc_brands)) {
130
- availableBrands.push(set.sc_brands)
131
- }
132
- }
133
-
134
- // availableBrands
135
- })
136
- }
137
- }
138
- })
139
- }
140
-
141
98
  const splitToNChunks = (array, n) => {
142
99
  let result = [];
143
100
  for (let i = n; i > 0; i--) {
@@ -156,7 +113,7 @@ const LegoSets = props => {
156
113
  const { set_name, option_id, release_year } = set;
157
114
 
158
115
  const categoryUrl = resourceUrl(
159
- `/${category?.url_path}${categoryUrlSuffix || ''}?sc_${category?.url_key}_release[filter]=${set_name},${option_id}`
116
+ `/${category?.url_path}${categoryUrlSuffix || ''}?lego_set_name[filter]=${set_name},${option_id}`
160
117
  );
161
118
 
162
119
  setsResult.push(<li className='list-none'>
@@ -196,11 +153,6 @@ const LegoSets = props => {
196
153
  const handleActive = (val) => {
197
154
  setActive(val);
198
155
 
199
- availableLeagues = [];
200
-
201
- setActiveFilter('Major Baseball League')
202
-
203
-
204
156
  setSearchQuery('')
205
157
  }
206
158
 
@@ -209,11 +161,9 @@ const LegoSets = props => {
209
161
 
210
162
  setSearchQuery('')
211
163
  }
212
-
213
- const handleActiveFilter = (val) => {
214
- setActiveFilter(val);
215
-
216
- setSearchQuery('')
164
+ const handleSearchQuery = (val) => {
165
+ setSearchQuery(val)
166
+ setActive('all')
217
167
  }
218
168
 
219
169
  let alpha = ['#', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
@@ -277,7 +227,7 @@ const LegoSets = props => {
277
227
  <div
278
228
  className={classes.toolbar}
279
229
  >
280
- <div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={setSearchQuery} /></div>
230
+ <div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={handleSearchQuery} /></div>
281
231
  {/* <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} /> */}
282
232
  </div>
283
233
  ) : ''}
@@ -324,7 +274,6 @@ const LegoSets = props => {
324
274
  </div>
325
275
  </Fragment>
326
276
  );
327
- return '';
328
277
  }
329
278
 
330
279
  export default LegoSets;
@@ -1 +1 @@
1
- export { default } from './phoneTextInput';
1
+ export { default } from './phoneTextInput';
@@ -1,62 +1,62 @@
1
- import React, { Fragment, useState } from 'react';
2
- import { node, shape, string } from 'prop-types';
3
- import useFieldState from '@magento/peregrine/lib/hooks/hook-wrappers/useInformedFieldStateWrapper';
4
-
5
- import { useStyle } from '@magento/venia-ui/lib/classify';
6
- import { FieldIcons, Message } from '@magento/venia-ui/lib/components/Field';
7
- import defaultClasses from './phoneTextInput.module.css';
8
- import PhoneInput from 'react-phone-number-input'
9
- import 'react-phone-number-input/style.css'
10
-
11
- const PhoneTextInput = props => {
12
- const {
13
- after,
14
- before,
15
- classes: propClasses,
16
- regionError,
17
- field,
18
- message,
19
- countryCodeField = "country",
20
- ...rest
21
- } = props;
22
- const fieldState = useFieldState(field);
23
- const { value: phoneValue } = fieldState;
24
- const classes = useStyle(defaultClasses, propClasses);
25
- var inputClass =
26
- fieldState.error || regionError ? classes.input_error : classes.input;
27
-
28
- const handleChange = (value) => {
29
- fieldState.value = value;
30
- }
31
-
32
- const countryFieldState = useFieldState(countryCodeField);
33
- const { value: country } = countryFieldState;
34
-
35
- return (
36
- <Fragment>
37
- <FieldIcons after={after} before={before}>
38
- <PhoneInput
39
- international
40
- countryCallingCodeEditable={false}
41
- defaultCountry={country}
42
- name={field}
43
- value={phoneValue}
44
- onChange={handleChange}
45
- />
46
- </FieldIcons>
47
- <Message fieldState={fieldState}>{message}</Message>
48
- </Fragment>
49
- );
50
- };
51
-
52
- export default PhoneTextInput;
53
-
54
- PhoneTextInput.propTypes = {
55
- after: node,
56
- before: node,
57
- classes: shape({
58
- input: string
59
- }),
60
- field: string.isRequired,
61
- message: node
62
- };
1
+ import React, { Fragment, useState } from 'react';
2
+ import { node, shape, string } from 'prop-types';
3
+ import useFieldState from '@magento/peregrine/lib/hooks/hook-wrappers/useInformedFieldStateWrapper';
4
+
5
+ import { useStyle } from '@magento/venia-ui/lib/classify';
6
+ import { FieldIcons, Message } from '@magento/venia-ui/lib/components/Field';
7
+ import defaultClasses from './phoneTextInput.module.css';
8
+ import PhoneInput from 'react-phone-number-input'
9
+ import 'react-phone-number-input/style.css'
10
+
11
+ const PhoneTextInput = props => {
12
+ const {
13
+ after,
14
+ before,
15
+ classes: propClasses,
16
+ regionError,
17
+ field,
18
+ message,
19
+ countryCodeField = "country",
20
+ ...rest
21
+ } = props;
22
+ const fieldState = useFieldState(field);
23
+ const { value: phoneValue } = fieldState;
24
+ const classes = useStyle(defaultClasses, propClasses);
25
+ var inputClass =
26
+ fieldState.error || regionError ? classes.input_error : classes.input;
27
+
28
+ const handleChange = (value) => {
29
+ fieldState.value = value;
30
+ }
31
+
32
+ const countryFieldState = useFieldState(countryCodeField);
33
+ const { value: country } = countryFieldState;
34
+
35
+ return (
36
+ <Fragment>
37
+ <FieldIcons after={after} before={before}>
38
+ <PhoneInput
39
+ international
40
+ countryCallingCodeEditable={false}
41
+ defaultCountry={country}
42
+ name={field}
43
+ value={phoneValue}
44
+ onChange={handleChange}
45
+ />
46
+ </FieldIcons>
47
+ <Message fieldState={fieldState}>{message}</Message>
48
+ </Fragment>
49
+ );
50
+ };
51
+
52
+ export default PhoneTextInput;
53
+
54
+ PhoneTextInput.propTypes = {
55
+ after: node,
56
+ before: node,
57
+ classes: shape({
58
+ input: string
59
+ }),
60
+ field: string.isRequired,
61
+ message: node
62
+ };
@@ -1,4 +1,4 @@
1
- export { default } from './productListTab';
2
- export {
3
- default as ProductListTabShimmer
4
- } from './productListTab.shimmer';
1
+ export { default } from './productListTab';
2
+ export {
3
+ default as ProductListTabShimmer
4
+ } from './productListTab.shimmer';