@graphcommerce/magento-cart 4.6.0 → 4.6.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 +13 -0
- package/components/CartFab/CartFab.tsx +15 -14
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1557](https://github.com/graphcommerce-org/graphcommerce/pull/1557) [`2ce406727`](https://github.com/graphcommerce-org/graphcommerce/commit/2ce406727c01a3367cea26c331d8455748592ce9) Thanks [@paales](https://github.com/paales)! - Solves hydration warning for the CartFab when products are in the cart
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`01f1588c9`](https://github.com/graphcommerce-org/graphcommerce/commit/01f1588c9200bb39dd61146e260bfa2b32060612), [`84428ccab`](https://github.com/graphcommerce-org/graphcommerce/commit/84428ccab8d1d263893766197076651eae68759c), [`c0a7f9427`](https://github.com/graphcommerce-org/graphcommerce/commit/c0a7f9427466f0a3886b2c3ebf2f0aa5d79ee081)]:
|
|
10
|
+
- @graphcommerce/graphql@3.4.3
|
|
11
|
+
- @graphcommerce/magento-customer@4.8.1
|
|
12
|
+
- @graphcommerce/ecommerce-ui@1.1.4
|
|
13
|
+
- @graphcommerce/magento-store@4.2.19
|
|
14
|
+
- @graphcommerce/magento-graphql@3.1.3
|
|
15
|
+
|
|
3
16
|
## 4.6.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WaitForQueries } from '@graphcommerce/ecommerce-ui'
|
|
1
2
|
import {
|
|
2
3
|
extendableComponent,
|
|
3
4
|
iconShoppingBag,
|
|
@@ -69,13 +70,14 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
69
70
|
})}
|
|
70
71
|
{...fabProps}
|
|
71
72
|
>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
<DesktopHeaderBadge
|
|
74
|
+
color='primary'
|
|
75
|
+
variant='dot'
|
|
76
|
+
overlap='circular'
|
|
77
|
+
badgeContent={total_quantity}
|
|
78
|
+
>
|
|
79
|
+
{cartIcon}
|
|
80
|
+
</DesktopHeaderBadge>
|
|
79
81
|
</MotionFab>
|
|
80
82
|
</PageLink>
|
|
81
83
|
<MotionDiv
|
|
@@ -109,15 +111,14 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
109
111
|
* product to the cart. This would mean that it would immediately start executing this query.
|
|
110
112
|
*/
|
|
111
113
|
export function CartFab(props: CartFabProps) {
|
|
112
|
-
const
|
|
114
|
+
const cartQuery = useCartQuery(CartFabDocument, {
|
|
113
115
|
fetchPolicy: 'cache-only',
|
|
114
116
|
nextFetchPolicy: 'cache-first',
|
|
115
117
|
})
|
|
116
|
-
const qty = data?.cart?.total_quantity ?? 0
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
return (
|
|
120
|
+
<WaitForQueries waitFor={cartQuery} fallback={<CartFabContent {...props} total_quantity={0} />}>
|
|
121
|
+
<CartFabContent total_quantity={cartQuery.data?.cart?.total_quantity ?? 0} {...props} />
|
|
122
|
+
</WaitForQueries>
|
|
123
|
+
)
|
|
123
124
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.6.
|
|
5
|
+
"version": "4.6.1",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"@playwright/test": "^1.21.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/ecommerce-ui": "1.1.
|
|
21
|
+
"@graphcommerce/ecommerce-ui": "1.1.4",
|
|
22
22
|
"@graphcommerce/framer-utils": "3.1.4",
|
|
23
23
|
"@graphcommerce/framer-next-pages": "3.2.4",
|
|
24
24
|
"@graphcommerce/framer-scroller": "2.1.24",
|
|
25
|
-
"@graphcommerce/graphql": "3.4.
|
|
25
|
+
"@graphcommerce/graphql": "3.4.3",
|
|
26
26
|
"@graphcommerce/image": "3.1.7",
|
|
27
|
-
"@graphcommerce/magento-customer": "4.8.
|
|
28
|
-
"@graphcommerce/magento-graphql": "3.1.
|
|
29
|
-
"@graphcommerce/magento-store": "4.2.
|
|
27
|
+
"@graphcommerce/magento-customer": "4.8.1",
|
|
28
|
+
"@graphcommerce/magento-graphql": "3.1.3",
|
|
29
|
+
"@graphcommerce/magento-store": "4.2.19",
|
|
30
30
|
"@graphcommerce/next-ui": "4.14.0",
|
|
31
31
|
"@graphcommerce/react-hook-form": "3.3.1"
|
|
32
32
|
},
|