@graphcommerce/magento-customer 6.2.0-canary.14 → 6.2.0-canary.15

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,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.2.0-canary.15
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1926](https://github.com/graphcommerce-org/graphcommerce/pull/1926) [`ab8877fdb`](https://github.com/graphcommerce-org/graphcommerce/commit/ab8877fdb6147960ce656d28306d719e92f6de68) - Made the follow order link in the order card & order details a working <Link /> if provided from magento backend. ([@JoshuaS98](https://github.com/JoshuaS98))
8
+
3
9
  ## 6.2.0-canary.14
4
10
 
5
11
  ## 6.2.0-canary.13
@@ -26,7 +26,6 @@ const parts = [
26
26
  'totalsRow',
27
27
  'totalsDivider',
28
28
  'totalsVat',
29
- 'iconContainer',
30
29
  'invoice',
31
30
  ] as const
32
31
  const { classes } = extendableComponent(componentName, parts)
@@ -85,18 +84,11 @@ const TotalsVat = styled(TotalsRow, { target: classes.totalsVat })(({ theme }) =
85
84
  padding: `${theme.spacings.xxs} 0`,
86
85
  }),
87
86
  )
88
- const IconContainer = styled(TotalsRow, { target: classes.iconContainer })(({ theme }) =>
89
- theme.unstable_sx({
90
- marginLeft: '-6px',
91
- '& > div': {
92
- padding: '4px 0',
93
- },
94
- }),
95
- )
96
87
 
97
88
  const Invoice = styled(TotalsRow, { target: classes.invoice })(({ theme }) =>
98
89
  theme.unstable_sx({
99
90
  display: 'flex',
91
+ justifyContent: 'flex-start',
100
92
  alignItems: 'center',
101
93
  color: 'primary.main',
102
94
  }),
@@ -248,9 +240,7 @@ export function OrderDetails(props: OrderDetailsProps) {
248
240
  <>
249
241
  <div>{shipments?.[0]?.tracking && shipments?.[0]?.tracking?.[0]?.title}</div>
250
242
  {shipments?.[0]?.tracking?.[0] && (
251
- <IconContainer>
252
- <TrackingLink {...shipments?.[0].tracking?.[0]} />
253
- </IconContainer>
243
+ <TrackingLink {...shipments?.[0].tracking?.[0]} sx={{ padding: '4px 0' }} />
254
244
  )}
255
245
  </>
256
246
  )}
@@ -275,12 +265,10 @@ export function OrderDetails(props: OrderDetailsProps) {
275
265
  <div>{payment_methods[0].name}</div>
276
266
 
277
267
  {invoices && invoices?.length > 0 && (
278
- <IconContainer>
279
- <Invoice>
280
- <IconSvg src={iconInvoice} size='small' />
281
- {invoices?.[0]?.number}
282
- </Invoice>
283
- </IconContainer>
268
+ <Invoice>
269
+ <IconSvg src={iconInvoice} size='small' />
270
+ {invoices?.[0]?.number}
271
+ </Invoice>
284
272
  )}
285
273
  </>
286
274
  )}
@@ -1,7 +1,6 @@
1
1
  import { IconSvg, iconLocation } from '@graphcommerce/next-ui'
2
2
  import { Trans } from '@lingui/react'
3
- import { Box, SxProps, Theme } from '@mui/material'
4
- import React from 'react'
3
+ import { Box, Link, SxProps, Theme, Typography } from '@mui/material'
5
4
  import { TrackingLinkFragment } from './TrackingLink.gql'
6
5
 
7
6
  export type TrackingLinkProps = TrackingLinkFragment & { sx?: SxProps<Theme> }
@@ -9,6 +8,8 @@ export type TrackingLinkProps = TrackingLinkFragment & { sx?: SxProps<Theme> }
9
8
  export function TrackingLink(props: TrackingLinkProps) {
10
9
  const { number, sx = [] } = props
11
10
 
11
+ const validUrl = number?.startsWith('http://') || number?.startsWith('https://')
12
+
12
13
  return (
13
14
  <Box
14
15
  className='TrackingLink-root'
@@ -21,12 +22,20 @@ export function TrackingLink(props: TrackingLinkProps) {
21
22
  ...(Array.isArray(sx) ? sx : [sx]),
22
23
  ]}
23
24
  >
24
- {number && (
25
- <>
25
+ {number && validUrl && (
26
+ <Link
27
+ onClick={(e) => e.stopPropagation()}
28
+ href={number}
29
+ target='_blank'
30
+ underline='hover'
31
+ sx={{ display: 'inline-flex', alignItems: 'center' }}
32
+ >
26
33
  <IconSvg src={iconLocation} size='small' />
27
34
  <Trans id='Follow order' />
28
- </>
35
+ </Link>
29
36
  )}
37
+
38
+ {number && !validUrl && <Typography>{number}</Typography>}
30
39
  </Box>
31
40
  )
32
41
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-customer",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "6.2.0-canary.14",
5
+ "version": "6.2.0-canary.15",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,20 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "6.2.0-canary.14",
16
- "@graphcommerce/prettier-config-pwa": "6.2.0-canary.14",
17
- "@graphcommerce/typescript-config-pwa": "6.2.0-canary.14"
15
+ "@graphcommerce/eslint-config-pwa": "6.2.0-canary.15",
16
+ "@graphcommerce/prettier-config-pwa": "6.2.0-canary.15",
17
+ "@graphcommerce/typescript-config-pwa": "6.2.0-canary.15"
18
18
  },
19
19
  "dependencies": {
20
- "@graphcommerce/ecommerce-ui": "6.2.0-canary.14",
21
- "@graphcommerce/framer-utils": "6.2.0-canary.14",
22
- "@graphcommerce/graphql": "6.2.0-canary.14",
23
- "@graphcommerce/graphql-mesh": "6.2.0-canary.14",
24
- "@graphcommerce/image": "6.2.0-canary.14",
25
- "@graphcommerce/magento-graphql": "6.2.0-canary.14",
26
- "@graphcommerce/magento-store": "6.2.0-canary.14",
27
- "@graphcommerce/next-ui": "6.2.0-canary.14",
28
- "@graphcommerce/react-hook-form": "6.2.0-canary.14"
20
+ "@graphcommerce/ecommerce-ui": "6.2.0-canary.15",
21
+ "@graphcommerce/framer-utils": "6.2.0-canary.15",
22
+ "@graphcommerce/graphql": "6.2.0-canary.15",
23
+ "@graphcommerce/graphql-mesh": "6.2.0-canary.15",
24
+ "@graphcommerce/image": "6.2.0-canary.15",
25
+ "@graphcommerce/magento-graphql": "6.2.0-canary.15",
26
+ "@graphcommerce/magento-store": "6.2.0-canary.15",
27
+ "@graphcommerce/next-ui": "6.2.0-canary.15",
28
+ "@graphcommerce/react-hook-form": "6.2.0-canary.15"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@lingui/react": "^3.13.2",