@graphcommerce/magento-cart 3.5.4 → 3.5.5
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/components/CartFab/CartFab.tsx +24 -12
- package/package.json +5 -5
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
FixedFab,
|
|
2
3
|
iconShoppingBag,
|
|
4
|
+
responsiveVal,
|
|
3
5
|
StyledBadge,
|
|
4
6
|
SvgImageSimple,
|
|
5
|
-
FixedFab,
|
|
6
7
|
useFixedFabAnimation,
|
|
8
|
+
UseStyles,
|
|
7
9
|
} from '@graphcommerce/next-ui'
|
|
8
10
|
import { Fab, FabProps, makeStyles, NoSsr, Theme } from '@material-ui/core'
|
|
9
11
|
import clsx from 'clsx'
|
|
@@ -14,24 +16,34 @@ import { useCartQuery } from '../../hooks/useCartQuery'
|
|
|
14
16
|
import { CartFabDocument } from './CartFab.gql'
|
|
15
17
|
import { CartTotalQuantityFragment } from './CartTotalQuantity.gql'
|
|
16
18
|
|
|
19
|
+
const useStyles = makeStyles(
|
|
20
|
+
(theme: Theme) => ({
|
|
21
|
+
fab: {
|
|
22
|
+
boxShadow: 'none',
|
|
23
|
+
background: theme.palette.background.default,
|
|
24
|
+
[theme.breakpoints.down('sm')]: {
|
|
25
|
+
width: responsiveVal(42, 56),
|
|
26
|
+
height: responsiveVal(42, 56),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
{
|
|
31
|
+
name: 'CartFab',
|
|
32
|
+
},
|
|
33
|
+
)
|
|
34
|
+
|
|
17
35
|
export type CartFabProps = {
|
|
18
36
|
icon?: React.ReactNode
|
|
19
|
-
} & Omit<FabProps, 'children' | 'aria-label'>
|
|
37
|
+
} & Omit<FabProps, 'children' | 'aria-label'> &
|
|
38
|
+
UseStyles<typeof useStyles>
|
|
20
39
|
|
|
21
40
|
type CartFabContentProps = CartFabProps & CartTotalQuantityFragment
|
|
22
41
|
|
|
23
|
-
const useStyles = makeStyles((theme: Theme) => ({
|
|
24
|
-
fab: {
|
|
25
|
-
boxShadow: 'none',
|
|
26
|
-
background: theme.palette.background.default,
|
|
27
|
-
},
|
|
28
|
-
}))
|
|
29
|
-
|
|
30
42
|
function CartFabContent(props: CartFabContentProps) {
|
|
31
|
-
const { total_quantity, icon,
|
|
32
|
-
const classes = useStyles()
|
|
43
|
+
const { total_quantity, icon, ...fabProps } = props
|
|
33
44
|
const cartIcon = icon ?? <SvgImageSimple src={iconShoppingBag} loading='eager' size='large' />
|
|
34
45
|
const { boxShadow } = useFixedFabAnimation()
|
|
46
|
+
const classes = useStyles(props)
|
|
35
47
|
|
|
36
48
|
return (
|
|
37
49
|
<m.div style={{ boxShadow, width: 'inherit', borderRadius: 'inherit' }}>
|
|
@@ -40,7 +52,7 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
40
52
|
aria-label='Cart'
|
|
41
53
|
color='inherit'
|
|
42
54
|
size='large'
|
|
43
|
-
|
|
55
|
+
classes={{ root: classes.fab }}
|
|
44
56
|
{...fabProps}
|
|
45
57
|
>
|
|
46
58
|
{total_quantity > 0 ? (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.5",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@graphcommerce/framer-scroller": "^1.0.1",
|
|
25
25
|
"@graphcommerce/graphql": "^2.105.3",
|
|
26
26
|
"@graphcommerce/image": "^2.105.2",
|
|
27
|
-
"@graphcommerce/magento-customer": "^3.4.
|
|
27
|
+
"@graphcommerce/magento-customer": "^3.4.5",
|
|
28
28
|
"@graphcommerce/magento-graphql": "^2.104.3",
|
|
29
|
-
"@graphcommerce/magento-store": "^3.2.
|
|
30
|
-
"@graphcommerce/next-ui": "^3.
|
|
29
|
+
"@graphcommerce/magento-store": "^3.2.5",
|
|
30
|
+
"@graphcommerce/next-ui": "^3.13.0",
|
|
31
31
|
"@graphcommerce/react-hook-form": "^2.103.0",
|
|
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": "5a9758c5144ecc75d5a04350d40cfe27cfd8212d"
|
|
42
42
|
}
|