@graphcommerce/magento-product 3.5.4 → 3.5.8

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 { UseStyles, responsiveVal } from '@graphcommerce/next-ui'
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<typeof 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
- <ul className={classes.specs}>
40
- {specs?.map((aggregation) => (
41
- <li key={aggregation?.attribute_code}>
42
- <div>{aggregation?.label}</div>
43
- <div className={classes.options}>
44
- {aggregation?.options?.map((option) => (
45
- <span key={option?.label}>{option?.label === '1' ? 'Yes' : option?.label}</span>
46
- ))}
47
- </div>
48
- </li>
49
- ))}
50
- </ul>
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.4",
3
+ "version": "3.5.8",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.4.16",
24
- "@graphcommerce/framer-scroller": "^1.0.1",
24
+ "@graphcommerce/framer-scroller": "^1.0.2",
25
25
  "@graphcommerce/graphql": "^2.105.3",
26
26
  "@graphcommerce/image": "^2.105.2",
27
- "@graphcommerce/magento-cart": "^3.5.4",
28
- "@graphcommerce/magento-store": "^3.2.4",
29
- "@graphcommerce/next-ui": "^3.12.4",
27
+ "@graphcommerce/magento-cart": "^3.5.8",
28
+ "@graphcommerce/magento-store": "^3.2.8",
29
+ "@graphcommerce/next-ui": "^3.14.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": "7aca802dd74632aa2f474eae2d93bd563490fd90"
41
+ "gitHead": "2da9f0e580a1eddf4203a375ccd1444c40401db1"
42
42
  }