@graphcommerce/magento-product 4.2.0 → 4.3.0
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
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1256](https://github.com/graphcommerce-org/graphcommerce/pull/1256) [`669a17a97`](https://github.com/graphcommerce-org/graphcommerce/commit/669a17a973c47c00fed4a649a9da0bfc5670c5da) Thanks [@timhofman](https://github.com/timhofman)! - Wishlist
|
|
8
|
+
|
|
3
9
|
## 4.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -22,6 +22,7 @@ const { classes, selectors } = extendableComponent('ProductAddToCart', [
|
|
|
22
22
|
'button',
|
|
23
23
|
'price',
|
|
24
24
|
'divider',
|
|
25
|
+
'buttonWrapper',
|
|
25
26
|
] as const)
|
|
26
27
|
|
|
27
28
|
export type AddToCartProps = React.ComponentProps<typeof ProductAddToCart>
|
|
@@ -31,10 +32,11 @@ export function ProductAddToCart(
|
|
|
31
32
|
variables: Omit<ProductAddToCartMutationVariables, 'cartId'>
|
|
32
33
|
name: string
|
|
33
34
|
price: MoneyProps
|
|
35
|
+
additionalButtons?: React.ReactNode
|
|
34
36
|
children?: React.ReactNode
|
|
35
37
|
} & Omit<ButtonProps, 'type' | 'name'>,
|
|
36
38
|
) {
|
|
37
|
-
const { name, children, variables, price, sx, ...buttonProps } = props
|
|
39
|
+
const { name, children, variables, price, sx, additionalButtons, ...buttonProps } = props
|
|
38
40
|
|
|
39
41
|
const form = useFormGqlMutationCart(ProductAddToCartDocument, {
|
|
40
42
|
defaultValues: { ...variables },
|
|
@@ -69,21 +71,32 @@ export function ProductAddToCart(
|
|
|
69
71
|
size='small'
|
|
70
72
|
/>
|
|
71
73
|
{children}
|
|
72
|
-
<
|
|
73
|
-
type='submit'
|
|
74
|
-
className={classes.button}
|
|
75
|
-
loading={formState.isSubmitting}
|
|
76
|
-
color='primary'
|
|
77
|
-
variant='pill'
|
|
78
|
-
size='large'
|
|
74
|
+
<Box
|
|
79
75
|
sx={(theme) => ({
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
display: 'flex',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
columnGap: theme.spacings.xs,
|
|
82
79
|
})}
|
|
83
|
-
{
|
|
80
|
+
className={classes.buttonWrapper}
|
|
84
81
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
82
|
+
<Button
|
|
83
|
+
type='submit'
|
|
84
|
+
className={classes.button}
|
|
85
|
+
loading={formState.isSubmitting}
|
|
86
|
+
color='primary'
|
|
87
|
+
variant='pill'
|
|
88
|
+
size='large'
|
|
89
|
+
sx={(theme) => ({
|
|
90
|
+
marginTop: theme.spacings.sm,
|
|
91
|
+
marginBottom: theme.spacings.sm,
|
|
92
|
+
width: '100%',
|
|
93
|
+
})}
|
|
94
|
+
{...buttonProps}
|
|
95
|
+
>
|
|
96
|
+
<Trans>Add to Cart</Trans>
|
|
97
|
+
</Button>
|
|
98
|
+
{additionalButtons}
|
|
99
|
+
</Box>
|
|
87
100
|
|
|
88
101
|
<ApolloCartErrorAlert error={error} />
|
|
89
102
|
|
package/components/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './JsonLdProduct/jsonLdProduct'
|
|
2
2
|
export * from './ProductAddToCart/ProductAddToCart'
|
|
3
|
+
export * from './ProductAddToCart/ProductAddToCart.gql'
|
|
3
4
|
export * from './ProductList/ProductList.gql'
|
|
4
5
|
export * from './ProductListCount/ProductListCount'
|
|
5
6
|
export * from './ProductListFilters/ProductListFilters'
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.3.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|