@graphcommerce/magento-review 8.1.0-canary.44 → 8.1.0-canary.45

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
@@ -1,5 +1,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.1.0-canary.45
4
+
3
5
  ## 8.1.0-canary.44
4
6
 
5
7
  ## 8.1.0-canary.43
@@ -1,10 +1,5 @@
1
1
  import { Image } from '@graphcommerce/image'
2
- import {
3
- responsiveVal,
4
- extendableComponent,
5
- useDateTimeFormat,
6
- IconSvg,
7
- } from '@graphcommerce/next-ui'
2
+ import { responsiveVal, extendableComponent, IconSvg, DateTimeFormat } from '@graphcommerce/next-ui'
8
3
  import { Box, SxProps, Theme } from '@mui/material'
9
4
  import { CustomerReviewFragment } from './CustomerReview.gql'
10
5
  import filledStar from './review_star_filled.svg'
@@ -29,8 +24,6 @@ export function CustomerReview(props: CustomerReviewProps) {
29
24
  const valuePerStar = maxAverageRating / totalStars
30
25
  const totalFilledStars = (average_rating / maxAverageRating / valuePerStar) * 100
31
26
 
32
- const dateFormatter = useDateTimeFormat({ dateStyle: 'long' })
33
-
34
27
  return (
35
28
  <Box
36
29
  className={classes.container}
@@ -98,7 +91,7 @@ export function CustomerReview(props: CustomerReviewProps) {
98
91
  color: theme.palette.text.disabled,
99
92
  })}
100
93
  >
101
- {dateFormatter.format(new Date(created_at ?? ''))}
94
+ <DateTimeFormat>{created_at}</DateTimeFormat>
102
95
  </Box>
103
96
  </Box>
104
97
  )
@@ -4,7 +4,7 @@ import {
4
4
  responsiveVal,
5
5
  StarRatingField,
6
6
  extendableComponent,
7
- useDateTimeFormat,
7
+ DateTimeFormat,
8
8
  } from '@graphcommerce/next-ui'
9
9
  import { Trans } from '@lingui/react'
10
10
  import { Typography, Button, Box, SxProps, Theme, Link } from '@mui/material'
@@ -52,8 +52,6 @@ export function ProductReviews(props: ProductReviewsProps) {
52
52
 
53
53
  const { current_page, total_pages } = myReviews.page_info
54
54
 
55
- const formatter = useDateTimeFormat({ dateStyle: 'long', timeStyle: 'short' })
56
-
57
55
  if (!reviews) {
58
56
  return null
59
57
  }
@@ -233,8 +231,9 @@ export function ProductReviews(props: ProductReviewsProps) {
233
231
  dateTime={review?.created_at}
234
232
  sx={{ typography: 'body2' }}
235
233
  >
236
- {review?.created_at &&
237
- formatter.format(new Date(review?.created_at.replace(/-/g, '/')))}
234
+ <DateTimeFormat dateStyle='long' timeStyle='short'>
235
+ {review?.created_at.replace(/-/g, '/')}
236
+ </DateTimeFormat>
238
237
  </Box>
239
238
  </Box>
240
239
  </Box>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-review",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.44",
5
+ "version": "8.1.0-canary.45",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,18 +18,18 @@
18
18
  "typescript": "5.3.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/ecommerce-ui": "^8.1.0-canary.44",
22
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.44",
23
- "@graphcommerce/graphql": "^8.1.0-canary.44",
24
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.44",
25
- "@graphcommerce/image": "^8.1.0-canary.44",
26
- "@graphcommerce/magento-customer": "^8.1.0-canary.44",
27
- "@graphcommerce/magento-product": "^8.1.0-canary.44",
28
- "@graphcommerce/magento-store": "^8.1.0-canary.44",
29
- "@graphcommerce/next-ui": "^8.1.0-canary.44",
30
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.44",
31
- "@graphcommerce/react-hook-form": "^8.1.0-canary.44",
32
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.44",
21
+ "@graphcommerce/ecommerce-ui": "^8.1.0-canary.45",
22
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.45",
23
+ "@graphcommerce/graphql": "^8.1.0-canary.45",
24
+ "@graphcommerce/graphql-mesh": "^8.1.0-canary.45",
25
+ "@graphcommerce/image": "^8.1.0-canary.45",
26
+ "@graphcommerce/magento-customer": "^8.1.0-canary.45",
27
+ "@graphcommerce/magento-product": "^8.1.0-canary.45",
28
+ "@graphcommerce/magento-store": "^8.1.0-canary.45",
29
+ "@graphcommerce/next-ui": "^8.1.0-canary.45",
30
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.45",
31
+ "@graphcommerce/react-hook-form": "^8.1.0-canary.45",
32
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.45",
33
33
  "@lingui/core": "^4.2.1",
34
34
  "@lingui/macro": "^4.2.1",
35
35
  "@lingui/react": "^4.2.1",