@graphcommerce/googlerecaptcha 9.0.0-canary.114 → 9.0.0-canary.116

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,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.116
4
+
5
+ ## 9.0.0-canary.115
6
+
3
7
  ## 9.0.0-canary.114
4
8
 
5
9
  ## 9.0.0-canary.113
package/index.ts CHANGED
@@ -1,4 +1,2 @@
1
- export * from './components/GoogleRecaptchaV3Script'
2
- export * from './components/GoogleRecaptchaProvider'
3
1
  export * from './link/recaptchaLink'
4
2
  export * from './hooks/useGoogleRecaptcha'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/googlerecaptcha",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.0-canary.114",
5
+ "version": "9.0.0-canary.116",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,11 +15,11 @@
15
15
  "@types/grecaptcha": "^3.0.9"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.114",
19
- "@graphcommerce/graphql": "^9.0.0-canary.114",
20
- "@graphcommerce/next-ui": "^9.0.0-canary.114",
21
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.114",
22
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.114",
18
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.116",
19
+ "@graphcommerce/graphql": "^9.0.0-canary.116",
20
+ "@graphcommerce/next-ui": "^9.0.0-canary.116",
21
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.116",
22
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.116",
23
23
  "@mui/material": "^5.10.16",
24
24
  "graphql": "^16.9.0",
25
25
  "next": "*",
@@ -1,22 +0,0 @@
1
- import React, { useMemo, useState } from 'react'
2
- import type { RecaptchaContext } from '../context/recaptchaContext'
3
- import { recaptchaContext } from '../context/recaptchaContext'
4
- import { GoogleRecaptchaV3Script } from './GoogleRecaptchaV3Script'
5
-
6
- export function GoogleRecaptchaProvider(props: { children: React.ReactNode }) {
7
- const { children } = props
8
-
9
- const [enabled, setEnabled] = useState(false)
10
-
11
- const context: RecaptchaContext = useMemo(
12
- () => ({ enabled, enable: () => setEnabled(true) }),
13
- [enabled],
14
- )
15
-
16
- return (
17
- <recaptchaContext.Provider value={context}>
18
- <GoogleRecaptchaV3Script />
19
- {children}
20
- </recaptchaContext.Provider>
21
- )
22
- }
@@ -1,23 +0,0 @@
1
- import { GlobalStyles } from '@mui/material'
2
- import Script from 'next/script'
3
- import { useContext } from 'react'
4
- import { recaptchaContext } from '../context/recaptchaContext'
5
- import { useGoogleRecaptchaSiteKey } from '../hooks/useGoogleRecaptchaSiteKey'
6
-
7
- export function GoogleRecaptchaV3Script() {
8
- const { enabled } = useContext(recaptchaContext)
9
-
10
- const siteKey = useGoogleRecaptchaSiteKey()
11
- if (!enabled) return null
12
-
13
- return (
14
- <>
15
- <Script
16
- key='google-recaptcha-v3'
17
- strategy='lazyOnload'
18
- src={`https://www.google.com/recaptcha/api.js?render=${siteKey}`}
19
- />
20
- <GlobalStyles styles={{ '.grecaptcha-badge': { visibility: 'hidden' } }} />
21
- </>
22
- )
23
- }