@graphcommerce/magento-cart 3.0.11 → 3.1.1
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 +22 -0
- package/components/CartFab/CartFab.tsx +17 -6
- package/components/CartSummary/index.tsx +14 -27
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.1.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.1.0...@graphcommerce/magento-cart@3.1.1) (2021-10-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **cart-fab:** box shadow in safari ([4eb316d](https://github.com/ho-nl/m2-pwa/commit/4eb316dd0f2ab7ee2806a3acdb306af1eb72854b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.1.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.0.13...@graphcommerce/magento-cart@3.1.0) (2021-10-05)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **checkout-shipping:** edit shipping address link ([b598008](https://github.com/ho-nl/m2-pwa/commit/b598008ffccb499fe0109ee557e08d557cf20d6e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [3.0.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.0.8...@graphcommerce/magento-cart@3.0.9) (2021-09-30)
|
|
7
29
|
|
|
8
30
|
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
iconShoppingBag,
|
|
3
3
|
StyledBadge,
|
|
4
4
|
SvgImageSimple,
|
|
5
|
+
FixedFab,
|
|
5
6
|
useFixedFabAnimation,
|
|
6
7
|
} from '@graphcommerce/next-ui'
|
|
7
8
|
import { Fab, FabProps, NoSsr } from '@material-ui/core'
|
|
@@ -23,12 +24,20 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
23
24
|
const cartIcon = icon ?? (
|
|
24
25
|
<SvgImageSimple src={iconShoppingBag} alt='Shopping Bag' loading='eager' size='large' />
|
|
25
26
|
)
|
|
26
|
-
const {
|
|
27
|
+
const { boxShadow } = useFixedFabAnimation()
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<m.div style={{
|
|
30
|
+
<m.div style={{ boxShadow, width: 'inherit', borderRadius: 'inherit' }}>
|
|
30
31
|
<PageLink href='/cart' passHref>
|
|
31
|
-
<Fab
|
|
32
|
+
<Fab
|
|
33
|
+
aria-label='Cart'
|
|
34
|
+
color='inherit'
|
|
35
|
+
size='large'
|
|
36
|
+
style={{
|
|
37
|
+
boxShadow: 'none',
|
|
38
|
+
}}
|
|
39
|
+
{...fabProps}
|
|
40
|
+
>
|
|
32
41
|
{total_quantity > 0 ? (
|
|
33
42
|
<StyledBadge color='primary' variant='dot'>
|
|
34
43
|
{cartIcon}
|
|
@@ -60,8 +69,10 @@ export default function CartFab(props: CartFabProps) {
|
|
|
60
69
|
const qty = data?.cart?.total_quantity ?? 0
|
|
61
70
|
|
|
62
71
|
return (
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
|
|
72
|
+
<FixedFab>
|
|
73
|
+
<NoSsr fallback={<CartFabContent {...props} total_quantity={0} />}>
|
|
74
|
+
<CartFabContent total_quantity={qty} {...props} />
|
|
75
|
+
</NoSsr>
|
|
76
|
+
</FixedFab>
|
|
66
77
|
)
|
|
67
78
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useHistoryLink } from '@graphcommerce/framer-next-pages'
|
|
1
2
|
import { SectionContainer, UseStyles } from '@graphcommerce/next-ui'
|
|
2
3
|
import { Link, makeStyles, Theme, Typography } from '@material-ui/core'
|
|
3
4
|
import PageLink from 'next/link'
|
|
@@ -53,6 +54,10 @@ export default function CartSummary(props: CartSummaryProps) {
|
|
|
53
54
|
|
|
54
55
|
const { email, shipping_addresses, billing_address } = data.cart
|
|
55
56
|
|
|
57
|
+
const { href: historyHref, onClick: historyOnClick } = useHistoryLink({
|
|
58
|
+
href: '/checkout',
|
|
59
|
+
})
|
|
60
|
+
|
|
56
61
|
return (
|
|
57
62
|
<div className={classes.root}>
|
|
58
63
|
<div className={classes.detailsContainer}>
|
|
@@ -61,15 +66,6 @@ export default function CartSummary(props: CartSummaryProps) {
|
|
|
61
66
|
variantLeft='h5'
|
|
62
67
|
labelLeft='Confirmation + Track & trace'
|
|
63
68
|
classes={{ sectionHeaderWrapper: classes.sectionHeaderWrapper }}
|
|
64
|
-
// labelRight={
|
|
65
|
-
// editable ? (
|
|
66
|
-
// <PageLink href='/checkout/edit' passHref>
|
|
67
|
-
// <Link color='secondary' variant='body2'>
|
|
68
|
-
// Edit
|
|
69
|
-
// </Link>
|
|
70
|
-
// </PageLink>
|
|
71
|
-
// ) : undefined
|
|
72
|
-
// }
|
|
73
69
|
/>
|
|
74
70
|
<Typography variant='body1'>{email || ''}</Typography>
|
|
75
71
|
</div>
|
|
@@ -78,15 +74,6 @@ export default function CartSummary(props: CartSummaryProps) {
|
|
|
78
74
|
variantLeft='h5'
|
|
79
75
|
labelLeft='Shipping method'
|
|
80
76
|
classes={{ sectionHeaderWrapper: classes.sectionHeaderWrapper }}
|
|
81
|
-
// labelRight={
|
|
82
|
-
// editable ? (
|
|
83
|
-
// <PageLink href='/checkout/edit/shipping' passHref>
|
|
84
|
-
// <Link color='secondary' variant='body2'>
|
|
85
|
-
// Edit
|
|
86
|
-
// </Link>
|
|
87
|
-
// </PageLink>
|
|
88
|
-
// ) : undefined
|
|
89
|
-
// }
|
|
90
77
|
/>
|
|
91
78
|
<Typography variant='body1'>
|
|
92
79
|
{shipping_addresses?.[0]?.selected_shipping_method?.carrier_title}
|
|
@@ -100,15 +87,15 @@ export default function CartSummary(props: CartSummaryProps) {
|
|
|
100
87
|
variantLeft='h5'
|
|
101
88
|
labelLeft='Shipping address'
|
|
102
89
|
classes={{ sectionHeaderWrapper: classes.sectionHeaderWrapper }}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
90
|
+
labelRight={
|
|
91
|
+
editable ? (
|
|
92
|
+
<PageLink href={historyHref} passHref>
|
|
93
|
+
<Link color='secondary' variant='body2' onClick={historyOnClick}>
|
|
94
|
+
Edit
|
|
95
|
+
</Link>
|
|
96
|
+
</PageLink>
|
|
97
|
+
) : undefined
|
|
98
|
+
}
|
|
112
99
|
/>
|
|
113
100
|
<CartAddressMultiLine {...shipping_addresses[0]} />
|
|
114
101
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@graphcommerce/framer-scroller": "^0.2.5",
|
|
25
25
|
"@graphcommerce/graphql": "^2.103.4",
|
|
26
26
|
"@graphcommerce/image": "^2.104.5",
|
|
27
|
-
"@graphcommerce/magento-customer": "^3.0.
|
|
27
|
+
"@graphcommerce/magento-customer": "^3.0.14",
|
|
28
28
|
"@graphcommerce/magento-graphql": "^2.103.4",
|
|
29
|
-
"@graphcommerce/magento-store": "^3.0.
|
|
30
|
-
"@graphcommerce/next-ui": "^3.1.
|
|
29
|
+
"@graphcommerce/magento-store": "^3.0.12",
|
|
30
|
+
"@graphcommerce/next-ui": "^3.1.4",
|
|
31
31
|
"@graphcommerce/react-hook-form": "^2.102.4",
|
|
32
32
|
"@graphql-typed-document-node/core": "^3.1.0",
|
|
33
33
|
"@material-ui/core": "^4.12.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"react": "^17.0.2",
|
|
39
39
|
"react-dom": "^17.0.2"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "3cdea8f8c2a7a717955e81634ffdf769a1317584"
|
|
42
42
|
}
|