mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-08-23 09:35:04 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
c2f92ec130 | |||
7136086602 | |||
|
c3ba87e62f | ||
239001cb19 | |||
e024961eae | |||
a19649bbcf | |||
696200262e | |||
e52811b3a8 | |||
|
814202780b | ||
|
d01995e3b4 | ||
56de263dce |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
node_modules
|
||||
build/index.js.LICENSE.txt
|
||||
example/*
|
||||
|
16
CHANGELOG.md
16
CHANGELOG.md
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [[6.4.1](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/6.4.1))]
|
||||
|
||||
- Added missing typing
|
||||
|
||||
## [[6.4.0](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/6.4.0))]
|
||||
|
||||
- Added visible prop
|
||||
|
||||
## [[6.3.0](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/6.2.3))]
|
||||
|
||||
- Added the (optional) scrolling effect back in as it is declared legal in some countries now.
|
||||
|
||||
## [6.2.4]
|
||||
|
||||
- version bumps :)
|
||||
|
||||
## [[6.2.3](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/6.2.3)]
|
||||
|
||||
- Added support for IE11, the webpack generated runtime-code should not use arrow functions
|
||||
|
124
README.md
124
README.md
@@ -20,6 +20,7 @@ Example branch: https://github.com/Mastermindzh/react-cookie-consent/tree/exampl
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Using it](#using-it)
|
||||
- [getting the cookies value in your own code](#getting-the-cookies-value-in-your-own-code)
|
||||
- [Props](#props)
|
||||
- [Debugging it](#debugging-it)
|
||||
- [Why are there two cookies? One of which named "Legacy"](#why-are-there-two-cookies-one-of-which-named-legacy)
|
||||
@@ -28,9 +29,11 @@ Example branch: https://github.com/Mastermindzh/react-cookie-consent/tree/exampl
|
||||
- [Changing the bar background to red](#changing-the-bar-background-to-red)
|
||||
- [Changing the button font-weight to bold](#changing-the-button-font-weight-to-bold)
|
||||
- [Using predefined CSS classes](#using-predefined-css-classes)
|
||||
- [Accept on scroll](#accept-on-scroll)
|
||||
- [Flipping the buttons](#flipping-the-buttons)
|
||||
- [Extra cookie options](#extra-cookie-options)
|
||||
- [Rainbows!](#rainbows)
|
||||
- [Overlay](#overlay)
|
||||
- [Contributor information](#contributor-information)
|
||||
- [Projects using react-cookie-consent](#projects-using-react-cookie-consent)
|
||||
|
||||
@@ -84,12 +87,17 @@ You can optionally set some props like this (next chapter will show all props):
|
||||
</CookieConsent>
|
||||
```
|
||||
|
||||
One of the props (onAccept) is a function, this function will be called after the user has clicked the accept button. You can provide a function like so:
|
||||
One of the props (onAccept) is a function, this function will be called after the user has clicked the accept button. It is called with an object containing a boolean property `acceptedByScrolling` to indicate if the acceptance was triggered by the user scrolling You can provide a function like so:
|
||||
|
||||
```js
|
||||
<CookieConsent
|
||||
onAccept={() => {
|
||||
alert("Accept was triggered by clicking the Accept button");
|
||||
onAccept={(acceptedByScrolling) => {
|
||||
if (acceptedByScrolling) {
|
||||
// triggered if user scrolls past threshold
|
||||
alert("Accept was triggered by user scrolling");
|
||||
} else {
|
||||
alert("Accept was triggered by clicking the Accept button");
|
||||
}
|
||||
}}
|
||||
></CookieConsent>
|
||||
```
|
||||
@@ -115,47 +123,62 @@ import CookieConsent, { Cookies, getCookieConsentValue } from "react-cookie-cons
|
||||
console.log(getCookieConsentValue());
|
||||
```
|
||||
|
||||
### reset the cookies value in your own code
|
||||
|
||||
react-cookie-consent exports a function called `resetCookieConsentValue`. You can use it in order to remove cookie in client-site:
|
||||
|
||||
```js
|
||||
import CookieConsent, { Cookies, resetCookieConsentValue } from "react-cookie-consent";
|
||||
|
||||
console.log(resetCookieConsentValue());
|
||||
```
|
||||
|
||||
That option would be interesting if you want to allow user to change their consent. If you want to show again the consent bar, you must force "visible" prop to show again the bar.
|
||||
|
||||
## Props
|
||||
|
||||
| Prop | Type | Default value | Description |
|
||||
| -------------------- | :-------------------------------: | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| location | string, "top", "bottom" or "none" | "bottom" | Syntactic sugar to easily enable you to place the bar at the top or the bottom of the browser window. Use "none" to disable. |
|
||||
| children | string or React component | | Content to appear inside the bar |
|
||||
| disableStyles | boolean | false | If enabled the component will have no default style. (you can still supply style through props) |
|
||||
| hideOnAccept | boolean | true | If disabled the component will not hide it self after the accept button has been clicked. You will need to hide yourself (see onAccept) |
|
||||
| buttonText | string or React component | "I understand" | Text to appear on the button |
|
||||
| declineButtonText | string or React component | "I decline" | Text to appear on the decline button |
|
||||
| cookieName | string | "CookieConsent" | Name of the cookie used to track whether the user has agreed. |
|
||||
| cookieValue | string or boolean or number | true | Value to be saved under the cookieName. |
|
||||
| declineCookieValue | string or boolean or number | false | Value to be saved under the cookieName when declined. |
|
||||
| setDeclineCookie | boolean | true | Whether to set a cookie when the user clicks "decline" |
|
||||
| onAccept | function | `() => {}` | Function to be called after the accept button has been clicked. |
|
||||
| onDecline | function | `() => {}` | Function to be called after the decline button has been clicked. |
|
||||
| debug | boolean | undefined | Bar will be drawn regardless of cookie for debugging purposes. |
|
||||
| expires | number | 365 | Number of days before the cookie expires. |
|
||||
| extraCookieOptions | object | `{}` | Extra info (apart from expiry date) to add to the cookie |
|
||||
| overlay | boolean | false | Whether to show a page obscuring overlay or not. |
|
||||
| containerClasses | string | "" | CSS classes to apply to the surrounding container |
|
||||
| buttonClasses | string | "" | CSS classes to apply to the button |
|
||||
| buttonWrapperClasses | string | "" | CSS classes to apply to the div wrapping the buttons |
|
||||
| declineButtonClasses | string | "" | CSS classes to apply to the decline button |
|
||||
| buttonId | string | "" | Id to apply to the button |
|
||||
| declineButtonId | string | "" | Id to apply to the decline button |
|
||||
| contentClasses | string | "" | CSS classes to apply to the content |
|
||||
| overlayClasses | string | "" | CSS classes to apply to the surrounding overlay |
|
||||
| style | object | [look at source][style] | React styling object for the bar. |
|
||||
| buttonStyle | object | [look at source][buttonstyle] | React styling object for the button. |
|
||||
| declineButtonStyle | object | [look at source][declinebuttonstyle] | React styling object for the decline button. |
|
||||
| contentStyle | object | [look at source][contentstyle] | React styling object for the content. |
|
||||
| overlayStyle | object | [look at source][overlaystyle] | React styling object for the overlay. |
|
||||
| disableButtonStyles | boolean | false | If enabled the button will have no default style. (you can still supply style through props) |
|
||||
| enableDeclineButton | boolean | false | If enabled the decline button will be rendered |
|
||||
| flipButtons | boolean | false | If enabled the accept and decline buttons will be flipped |
|
||||
| ButtonComponent | React component | button | React Component to render as a button. |
|
||||
| sameSite | string, "strict", "lax" or "none" | none | Cookies sameSite attribute value |
|
||||
| cookieSecurity | boolean | undefined | Cookie security level. Defaults to true unless running on http. |
|
||||
| ariaAcceptLabel | string | Accept cookies | Aria label to set on the accept button |
|
||||
| ariaDeclineLabel | string | Decline cookies | Aria label to set on the decline button |
|
||||
| Prop | Type | Default value | Description |
|
||||
| ------------------------ | :-----------------------------------------: | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| location | string, "top", "bottom" or "none" | "bottom" | Syntactic sugar to easily enable you to place the bar at the top or the bottom of the browser window. Use "none" to disable. |
|
||||
| visible | string, "show", "hidden" or "byCookieValue" | "byCookieValue" | Force the consent bar visibility. If "byCookieValue", visibility are defined by cookie consent existence. |
|
||||
| children | string or React component | | Content to appear inside the bar |
|
||||
| disableStyles | boolean | false | If enabled the component will have no default style. (you can still supply style through props) |
|
||||
| hideOnAccept | boolean | true | If disabled the component will not hide it self after the accept button has been clicked. You will need to hide yourself (see onAccept) |
|
||||
| buttonText | string or React component | "I understand" | Text to appear on the button |
|
||||
| declineButtonText | string or React component | "I decline" | Text to appear on the decline button |
|
||||
| cookieName | string | "CookieConsent" | Name of the cookie used to track whether the user has agreed. |
|
||||
| cookieValue | string or boolean or number | true | Value to be saved under the cookieName. |
|
||||
| declineCookieValue | string or boolean or number | false | Value to be saved under the cookieName when declined. |
|
||||
| setDeclineCookie | boolean | true | Whether to set a cookie when the user clicks "decline" |
|
||||
| onAccept | function | `() => {}` | Function to be called after the accept button has been clicked. |
|
||||
| onDecline | function | `() => {}` | Function to be called after the decline button has been clicked. |
|
||||
| debug | boolean | undefined | Bar will be drawn regardless of cookie for debugging purposes. |
|
||||
| expires | number | 365 | Number of days before the cookie expires. |
|
||||
| extraCookieOptions | object | `{}` | Extra info (apart from expiry date) to add to the cookie |
|
||||
| overlay | boolean | false | Whether to show a page obscuring overlay or not. |
|
||||
| containerClasses | string | "" | CSS classes to apply to the surrounding container |
|
||||
| buttonClasses | string | "" | CSS classes to apply to the button |
|
||||
| buttonWrapperClasses | string | "" | CSS classes to apply to the div wrapping the buttons |
|
||||
| declineButtonClasses | string | "" | CSS classes to apply to the decline button |
|
||||
| buttonId | string | "" | Id to apply to the button |
|
||||
| declineButtonId | string | "" | Id to apply to the decline button |
|
||||
| contentClasses | string | "" | CSS classes to apply to the content |
|
||||
| overlayClasses | string | "" | CSS classes to apply to the surrounding overlay |
|
||||
| style | object | [look at source][style] | React styling object for the bar. |
|
||||
| buttonStyle | object | [look at source][buttonstyle] | React styling object for the button. |
|
||||
| declineButtonStyle | object | [look at source][declinebuttonstyle] | React styling object for the decline button. |
|
||||
| contentStyle | object | [look at source][contentstyle] | React styling object for the content. |
|
||||
| overlayStyle | object | [look at source][overlaystyle] | React styling object for the overlay. |
|
||||
| disableButtonStyles | boolean | false | If enabled the button will have no default style. (you can still supply style through props) |
|
||||
| enableDeclineButton | boolean | false | If enabled the decline button will be rendered |
|
||||
| flipButtons | boolean | false | If enabled the accept and decline buttons will be flipped |
|
||||
| ButtonComponent | React component | button | React Component to render as a button. |
|
||||
| sameSite | string, "strict", "lax" or "none" | none | Cookies sameSite attribute value |
|
||||
| cookieSecurity | boolean ¡| undefined | Cookie security level. Defaults to true unless running on http. |
|
||||
| ariaAcceptLabel | string | Accept cookies | Aria label to set on the accept button |
|
||||
| ariaDeclineLabel | string | Decline cookies | Aria label to set on the decline button |
|
||||
| acceptOnScroll | boolean | false | Defines whether "accept" should be fired after the user scrolls a certain distance (see acceptOnScrollPercentage) |
|
||||
| acceptOnScrollPercentage | number | 25 | Percentage of the page height the user has to scroll to trigger the accept function if acceptOnScroll is enabled |
|
||||
|
||||
## Debugging it
|
||||
|
||||
@@ -229,6 +252,23 @@ Which results in:
|
||||
|
||||

|
||||
|
||||
#### Accept on scroll
|
||||
|
||||
You can make the cookiebar disappear after scrolling a certain percentage using acceptOnScroll and acceptOnScrollPercentage.
|
||||
It is legal in some use-cases, [Italy](https://www.garanteprivacy.it/web/guest/home/docweb/-/docweb-display/docweb/9679893) being one of them. Consult your legislation on whether this is allowed.
|
||||
|
||||
```js
|
||||
<CookieConsent
|
||||
acceptOnScroll={true}
|
||||
acceptOnScrollPercentage={50}
|
||||
onAccept={(byScroll) => {
|
||||
alert(`consent given. \n\n By scrolling? ${byScroll}`);
|
||||
}}
|
||||
>
|
||||
Hello scroller :)
|
||||
</CookieConsent>
|
||||
```
|
||||
|
||||
#### Flipping the buttons
|
||||
|
||||
If you enable the decline button you can pass along the "flipButtons" property to turn the buttons around:
|
||||
|
4
build/index.d.ts
vendored
4
build/index.d.ts
vendored
@@ -12,7 +12,7 @@ export interface CookieConsentProps {
|
||||
children?: React.ReactNode;
|
||||
disableStyles?: boolean;
|
||||
hideOnAccept?: boolean;
|
||||
onAccept?: Function;
|
||||
onAccept?: (acceptedByScrolling?: boolean) => void;
|
||||
onDecline?: Function;
|
||||
buttonText?: Function | React.ReactNode;
|
||||
declineButtonText?: Function | React.ReactNode;
|
||||
@@ -39,6 +39,8 @@ export interface CookieConsentProps {
|
||||
overlayStyle?: object;
|
||||
ariaAcceptLabel?: string;
|
||||
ariaDeclineLabel?: string;
|
||||
acceptOnScroll?: boolean;
|
||||
acceptOnScrollPercentage?: number;
|
||||
}
|
||||
|
||||
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
||||
|
1266
build/index.js
1266
build/index.js
File diff suppressed because it is too large
Load Diff
1
example
Submodule
1
example
Submodule
Submodule example added at bff8dd76c5
12618
package-lock.json
generated
12618
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
"name": "Rick van Lieshout",
|
||||
"email": "info@rickvanlieshout.com"
|
||||
},
|
||||
"version": "6.2.2",
|
||||
"version": "6.4.0",
|
||||
"description": "A small, simple and customizable cookie consent bar for use in React applications.",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -22,7 +22,7 @@
|
||||
"minor": "npm --no-git-tag-version version minor",
|
||||
"major": "npm --no-git-tag-version version major",
|
||||
"preversion": "grep \"\\[$npm_package_version\\]\" CHANGELOG.md > /dev/null || ( echo 'You need to add an entry in CHANGELOG.md for this version.' && false )",
|
||||
"release": "npm run build && git add -A && git tag $npm_package_version && git commit -m 'release $npm_package_version' && git push && git push --tags && npm publish",
|
||||
"release": "npm run build && git add -A && git tag $npm_package_version && git commit -m \"release $npm_package_version\" && git push && git push --tags && npm publish",
|
||||
"release-patch": "npm run patch && npm run release",
|
||||
"release-minor": "npm run minor && npm run release",
|
||||
"release-major": "npm run major && npm run release"
|
||||
|
18
src/index.d.ts
vendored
18
src/index.d.ts
vendored
@@ -4,6 +4,7 @@ import Cookies from "js-cookie";
|
||||
export interface CookieConsentProps {
|
||||
location?: "top" | "bottom" | "none";
|
||||
sameSite?: "strict" | "lax" | "none";
|
||||
visible?: "hidden" | "show" | "byCookieValue";
|
||||
cookieSecurity?: boolean;
|
||||
style?: object;
|
||||
buttonStyle?: object;
|
||||
@@ -12,7 +13,7 @@ export interface CookieConsentProps {
|
||||
children?: React.ReactNode;
|
||||
disableStyles?: boolean;
|
||||
hideOnAccept?: boolean;
|
||||
onAccept?: Function;
|
||||
onAccept?: (acceptedByScrolling?: boolean) => void;
|
||||
onDecline?: Function;
|
||||
buttonText?: Function | React.ReactNode;
|
||||
declineButtonText?: Function | React.ReactNode;
|
||||
@@ -39,6 +40,8 @@ export interface CookieConsentProps {
|
||||
overlayStyle?: object;
|
||||
ariaAcceptLabel?: string;
|
||||
ariaDeclineLabel?: string;
|
||||
acceptOnScroll?: boolean;
|
||||
acceptOnScrollPercentage?: number;
|
||||
}
|
||||
|
||||
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
||||
@@ -51,4 +54,17 @@ export default class CookieConsent extends React.Component<CookieConsentProps, {
|
||||
*/
|
||||
export function getCookieConsentValue(name?: string): string;
|
||||
|
||||
/**
|
||||
* Reset the consent cookie
|
||||
* Remove the cookie on browser in order to allow user to change their consent
|
||||
* @param {*} name optional name of the cookie
|
||||
*/
|
||||
export function resetCookieConsentValue(name?: string);
|
||||
|
||||
/**
|
||||
* Get the legacy cookie name by the regular cookie name
|
||||
* @param {string} name of cookie to get
|
||||
*/
|
||||
export function getLegacyCookieName(name: string);
|
||||
|
||||
export { Cookies };
|
||||
|
85
src/index.js
85
src/index.js
@@ -14,6 +14,12 @@ export const SAME_SITE_OPTIONS = {
|
||||
NONE: "none",
|
||||
};
|
||||
|
||||
export const VISIBLE_OPTIONS = {
|
||||
HIDDEN: 'hidden',
|
||||
SHOW: 'show',
|
||||
BY_COOKIE_VALUE: 'byCookieValue'
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the consent cookie
|
||||
* Retrieves the regular value first and if not found the legacy one according
|
||||
@@ -30,6 +36,15 @@ export const getCookieConsentValue = (name = defaultCookieConsentName) => {
|
||||
return cookieValue;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reset the consent cookie
|
||||
* Remove the cookie on browser in order to allow user to change their consent
|
||||
* @param {*} name optional name of the cookie
|
||||
*/
|
||||
export const resetCookieConsentValue = (name = defaultCookieConsentName) => {
|
||||
Cookies.remove(name);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the legacy cookie name by the regular cookie name
|
||||
* @param {string} name of cookie to get
|
||||
@@ -116,21 +131,31 @@ class CookieConsent extends Component {
|
||||
// if cookie undefined or debug
|
||||
if (this.getCookieValue() === undefined || debug) {
|
||||
this.setState({ visible: true });
|
||||
// if acceptOnScroll is set to true and (cookie is undefined or debug is set to true), add a listener.
|
||||
if (this.props.acceptOnScroll) {
|
||||
window.addEventListener("scroll", this.handleScroll, { passive: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// remove listener if still set
|
||||
this.removeScrollListener();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a persistent accept cookie
|
||||
*/
|
||||
accept() {
|
||||
accept(acceptedByScrolling = false) {
|
||||
const { cookieName, cookieValue, hideOnAccept, onAccept } = this.props;
|
||||
|
||||
this.setCookie(cookieName, cookieValue);
|
||||
|
||||
onAccept();
|
||||
onAccept(acceptedByScrolling ?? false);
|
||||
|
||||
if (hideOnAccept) {
|
||||
this.setState({ visible: false });
|
||||
this.removeScrollListener();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,13 +163,8 @@ class CookieConsent extends Component {
|
||||
* Set a persistent decline cookie
|
||||
*/
|
||||
decline() {
|
||||
const {
|
||||
cookieName,
|
||||
declineCookieValue,
|
||||
hideOnDecline,
|
||||
onDecline,
|
||||
setDeclineCookie,
|
||||
} = this.props;
|
||||
const { cookieName, declineCookieValue, hideOnDecline, onDecline, setDeclineCookie } =
|
||||
this.props;
|
||||
|
||||
if (setDeclineCookie) {
|
||||
this.setCookie(cookieName, declineCookieValue);
|
||||
@@ -191,10 +211,47 @@ class CookieConsent extends Component {
|
||||
return getCookieConsentValue(cookieName);
|
||||
}
|
||||
|
||||
/**
|
||||
* checks whether scroll has exceeded set amount and fire accept if so.
|
||||
*/
|
||||
handleScroll = () => {
|
||||
const { acceptOnScrollPercentage } = this.props;
|
||||
|
||||
// (top / height) - height * 100
|
||||
let rootNode = document.documentElement,
|
||||
body = document.body,
|
||||
top = "scrollTop",
|
||||
height = "scrollHeight";
|
||||
|
||||
let percentage =
|
||||
((rootNode[top] || body[top]) /
|
||||
((rootNode[height] || body[height]) - rootNode.clientHeight)) *
|
||||
100;
|
||||
|
||||
if (percentage > acceptOnScrollPercentage) {
|
||||
this.accept(true);
|
||||
}
|
||||
};
|
||||
|
||||
removeScrollListener = () => {
|
||||
const { acceptOnScroll } = this.props;
|
||||
if (acceptOnScroll) {
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
// If the bar shouldn't be visible don't render anything.
|
||||
if (!this.state.visible) {
|
||||
return null;
|
||||
switch (this.props.visible) {
|
||||
case VISIBLE_OPTIONS.HIDDEN:
|
||||
return null;
|
||||
case VISIBLE_OPTIONS.BY_COOKIE_VALUE:
|
||||
if (!this.state.visible) {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const {
|
||||
@@ -332,6 +389,7 @@ class CookieConsent extends Component {
|
||||
|
||||
CookieConsent.propTypes = {
|
||||
location: PropTypes.oneOf(Object.keys(OPTIONS).map((key) => OPTIONS[key])),
|
||||
visible: PropTypes.oneOf(Object.keys(VISIBLE_OPTIONS).map((key) => VISIBLE_OPTIONS[key])),
|
||||
sameSite: PropTypes.oneOf(Object.keys(SAME_SITE_OPTIONS).map((key) => SAME_SITE_OPTIONS[key])),
|
||||
style: PropTypes.object,
|
||||
buttonStyle: PropTypes.object,
|
||||
@@ -369,6 +427,8 @@ CookieConsent.propTypes = {
|
||||
overlayStyle: PropTypes.object,
|
||||
ariaAcceptLabel: PropTypes.string,
|
||||
ariaDeclineLabel: PropTypes.string,
|
||||
acceptOnScroll: PropTypes.bool,
|
||||
acceptOnScrollPercentage: PropTypes.number,
|
||||
};
|
||||
|
||||
CookieConsent.defaultProps = {
|
||||
@@ -376,6 +436,7 @@ CookieConsent.defaultProps = {
|
||||
hideOnAccept: true,
|
||||
hideOnDecline: true,
|
||||
location: OPTIONS.BOTTOM,
|
||||
visible: VISIBLE_OPTIONS.BY_COOKIE_VALUE,
|
||||
onAccept: () => {},
|
||||
onDecline: () => {},
|
||||
cookieName: defaultCookieConsentName,
|
||||
@@ -403,6 +464,8 @@ CookieConsent.defaultProps = {
|
||||
overlayClasses: "",
|
||||
ariaAcceptLabel: "Accept cookies",
|
||||
ariaDeclineLabel: "Decline cookies",
|
||||
acceptOnScroll: false,
|
||||
acceptOnScrollPercentage: 25,
|
||||
};
|
||||
|
||||
export default CookieConsent;
|
||||
|
Reference in New Issue
Block a user