@graphcommerce/magento-review 2.106.2 → 2.107.0
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,27 @@
|
|
|
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.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-review@2.106.2...@graphcommerce/magento-review@2.107.0) (2021-10-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* keep original review chip ([3f2f834](https://github.com/ho-nl/m2-pwa/commit/3f2f834478b7b8252f6164442815e5c081de6411))
|
|
12
|
+
* keep original review chip for now ([9664cd9](https://github.com/ho-nl/m2-pwa/commit/9664cd90801c6776e1c694eec8f393118810a792))
|
|
13
|
+
* review button size ([9074102](https://github.com/ho-nl/m2-pwa/commit/9074102c1866b14d0e7f1f0f3dfabe6e6c0b324d))
|
|
14
|
+
* size of default ReviewChip ([e1d4969](https://github.com/ho-nl/m2-pwa/commit/e1d49699776b15fa056677f042f6c9939b6acada))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* cleanup grid, add visual star chip ([0571569](https://github.com/ho-nl/m2-pwa/commit/057156937f603bc399f5f8f8ac2837ff5cfaef28))
|
|
20
|
+
* dynamic icons, update SvgImage uses to SvgImageSimple ([3d3cc0e](https://github.com/ho-nl/m2-pwa/commit/3d3cc0e0336fcde1cce6ba19705f82c1edf9bfc6))
|
|
21
|
+
* enable use of both small and medium chips in design ([4536f96](https://github.com/ho-nl/m2-pwa/commit/4536f96b031734a71faf7c10f94aa5d5da90b9a8))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
# [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
28
|
|
|
8
29
|
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import { SvgImageSimple,
|
|
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={
|
|
63
|
+
icon={<SvgImageSimple src={iconStar} alt='Stars' 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
|
-
|
|
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
|
-
|
|
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='
|
|
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}
|
|
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.
|
|
3
|
+
"version": "2.107.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"@apollo/client": "^3.4.16",
|
|
24
24
|
"@graphcommerce/graphql": "^2.105.1",
|
|
25
25
|
"@graphcommerce/image": "^2.105.1",
|
|
26
|
-
"@graphcommerce/magento-product": "^3.
|
|
27
|
-
"@graphcommerce/magento-store": "^3.1.
|
|
28
|
-
"@graphcommerce/next-ui": "^3.
|
|
26
|
+
"@graphcommerce/magento-product": "^3.4.0",
|
|
27
|
+
"@graphcommerce/magento-store": "^3.1.3",
|
|
28
|
+
"@graphcommerce/next-ui": "^3.11.0",
|
|
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",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"react-dom": "^17.0.2",
|
|
36
36
|
"schema-dts": "^1.0.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "f923ddb5d98378c8737314e7296bba77b1c2dc9b"
|
|
39
39
|
}
|