@graphcommerce/magento-cart 3.8.11 → 3.8.12

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,18 @@
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
+ ## [3.8.12](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.8.11...@graphcommerce/magento-cart@3.8.12) (2021-12-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * added various translations ([66c089d](https://github.com/ho-nl/m2-pwa/commit/66c089dc458e2d7b9f0318b2e14d88cb0e6effc8))
12
+ * make sure we're using something more uplifting for the cadt ([811120c](https://github.com/ho-nl/m2-pwa/commit/811120c49c4a9d3cba78c5f8c8fda56c9cd81e5d))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [3.8.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.8.1...@graphcommerce/magento-cart@3.8.2) (2021-12-03)
7
19
 
8
20
 
@@ -9,7 +9,7 @@ import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
9
9
 
10
10
  export type ApolloCartErrorAlertProps = ApolloErrorAlertProps
11
11
 
12
- export default function ApolloCartErrorAlert(props: ApolloCartErrorAlertProps) {
12
+ export function ApolloCartErrorAlert(props: ApolloCartErrorAlertProps) {
13
13
  const { error } = props
14
14
  const clear = useClearCurrentCartId()
15
15
  const token = useQuery(CustomerTokenDocument).data?.customerToken
@@ -11,7 +11,7 @@ import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
11
11
 
12
12
  export type ApolloCartErrorFullPageProps = Omit<ApolloErrorFullPageProps, 'icon'>
13
13
 
14
- export default function ApolloCartErrorFullPage(props: ApolloCartErrorFullPageProps) {
14
+ export function ApolloCartErrorFullPage(props: ApolloCartErrorFullPageProps) {
15
15
  const { error, ...passedProps } = props
16
16
  const clear = useClearCurrentCartId()
17
17
 
@@ -0,0 +1,20 @@
1
+ import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
2
+ import { Button, ApolloErrorSnackbarProps, ApolloErrorSnackbar } from '@graphcommerce/next-ui'
3
+ import React from 'react'
4
+ import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
5
+
6
+ export type ApolloCartErrorSnackbarProps = Omit<ApolloErrorSnackbarProps, 'action'>
7
+
8
+ export function ApolloCartErrorSnackbar(props: ApolloCartErrorSnackbarProps) {
9
+ const { error, ...passedProps } = props
10
+ const clear = useClearCurrentCartId()
11
+
12
+ const [, noSuchEntity] = graphqlErrorByCategory({ category: 'graphql-no-such-entity', error })
13
+ const action = noSuchEntity ? (
14
+ <Button onClick={clear} variant='pill' color='secondary'>
15
+ Reset Cart
16
+ </Button>
17
+ ) : undefined
18
+
19
+ return <ApolloErrorSnackbar error={error} action={action} {...passedProps} />
20
+ }
@@ -0,0 +1,3 @@
1
+ export * from './ApolloCartErrorAlert'
2
+ export * from './ApolloCartErrorFullPage'
3
+ export * from './ApolloCartErrorSnackbar'
@@ -1,6 +1,5 @@
1
- import { FullPageMessage, SvgImageSimple, iconSadFace } from '@graphcommerce/next-ui'
2
- import { t, Trans } from '@lingui/macro'
3
- import { Button } from '@material-ui/core'
1
+ import { FullPageMessage, SvgImageSimple, iconShoppingBag, Button } from '@graphcommerce/next-ui'
2
+ import { Trans } from '@lingui/macro'
4
3
  import Link from 'next/link'
5
4
  import React from 'react'
6
5
 
@@ -10,11 +9,11 @@ export default function EmptyCart(props: EmptyCartProps) {
10
9
 
11
10
  return (
12
11
  <FullPageMessage
13
- title={t`Your cart is empty`}
14
- icon={<SvgImageSimple src={iconSadFace} size='xxl' />}
12
+ title={<Trans>Your cart is empty</Trans>}
13
+ icon={<SvgImageSimple src={iconShoppingBag} size='xxl' />}
15
14
  button={
16
15
  <Link href='/' passHref>
17
- <Button variant='contained' color='primary' size='large'>
16
+ <Button variant='pill' color='secondary' size='large'>
18
17
  <Trans>Continue shopping</Trans>
19
18
  </Button>
20
19
  </Link>
@@ -9,11 +9,7 @@ export { default as CartTotals } from './CartTotals/CartTotals'
9
9
 
10
10
  export { default as EmptyCart } from './EmptyCart/EmptyCart'
11
11
 
12
- export * from './ApolloCartError/ApolloCartErrorAlert'
13
- export { default as ApolloCartErrorAlert } from './ApolloCartError/ApolloCartErrorAlert'
14
-
15
- export * from './ApolloCartError/ApolloCartErrorFullPage'
16
- export { default as ApolloCartErrorFullPage } from './ApolloCartError/ApolloCartErrorFullPage'
12
+ export * from './ApolloCartError'
17
13
 
18
14
  export * from './CartSummary'
19
15
  export { default as CartSummary } from './CartSummary'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-cart",
3
- "version": "3.8.11",
3
+ "version": "3.8.12",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.5.6",
24
- "@graphcommerce/framer-next-pages": "^2.108.3",
25
- "@graphcommerce/framer-scroller": "^1.1.9",
26
- "@graphcommerce/graphql": "^2.105.8",
24
+ "@graphcommerce/framer-next-pages": "^2.108.4",
25
+ "@graphcommerce/framer-scroller": "^1.1.10",
26
+ "@graphcommerce/graphql": "^2.105.9",
27
27
  "@graphcommerce/image": "^2.105.8",
28
- "@graphcommerce/magento-customer": "^3.6.16",
29
- "@graphcommerce/magento-graphql": "^2.104.8",
30
- "@graphcommerce/magento-store": "^3.3.16",
31
- "@graphcommerce/next-ui": "^3.20.9",
28
+ "@graphcommerce/magento-customer": "^3.6.17",
29
+ "@graphcommerce/magento-graphql": "^2.104.9",
30
+ "@graphcommerce/magento-store": "^3.3.17",
31
+ "@graphcommerce/next-ui": "^3.21.0",
32
32
  "@graphcommerce/react-hook-form": "^2.104.4",
33
33
  "@lingui/macro": "^3.13.0",
34
34
  "@material-ui/core": "^4.12.3",
@@ -39,5 +39,5 @@
39
39
  "react": "^17.0.2",
40
40
  "react-dom": "^17.0.2"
41
41
  },
42
- "gitHead": "874fc99dcc129872cd7577482ab26c5ea256a7fb"
42
+ "gitHead": "f18eba6b141623d926f5ae3a6efc1409d3bd365c"
43
43
  }