-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: restructure to match docs structure
- Loading branch information
Showing
4 changed files
with
103 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
|
||
import { | ||
ConsentManager, | ||
ConsentManagerConfig, | ||
ConsentManagerForm, | ||
} from "@consent-manager/core"; | ||
|
||
const consentManagerConfig: ConsentManagerConfig = { | ||
integrations: [ | ||
{ | ||
id: "video-platform", | ||
title: "Video Inc.", | ||
category: "social", | ||
Icon: () => ( | ||
<svg | ||
className="w-6 h-6" | ||
fill="none" | ||
stroke="currentColor" | ||
viewBox="0 0 24 24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={2} | ||
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" | ||
/> | ||
</svg> | ||
), | ||
description: "Video Inc. is a popular service to share clips of cats.", | ||
}, | ||
{ | ||
id: "integration-with-wrapper", | ||
title: "Red Box Ltd.", | ||
category: "statistics", | ||
Icon: () => ( | ||
<svg | ||
className="w-6 h-6" | ||
fill="currentColor" | ||
viewBox="0 0 20 20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
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" | ||
clipRule="evenodd" | ||
/> | ||
</svg> | ||
), | ||
description: | ||
"Adds red borders around your content, demonstrates use of components that do e.g. click tracking", | ||
WrapperComponent: () => ( | ||
<div style={{ border: "3px solid red", padding: "1rem", textAlign: "center" }}>Very special red box!</div> | ||
), | ||
}, | ||
], | ||
}; | ||
|
||
export const ConsentManagerWrapper:React.FC<{children: React.ReactNode}> = ({children}) => { | ||
const storage = React.useState({ | ||
decisions: {}, | ||
}); | ||
|
||
return ( | ||
<div> | ||
<ConsentManager config={consentManagerConfig} store={storage}> | ||
<main style={{ margin: "4em auto", maxWidth: "420px" }}> | ||
{children} | ||
</main> | ||
<aside style={{ backgroundColor: "#eee", padding: "1em" }}> | ||
<ConsentManagerForm /> | ||
</aside> | ||
</ConsentManager> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters