@graphcommerce/magento-product 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.
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { responsiveVal, Row, SectionContainer, UseStyles } from '@graphcommerce/next-ui'
|
|
2
2
|
import { makeStyles, Theme } from '@material-ui/core'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
import { ProductSpecsFragment } from './ProductSpecs.gql'
|
|
4
5
|
|
|
5
6
|
const useStyles = makeStyles((theme: Theme) => ({
|
|
7
|
+
root: {
|
|
8
|
+
...theme.typography.subtitle1,
|
|
9
|
+
},
|
|
10
|
+
sectionHeaderWrapper: {
|
|
11
|
+
marginBottom: theme.spacings.md,
|
|
12
|
+
},
|
|
6
13
|
specs: {
|
|
7
14
|
display: 'grid',
|
|
8
15
|
justifyContent: 'start',
|
|
@@ -21,10 +28,12 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|
|
21
28
|
},
|
|
22
29
|
}))
|
|
23
30
|
|
|
24
|
-
export type ProductSpecsProps = ProductSpecsFragment & UseStyles<
|
|
31
|
+
export type ProductSpecsProps = ProductSpecsFragment & { title?: string } & UseStyles<
|
|
32
|
+
typeof useStyles
|
|
33
|
+
>
|
|
25
34
|
|
|
26
35
|
export default function ProductSpecs(props: ProductSpecsProps) {
|
|
27
|
-
const { aggregations } = props
|
|
36
|
+
const { aggregations, title } = props
|
|
28
37
|
const classes = useStyles(props)
|
|
29
38
|
const filter = ['price', 'category_id', 'size', 'new', 'sale', 'color']
|
|
30
39
|
const specs = aggregations?.filter(
|
|
@@ -36,17 +45,24 @@ export default function ProductSpecs(props: ProductSpecsProps) {
|
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
return (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
<Row className={classes.root}>
|
|
49
|
+
<SectionContainer
|
|
50
|
+
labelLeft={title}
|
|
51
|
+
classes={{ sectionHeaderWrapper: classes.sectionHeaderWrapper }}
|
|
52
|
+
>
|
|
53
|
+
<ul className={classes.specs}>
|
|
54
|
+
{specs?.map((aggregation) => (
|
|
55
|
+
<li key={aggregation?.attribute_code}>
|
|
56
|
+
<div>{aggregation?.label}</div>
|
|
57
|
+
<div className={classes.options}>
|
|
58
|
+
{aggregation?.options?.map((option) => (
|
|
59
|
+
<span key={option?.label}>{option?.label === '1' ? 'Yes' : option?.label}</span>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
</li>
|
|
63
|
+
))}
|
|
64
|
+
</ul>
|
|
65
|
+
</SectionContainer>
|
|
66
|
+
</Row>
|
|
51
67
|
)
|
|
52
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.5",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -24,9 +24,9 @@
|
|
|
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-cart": "^3.5.
|
|
28
|
-
"@graphcommerce/magento-store": "^3.2.
|
|
29
|
-
"@graphcommerce/next-ui": "^3.
|
|
27
|
+
"@graphcommerce/magento-cart": "^3.5.5",
|
|
28
|
+
"@graphcommerce/magento-store": "^3.2.5",
|
|
29
|
+
"@graphcommerce/next-ui": "^3.13.0",
|
|
30
30
|
"@graphql-typed-document-node/core": "^3.1.0",
|
|
31
31
|
"@material-ui/core": "^4.12.3",
|
|
32
32
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"schema-dts": "^1.0.0",
|
|
39
39
|
"type-fest": "^2.5.1"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "5a9758c5144ecc75d5a04350d40cfe27cfd8212d"
|
|
42
42
|
}
|