@graphcommerce/magento-cart 3.8.10 → 3.8.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 +24 -0
- package/components/ApolloCartError/ApolloCartErrorAlert.tsx +1 -1
- package/components/ApolloCartError/ApolloCartErrorFullPage.tsx +1 -1
- package/components/ApolloCartError/ApolloCartErrorSnackbar.tsx +20 -0
- package/components/ApolloCartError/index.ts +3 -0
- package/components/CartTotals/CartTotals.tsx +5 -2
- package/components/EmptyCart/EmptyCart.tsx +5 -6
- package/components/index.ts +1 -5
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.13](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.8.12...@graphcommerce/magento-cart@3.8.13) (2021-12-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* darkMode fixes ([7d33d45](https://github.com/ho-nl/m2-pwa/commit/7d33d452ec801632565839b2fdfef0bc4959c14a))
|
|
12
|
+
* lighten ([8aa1d8e](https://github.com/ho-nl/m2-pwa/commit/8aa1d8e61ae122f63f2f8d164566bde9282e3354))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [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)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* added various translations ([66c089d](https://github.com/ho-nl/m2-pwa/commit/66c089dc458e2d7b9f0318b2e14d88cb0e6effc8))
|
|
24
|
+
* make sure we're using something more uplifting for the cadt ([811120c](https://github.com/ho-nl/m2-pwa/commit/811120c49c4a9d3cba78c5f8c8fda56c9cd81e5d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [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
31
|
|
|
8
32
|
|
|
@@ -9,7 +9,7 @@ import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
|
|
|
9
9
|
|
|
10
10
|
export type ApolloCartErrorAlertProps = ApolloErrorAlertProps
|
|
11
11
|
|
|
12
|
-
export
|
|
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
|
|
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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
2
|
import { AnimatedRow, responsiveVal, UseStyles } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Trans } from '@lingui/macro'
|
|
4
|
-
import { Divider, makeStyles, Theme } from '@material-ui/core'
|
|
4
|
+
import { Divider, lighten, makeStyles, Theme } from '@material-ui/core'
|
|
5
5
|
import clsx from 'clsx'
|
|
6
6
|
import { AnimatePresence } from 'framer-motion'
|
|
7
7
|
import React from 'react'
|
|
@@ -12,7 +12,10 @@ const useStyles = makeStyles(
|
|
|
12
12
|
(theme: Theme) => ({
|
|
13
13
|
costsContainer: {
|
|
14
14
|
borderRadius: responsiveVal(theme.shape.borderRadius * 3, theme.shape.borderRadius * 4),
|
|
15
|
-
background:
|
|
15
|
+
background:
|
|
16
|
+
theme.palette.type === 'light'
|
|
17
|
+
? '#FFE10820'
|
|
18
|
+
: lighten(theme.palette.background.default, 0.15),
|
|
16
19
|
padding: `${theme.spacings.xs} ${theme.spacings.sm}`,
|
|
17
20
|
},
|
|
18
21
|
containerMarginTop: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { FullPageMessage, SvgImageSimple,
|
|
2
|
-
import {
|
|
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={
|
|
14
|
-
icon={<SvgImageSimple src={
|
|
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='
|
|
16
|
+
<Button variant='pill' color='secondary' size='large'>
|
|
18
17
|
<Trans>Continue shopping</Trans>
|
|
19
18
|
</Button>
|
|
20
19
|
</Link>
|
package/components/index.ts
CHANGED
|
@@ -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
|
|
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.
|
|
3
|
+
"version": "3.8.15",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -13,31 +13,31 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@graphcommerce/browserslist-config-pwa": "^3.0.
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
18
|
-
"@graphcommerce/prettier-config-pwa": "^3.0.
|
|
19
|
-
"@graphcommerce/typescript-config-pwa": "^3.1.
|
|
16
|
+
"@graphcommerce/browserslist-config-pwa": "^3.0.3",
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.9",
|
|
18
|
+
"@graphcommerce/prettier-config-pwa": "^3.0.5",
|
|
19
|
+
"@graphcommerce/typescript-config-pwa": "^3.1.2",
|
|
20
20
|
"@playwright/test": "^1.17.1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apollo/client": "^3.5.6",
|
|
24
|
-
"@graphcommerce/framer-next-pages": "^2.108.
|
|
25
|
-
"@graphcommerce/framer-scroller": "^1.1.
|
|
26
|
-
"@graphcommerce/graphql": "^2.105.
|
|
27
|
-
"@graphcommerce/image": "^2.105.
|
|
28
|
-
"@graphcommerce/magento-customer": "^3.6.
|
|
29
|
-
"@graphcommerce/magento-graphql": "^2.104.
|
|
30
|
-
"@graphcommerce/magento-store": "^3.3.
|
|
31
|
-
"@graphcommerce/next-ui": "^3.
|
|
32
|
-
"@graphcommerce/react-hook-form": "^2.104.
|
|
24
|
+
"@graphcommerce/framer-next-pages": "^2.108.6",
|
|
25
|
+
"@graphcommerce/framer-scroller": "^1.1.13",
|
|
26
|
+
"@graphcommerce/graphql": "^2.105.11",
|
|
27
|
+
"@graphcommerce/image": "^2.105.10",
|
|
28
|
+
"@graphcommerce/magento-customer": "^3.6.20",
|
|
29
|
+
"@graphcommerce/magento-graphql": "^2.104.11",
|
|
30
|
+
"@graphcommerce/magento-store": "^3.3.20",
|
|
31
|
+
"@graphcommerce/next-ui": "^3.21.3",
|
|
32
|
+
"@graphcommerce/react-hook-form": "^2.104.6",
|
|
33
33
|
"@lingui/macro": "^3.13.0",
|
|
34
34
|
"@material-ui/core": "^4.12.3",
|
|
35
35
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
36
36
|
"clsx": "^1.1.1",
|
|
37
|
-
"framer-motion": "^5.5.
|
|
37
|
+
"framer-motion": "^5.5.5",
|
|
38
38
|
"next": "^12.0.7",
|
|
39
39
|
"react": "^17.0.2",
|
|
40
40
|
"react-dom": "^17.0.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "7cfbdb5a042e271252c8b9729393e084002a321e"
|
|
43
43
|
}
|