@graphcommerce/magento-cart 3.5.12 → 3.6.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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.6.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.5.15...@graphcommerce/magento-cart@3.6.0) (2021-11-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * added dutch translations ([59a4fd9](https://github.com/ho-nl/m2-pwa/commit/59a4fd9d170d9454c443b4723fdf5da0196cec7d))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.5.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.5.8...@graphcommerce/magento-cart@3.5.9) (2021-11-04)
7
18
 
8
19
 
@@ -70,61 +70,52 @@ export default function CartAgreementsForm(props: CartAgreementsFormProps) {
70
70
  <form noValidate onSubmit={submit} name='cartAgreements'>
71
71
  <div className={classes.formInner}>
72
72
  {data?.checkoutAgreements &&
73
- sortedAgreements?.map(
74
- (agreement) =>
75
- agreement && (
76
- <React.Fragment key={agreement.agreement_id}>
77
- {agreement.mode === 'MANUAL' ? (
78
- <>
79
- <Controller
80
- defaultValue={''}
81
- name={String(agreement.agreement_id)}
82
- control={control}
83
- rules={{ required: 'You have to agree in order to proceed' }}
84
- render={({
85
- field: { onChange, value, name, ref, onBlur },
86
- fieldState: { error },
87
- }) => (
88
- <FormControl
89
- error={!!formState.errors[String(agreement.agreement_id)]}
90
- classes={{ root: classes.formControlRoot }}
91
- >
92
- <FormControlLabel
93
- control={<Checkbox color='secondary' required={true} />}
94
- label={
95
- <PageLink
96
- href={`/legal/view/${agreement.name
97
- ?.toLowerCase()
98
- .replaceAll(' ', '-')}`}
99
- passHref
100
- >
101
- <Link color='secondary'>{agreement.checkbox_text}</Link>
102
- </PageLink>
103
- }
104
- checked={!!value}
105
- inputRef={ref}
106
- onBlur={onBlur}
107
- name={name}
108
- onChange={(e) => onChange(e as React.ChangeEvent<HTMLInputElement>)}
109
- />
110
- {error?.message && <FormHelperText>{error.message}</FormHelperText>}
111
- </FormControl>
112
- )}
113
- />
114
- </>
115
- ) : (
116
- <div className={classes.manualCheck}>
117
- <PageLink
118
- href={`/legal/view/${agreement.name?.toLowerCase().replaceAll(' ', '-')}`}
119
- passHref
73
+ sortedAgreements?.map((agreement) => {
74
+ if (!agreement) return null
75
+ const href = `/checkout/terms/${agreement.name?.toLowerCase().replace(/\s+/g, '-')}`
76
+ return (
77
+ <React.Fragment key={agreement.agreement_id}>
78
+ {agreement.mode === 'MANUAL' ? (
79
+ <Controller
80
+ defaultValue={''}
81
+ name={String(agreement.agreement_id)}
82
+ control={control}
83
+ rules={{ required: 'You have to agree in order to proceed' }}
84
+ render={({
85
+ field: { onChange, value, name, ref, onBlur },
86
+ fieldState: { error },
87
+ }) => (
88
+ <FormControl
89
+ error={!!formState.errors[String(agreement.agreement_id)]}
90
+ classes={{ root: classes.formControlRoot }}
120
91
  >
121
- <Link color='secondary'>{agreement.checkbox_text}</Link>
122
- </PageLink>
123
- </div>
124
- )}
125
- </React.Fragment>
126
- ),
127
- )}
92
+ <FormControlLabel
93
+ control={<Checkbox color='secondary' required={true} />}
94
+ label={
95
+ <PageLink href={href} passHref>
96
+ <Link color='secondary'>{agreement.checkbox_text}</Link>
97
+ </PageLink>
98
+ }
99
+ checked={!!value}
100
+ inputRef={ref}
101
+ onBlur={onBlur}
102
+ name={name}
103
+ onChange={(e) => onChange(e as React.ChangeEvent<HTMLInputElement>)}
104
+ />
105
+ {error?.message && <FormHelperText>{error.message}</FormHelperText>}
106
+ </FormControl>
107
+ )}
108
+ />
109
+ ) : (
110
+ <div className={classes.manualCheck}>
111
+ <PageLink href={href} passHref>
112
+ <Link color='secondary'>{agreement.checkbox_text}</Link>
113
+ </PageLink>
114
+ </div>
115
+ )}
116
+ </React.Fragment>
117
+ )
118
+ })}
128
119
  </div>
129
120
  </form>
130
121
  </FormDiv>
@@ -1,4 +1,5 @@
1
- import { iconSadFace, FullPageMessage, SvgImageSimple } from '@graphcommerce/next-ui'
1
+ import { FullPageMessage, SvgImageSimple, iconSadFace } from '@graphcommerce/next-ui'
2
+ import { t, Trans } from '@lingui/macro'
2
3
  import { Button } from '@material-ui/core'
3
4
  import Link from 'next/link'
4
5
  import React from 'react'
@@ -9,17 +10,17 @@ export default function EmptyCart(props: EmptyCartProps) {
9
10
 
10
11
  return (
11
12
  <FullPageMessage
12
- title='Your cart is empty'
13
+ title={t`Your cart is empty`}
13
14
  icon={<SvgImageSimple src={iconSadFace} size='xxl' />}
14
15
  button={
15
16
  <Link href='/' passHref>
16
17
  <Button variant='contained' color='primary' size='large'>
17
- Continue shopping
18
+ <Trans>Continue shopping</Trans>
18
19
  </Button>
19
20
  </Link>
20
21
  }
21
22
  >
22
- {children ?? <>Discover our collection and add items to your basket!</>}
23
+ {children ?? <Trans>Discover our collection and add items to your basket!</Trans>}
23
24
  </FullPageMessage>
24
25
  )
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-cart",
3
- "version": "3.5.12",
3
+ "version": "3.6.0",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -14,29 +14,29 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@graphcommerce/browserslist-config-pwa": "^3.0.2",
17
- "@graphcommerce/eslint-config-pwa": "^3.1.3",
18
- "@graphcommerce/prettier-config-pwa": "^3.0.3",
17
+ "@graphcommerce/eslint-config-pwa": "^3.1.4",
18
+ "@graphcommerce/prettier-config-pwa": "^3.0.4",
19
19
  "@graphcommerce/typescript-config-pwa": "^3.1.1",
20
20
  "@playwright/test": "^1.16.2"
21
21
  },
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.4.16",
24
- "@graphcommerce/framer-scroller": "^1.0.2",
25
- "@graphcommerce/graphql": "^2.105.3",
26
- "@graphcommerce/image": "^2.105.2",
27
- "@graphcommerce/magento-customer": "^3.4.12",
28
- "@graphcommerce/magento-graphql": "^2.104.3",
29
- "@graphcommerce/magento-store": "^3.2.11",
30
- "@graphcommerce/next-ui": "^3.14.3",
31
- "@graphcommerce/react-hook-form": "^2.103.0",
24
+ "@graphcommerce/framer-scroller": "^1.0.3",
25
+ "@graphcommerce/graphql": "^2.105.4",
26
+ "@graphcommerce/image": "^2.105.3",
27
+ "@graphcommerce/magento-customer": "^3.5.0",
28
+ "@graphcommerce/magento-graphql": "^2.104.4",
29
+ "@graphcommerce/magento-store": "^3.2.15",
30
+ "@graphcommerce/next-ui": "^3.14.7",
31
+ "@graphcommerce/react-hook-form": "^2.103.1",
32
32
  "@graphql-typed-document-node/core": "^3.1.0",
33
33
  "@material-ui/core": "^4.12.3",
34
34
  "@material-ui/lab": "^4.0.0-alpha.60",
35
35
  "clsx": "^1.1.1",
36
36
  "framer-motion": "^4.1.17",
37
- "next": "^12.0.2",
37
+ "next": "^12.0.3",
38
38
  "react": "^17.0.2",
39
39
  "react-dom": "^17.0.2"
40
40
  },
41
- "gitHead": "c0165c35074fb4f6e8ddf64d3d12b8cfbb169c1d"
41
+ "gitHead": "c9d9c589d7e118318f3b44d8322e9bc71feca484"
42
42
  }