@graphcommerce/magento-newsletter 2.0.20 → 2.0.23

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,34 @@
1
1
  # Change Log
2
2
 
3
+ ## 2.0.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`858a3b3a3`](https://github.com/graphcommerce-org/graphcommerce/commit/858a3b3a3601cd00491219daf45557c2f1cc804b)]:
8
+ - @graphcommerce/react-hook-form@3.2.0
9
+ - @graphcommerce/magento-cart@4.3.4
10
+ - @graphcommerce/magento-customer@4.4.2
11
+
12
+ ## 2.0.22
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`238aa4d34`](https://github.com/graphcommerce-org/graphcommerce/commit/238aa4d3478773b8cb0973f4112c9829e59e16d6), [`afc67103d`](https://github.com/graphcommerce-org/graphcommerce/commit/afc67103d0e00583e274465036fd287537f95e79)]:
17
+ - @graphcommerce/magento-customer@4.4.1
18
+ - @graphcommerce/next-ui@4.8.3
19
+ - @graphcommerce/magento-cart@4.3.3
20
+
21
+ ## 2.0.21
22
+
23
+ ### Patch Changes
24
+
25
+ - [#1485](https://github.com/graphcommerce-org/graphcommerce/pull/1485) [`d6262de71`](https://github.com/graphcommerce-org/graphcommerce/commit/d6262de71d2254a2b0b492e1a60f9e141767470e) Thanks [@paales](https://github.com/paales)! - move to useCustomerSession instead of using the tokenquery directly and fix ssr issues
26
+
27
+ - Updated dependencies [[`d6262de71`](https://github.com/graphcommerce-org/graphcommerce/commit/d6262de71d2254a2b0b492e1a60f9e141767470e), [`c8c246b8a`](https://github.com/graphcommerce-org/graphcommerce/commit/c8c246b8aaab0621b68a2fca2a1c529a56fad962), [`e3005fe63`](https://github.com/graphcommerce-org/graphcommerce/commit/e3005fe6306093d47b08c6756c21c8175649e30b)]:
28
+ - @graphcommerce/magento-customer@4.4.0
29
+ - @graphcommerce/magento-cart@4.3.2
30
+ - @graphcommerce/next-ui@4.8.2
31
+
3
32
  ## 2.0.20
4
33
 
5
34
  ### Patch Changes
@@ -1,6 +1,5 @@
1
- import { useQuery } from '@graphcommerce/graphql'
2
1
  import { useCartQuery } from '@graphcommerce/magento-cart'
3
- import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
2
+ import { useCustomerSession } from '@graphcommerce/magento-customer'
4
3
  import { extendableComponent } from '@graphcommerce/next-ui'
5
4
  import { Trans } from '@lingui/react'
6
5
  import { Box, SxProps, Theme, Typography } from '@mui/material'
@@ -12,17 +11,16 @@ type SignupNewsletterProps = { sx?: SxProps<Theme> }
12
11
 
13
12
  const name = 'SignupNewsletter' as const
14
13
 
15
- type OwnerState = { isCustomer: boolean }
14
+ type OwnerState = { loggedIn: boolean }
16
15
  const parts = ['signup', 'text', 'signupForm'] as const
17
16
  const { withState } = extendableComponent<OwnerState, typeof name, typeof parts>(name, parts)
18
17
 
19
18
  export function SignupNewsletter(props: SignupNewsletterProps) {
20
19
  const { sx = [] } = props
21
20
  const { data: cartData } = useCartQuery(GetCartEmailDocument, { allowUrl: true })
22
- const { data: customerTokenData } = useQuery(CustomerTokenDocument)
23
- const isCustomer = Boolean(customerTokenData?.customerToken)
21
+ const { loggedIn } = useCustomerSession()
24
22
 
25
- const classes = withState({ isCustomer })
23
+ const classes = withState({ loggedIn })
26
24
 
27
25
  return (
28
26
  <Box
@@ -46,7 +44,7 @@ export function SignupNewsletter(props: SignupNewsletterProps) {
46
44
  gridTemplateColumns: '2fr 1fr',
47
45
  },
48
46
 
49
- '&.isCustomer': {
47
+ '&.loggedIn': {
50
48
  background: theme.palette.background.image,
51
49
  },
52
50
  }),
@@ -66,7 +64,7 @@ export function SignupNewsletter(props: SignupNewsletterProps) {
66
64
  [theme.breakpoints.up('sm')]: { justifySelf: 'end' },
67
65
  })}
68
66
  >
69
- {isCustomer ? (
67
+ {loggedIn ? (
70
68
  <CustomerNewsletterToggle color='primary' />
71
69
  ) : (
72
70
  <GuestNewsletterToggle color='primary' />
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-newsletter",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "2.0.20",
5
+ "version": "2.0.23",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -19,10 +19,10 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@graphcommerce/graphql": "3.1.3",
22
- "@graphcommerce/magento-cart": "4.3.1",
23
- "@graphcommerce/magento-customer": "4.3.2",
24
- "@graphcommerce/next-ui": "4.8.1",
25
- "@graphcommerce/react-hook-form": "3.1.3"
22
+ "@graphcommerce/magento-cart": "4.3.4",
23
+ "@graphcommerce/magento-customer": "4.4.2",
24
+ "@graphcommerce/next-ui": "4.8.3",
25
+ "@graphcommerce/react-hook-form": "3.2.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@lingui/react": "^3.13.2",