11import * as React from "react" ;
22import * as ReactDOM from "react-dom" ;
33
4- import {
5- ConsentManager ,
6- ConsentManagerConfig ,
7- ConsentManagerForm ,
8- PrivacyShield ,
9- } from "@consent-manager/core" ;
10-
11- const consentManagerConfig : ConsentManagerConfig = {
12- integrations : [
13- {
14- id : "video-platform" ,
15- title : "Video Inc." ,
16- category : "social" ,
17- Icon : ( ) => (
18- < svg
19- className = "w-6 h-6"
20- fill = "none"
21- stroke = "currentColor"
22- viewBox = "0 0 24 24"
23- xmlns = "http://www.w3.org/2000/svg"
24- >
25- < path
26- strokeLinecap = "round"
27- strokeLinejoin = "round"
28- strokeWidth = { 2 }
29- d = "M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z"
30- />
31- </ svg >
32- ) ,
33- description : "Video Inc. is a popular service to share clips of cats." ,
34- } ,
35- {
36- id : "integration-with-wrapper" ,
37- title : "Red Box Ltd." ,
38- category : "statistics" ,
39- Icon : ( ) => (
40- < svg
41- className = "w-6 h-6"
42- fill = "currentColor"
43- viewBox = "0 0 20 20"
44- xmlns = "http://www.w3.org/2000/svg"
45- >
46- < path
47- fillRule = "evenodd"
48- d = "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
49- clipRule = "evenodd"
50- />
51- </ svg >
52- ) ,
53- description :
54- "Adds red borders around your content, demonstrates use of components that do e.g. click tracking" ,
55- WrapperComponent : ( { children } ) => (
56- < div style = { { border : "3px solid red" } } > { children } </ div >
57- ) ,
58- } ,
59- ] ,
60- } ;
4+ import { PrivacyShield } from "@consent-manager/core" ;
5+ import { ConsentManagerWrapper } from "./consent-manager" ;
616
627const VideoPlatform : React . FC < { id : string } > = ( { id } ) => {
638 return (
@@ -75,24 +20,13 @@ const VideoPlatform: React.FC<{ id: string }> = ({ id }) => {
7520} ;
7621
7722const App = ( ) => {
78- const storage = React . useState ( {
79- decisions : { } ,
80- } ) ;
81-
8223 return (
83- < div >
84- < ConsentManager config = { consentManagerConfig } store = { storage } >
85- < main style = { { margin : "4em auto" , maxWidth : "420px" } } >
86- < h1 > Your content:</ h1 >
87- < PrivacyShield id = "video-platform" >
88- < VideoPlatform id = "rick-roll" />
89- </ PrivacyShield >
90- </ main >
91- < aside style = { { backgroundColor : "#eee" , padding : "1em" } } >
92- < ConsentManagerForm />
93- </ aside >
94- </ ConsentManager >
95- </ div >
24+ < ConsentManagerWrapper >
25+ < h1 > Your content:</ h1 >
26+ < PrivacyShield id = "video-platform" >
27+ < VideoPlatform id = "rick-roll" />
28+ </ PrivacyShield >
29+ </ ConsentManagerWrapper >
9630 ) ;
9731} ;
9832
0 commit comments