@graphcommerce/magento-review 2.106.0 → 2.107.1

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.107.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-review@2.107.0...@graphcommerce/magento-review@2.107.1) (2021-10-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * External SVG's can't have alt tags ([1b1414a](https://github.com/ho-nl/m2-pwa/commit/1b1414a782d55d3acf7b0e6bcaa50f2ad5f18f39))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.107.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-review@2.106.2...@graphcommerce/magento-review@2.107.0) (2021-10-28)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * keep original review chip ([3f2f834](https://github.com/ho-nl/m2-pwa/commit/3f2f834478b7b8252f6164442815e5c081de6411))
23
+ * keep original review chip for now ([9664cd9](https://github.com/ho-nl/m2-pwa/commit/9664cd90801c6776e1c694eec8f393118810a792))
24
+ * review button size ([9074102](https://github.com/ho-nl/m2-pwa/commit/9074102c1866b14d0e7f1f0f3dfabe6e6c0b324d))
25
+ * size of default ReviewChip ([e1d4969](https://github.com/ho-nl/m2-pwa/commit/e1d49699776b15fa056677f042f6c9939b6acada))
26
+
27
+
28
+ ### Features
29
+
30
+ * cleanup grid, add visual star chip ([0571569](https://github.com/ho-nl/m2-pwa/commit/057156937f603bc399f5f8f8ac2837ff5cfaef28))
31
+ * dynamic icons, update SvgImage uses to SvgImageSimple ([3d3cc0e](https://github.com/ho-nl/m2-pwa/commit/3d3cc0e0336fcde1cce6ba19705f82c1edf9bfc6))
32
+ * enable use of both small and medium chips in design ([4536f96](https://github.com/ho-nl/m2-pwa/commit/4536f96b031734a71faf7c10f94aa5d5da90b9a8))
33
+
34
+
35
+
36
+
37
+
6
38
  # [2.106.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-review@2.105.37...@graphcommerce/magento-review@2.106.0) (2021-10-27)
7
39
 
8
40
 
@@ -50,7 +50,7 @@ const useStyles = makeStyles(
50
50
  date: {
51
51
  gridArea: 'date',
52
52
  fontStyle: 'italic',
53
- color: theme.palette.primary.mutedText,
53
+ color: theme.palette.text.disabled,
54
54
  },
55
55
  }),
56
56
  { name: 'CustomerReview' },
@@ -88,11 +88,7 @@ export default function CustomerReview(props: CustomerReviewProps) {
88
88
  </div>
89
89
  <div className={classes.stars}>
90
90
  {[...new Array(totalStars)].map((value, index) => (
91
- <Image
92
- src={index < totalFilledStars ? filledStar : outlinedStar}
93
- alt='star'
94
- loading='eager'
95
- />
91
+ <Image src={index < totalFilledStars ? filledStar : outlinedStar} />
96
92
  ))}
97
93
  </div>
98
94
  <div className={classes.title}>{product?.name}</div>
@@ -1,15 +1,43 @@
1
- import { SvgImageSimple, iconStarYellow } from '@graphcommerce/next-ui'
2
- import { Chip, ChipProps } from '@material-ui/core'
1
+ import { SvgImageSimple, iconStar } from '@graphcommerce/next-ui'
2
+ import { Chip, ChipProps, makeStyles } from '@material-ui/core'
3
3
  import React from 'react'
4
4
 
5
5
  export type ProductReviewChipProps = {
6
6
  rating?: number
7
7
  reviewSectionId?: string
8
8
  max?: number
9
+ shapeOnly?: boolean
9
10
  } & ChipProps
10
11
 
12
+ const useStyles = makeStyles({
13
+ ratingContainer: {
14
+ width: '100%',
15
+ position: 'relative',
16
+ },
17
+ rating: {
18
+ position: 'absolute',
19
+ overflow: 'hidden',
20
+ '& > img': {
21
+ display: 'inline',
22
+ },
23
+ zIndex: 1,
24
+ },
25
+ maxRating: {
26
+ opacity: 0.4,
27
+ '& > img': {
28
+ display: 'inline',
29
+ filter: 'grayscale(100%)',
30
+ },
31
+ },
32
+ iconStar: {
33
+ stroke: '#FFDA1C',
34
+ fill: '#FFDA1C',
35
+ },
36
+ })
37
+
11
38
  export default function ProductReviewChip(props: ProductReviewChipProps) {
12
- const { rating, reviewSectionId = '', max = 5, ...chipProps } = props
39
+ const { rating, reviewSectionId = '', shapeOnly = false, max = 5, ...chipProps } = props
40
+ const classes = useStyles()
13
41
 
14
42
  if (!rating) return null
15
43
 
@@ -32,8 +60,9 @@ export default function ProductReviewChip(props: ProductReviewChipProps) {
32
60
  variant='outlined'
33
61
  clickable={!!reviewSectionId}
34
62
  onClick={handleClick}
35
- icon={<SvgImageSimple src={iconStarYellow} alt='Stars' />}
63
+ icon={<SvgImageSimple src={iconStar} size='small' className={classes.iconStar} />}
36
64
  color='default'
65
+ size='small'
37
66
  label={`${normalizedRating}/5`}
38
67
  {...chipProps}
39
68
  />
@@ -1,8 +1,7 @@
1
1
  import { useQuery } from '@apollo/client'
2
2
  import {
3
3
  Button,
4
- iconStarFilledMuted,
5
- iconStarYellow,
4
+ iconStar,
6
5
  Pagination,
7
6
  responsiveVal,
8
7
  StarRatingField,
@@ -37,8 +36,12 @@ const useStyles = makeStyles(
37
36
  gridAutoFlow: 'column',
38
37
  justifyContent: 'space-between',
39
38
  },
40
- nickname: {},
41
- date: {},
39
+ nickname: {
40
+ ...theme.typography.body2,
41
+ },
42
+ date: {
43
+ ...theme.typography.body2,
44
+ },
42
45
  reviewsBottomContainer: {
43
46
  display: 'flex',
44
47
  alignItems: 'center',
@@ -128,7 +131,7 @@ export default function ProductReviews(props: ProductReviewsProps) {
128
131
  variant='pill'
129
132
  color='primary'
130
133
  text='bold'
131
- size='large'
134
+ size='medium'
132
135
  className={classes.writeReviewButton}
133
136
  >
134
137
  Write a review
@@ -169,7 +172,7 @@ export default function ProductReviews(props: ProductReviewsProps) {
169
172
  myReviews.items.map((review) => (
170
173
  <div key={review?.summary} className={classes.review}>
171
174
  <div className={classes.title}>
172
- <ProductReviewChip rating={review?.average_rating} variant='default' />
175
+ <ProductReviewChip rating={review?.average_rating} size='small' />
173
176
  <Typography variant='h5'> {review?.summary}</Typography>
174
177
  </div>
175
178
  <Typography variant='body1'>{review?.text}</Typography>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-review",
3
- "version": "2.106.0",
3
+ "version": "2.107.1",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -14,26 +14,26 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@graphcommerce/browserslist-config-pwa": "^3.0.2",
17
- "@graphcommerce/eslint-config-pwa": "^3.1.1",
17
+ "@graphcommerce/eslint-config-pwa": "^3.1.2",
18
18
  "@graphcommerce/prettier-config-pwa": "^3.0.3",
19
19
  "@graphcommerce/typescript-config-pwa": "^3.1.1",
20
- "@playwright/test": "^1.15.2"
20
+ "@playwright/test": "^1.16.2"
21
21
  },
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.4.16",
24
- "@graphcommerce/graphql": "^2.105.0",
25
- "@graphcommerce/image": "^2.105.0",
26
- "@graphcommerce/magento-product": "^3.3.0",
27
- "@graphcommerce/magento-store": "^3.1.0",
28
- "@graphcommerce/next-ui": "^3.10.0",
24
+ "@graphcommerce/graphql": "^2.105.1",
25
+ "@graphcommerce/image": "^2.105.1",
26
+ "@graphcommerce/magento-product": "^3.4.1",
27
+ "@graphcommerce/magento-store": "^3.1.4",
28
+ "@graphcommerce/next-ui": "^3.11.1",
29
29
  "@graphql-typed-document-node/core": "^3.1.0",
30
30
  "@material-ui/core": "^4.12.3",
31
31
  "@material-ui/lab": "^4.0.0-alpha.60",
32
32
  "clsx": "^1.1.1",
33
- "next": "^12.0.0",
33
+ "next": "^12.0.1",
34
34
  "react": "^17.0.2",
35
35
  "react-dom": "^17.0.2",
36
36
  "schema-dts": "^1.0.0"
37
37
  },
38
- "gitHead": "e34fa8877d4596971c861c0c2438cb4c82f6fcaa"
38
+ "gitHead": "e01d10a0e89c68c316c3e4bb6a306e9a6959a7f6"
39
39
  }