Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dune cookiebot docs #28

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/ts-scss/dune/cookiebot.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Cookiebot

There is a component for loading Cookiebot:

```tsx
import {Cookiebot} from "@21torr/dune/next/components/Snippet/Cookiebot.js";

<Cookiebot id="..." />
```

There also is a hook to be able to interact with Cookiebot inside of pages:

```tsx
import {useCookiebot} from "@21torr/dune/react/hooks/cookiebot.js";

const cookiebot = useCookiebot();

// check consent levels
console.log(true === cookiebot.consent.marketing);
console.log(true === cookiebot.consent.preferences);
console.log(true === cookiebot.consent.statistics);

// or open the consent manager
<button
type="button"
onClick={() => cookiebot.openConsentManager()}
>
Open Consent Manager
</button>
```
3 changes: 3 additions & 0 deletions docs/ts-scss/dune/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ import {LinkList} from "../../../src/components/Link/LinkList";
/>

**Dune** is a library, that combines a lot of commonly used functionality in JavaScript. It tries to ease common JS tasks.

It provides standalone functions, React components and Next.js-integrated components.