File tree Expand file tree Collapse file tree
gatsby/src/components/consent-manager Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from "react"
22
33import { ConsentManager , ConsentManagerForm } from "@techboi/consent-manager"
4+ import createPersistedState from "use-persisted-state"
45
56import { matomoIntegration } from "@techboi/consent-manager-integration-matomo"
67import { youTubeIntegration } from "@techboi/consent-manager-integration-youtube"
@@ -10,6 +11,10 @@ import "@techboi/consent-manager-interface-unobtrusive-control-ui/dist/unobtrusi
1011
1112import { FallbackComponent } from "./fallback-component"
1213
14+ const useConsentStateStore = createPersistedState (
15+ "consent-manager-gatsby-example"
16+ )
17+
1318const consentManagerConfig = {
1419 integrations : [
1520 matomoIntegration ( {
@@ -42,9 +47,7 @@ const consentManagerConfig = {
4247}
4348
4449export function ConsentManagerWrapper ( { children } ) {
45- const storage = React . useState ( {
46- decisions : { } ,
47- } )
50+ const storage = useConsentStateStore ( )
4851
4952 return (
5053 < ConsentManager
You can’t perform that action at this time.
0 commit comments