release 6.0.0

This commit is contained in:
Rick van Lieshout 2020-11-02 19:43:03 +01:00
parent 86226dfbe3
commit c656e311e6
7 changed files with 658 additions and 2589 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules node_modules
build/index.js.LICENSE.txt

4
build/index.d.ts vendored
View File

@ -12,7 +12,7 @@ export interface CookieConsentProps {
children?: React.ReactNode; children?: React.ReactNode;
disableStyles?: boolean; disableStyles?: boolean;
hideOnAccept?: boolean; hideOnAccept?: boolean;
onAccept?: ({ acceptedByScrolling }: { acceptedByScrolling?: boolean }) => void; onAccept?: Function;
onDecline?: Function; onDecline?: Function;
buttonText?: Function | React.ReactNode; buttonText?: Function | React.ReactNode;
declineButtonText?: Function | React.ReactNode; declineButtonText?: Function | React.ReactNode;
@ -29,8 +29,6 @@ export interface CookieConsentProps {
declineButtonClasses?: string; declineButtonClasses?: string;
buttonId?: string; buttonId?: string;
declineButtonId?: string; declineButtonId?: string;
acceptOnScroll?: boolean;
acceptOnScrollPercentage?: number;
extraCookieOptions?: object; extraCookieOptions?: object;
disableButtonStyles?: boolean; disableButtonStyles?: boolean;
enableDeclineButton?: boolean; enableDeclineButton?: boolean;

File diff suppressed because it is too large Load Diff

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "react-cookie-consent", "name": "react-cookie-consent",
"version": "5.2.0", "version": "6.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -4,7 +4,7 @@
"name": "Rick van Lieshout", "name": "Rick van Lieshout",
"email": "info@rickvanlieshout.com" "email": "info@rickvanlieshout.com"
}, },
"version": "5.2.0", "version": "6.0.0",
"description": "A small, simple and customizable cookie consent bar for use in React applications.", "description": "A small, simple and customizable cookie consent bar for use in React applications.",
"main": "build/index.js", "main": "build/index.js",
"types": "build/index.d.ts", "types": "build/index.d.ts",

2
src/index.d.ts vendored
View File

@ -12,7 +12,7 @@ export interface CookieConsentProps {
children?: React.ReactNode; children?: React.ReactNode;
disableStyles?: boolean; disableStyles?: boolean;
hideOnAccept?: boolean; hideOnAccept?: boolean;
onAccept?: () => void; onAccept?: Function;
onDecline?: Function; onDecline?: Function;
buttonText?: Function | React.ReactNode; buttonText?: Function | React.ReactNode;
declineButtonText?: Function | React.ReactNode; declineButtonText?: Function | React.ReactNode;

View File

@ -28,7 +28,6 @@ const ConditionalWrapper = ({ condition, wrapper, children }) => {
class CookieConsent extends Component { class CookieConsent extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.accept.bind(this);
this.state = { this.state = {
visible: false, visible: false,
@ -281,7 +280,9 @@ class CookieConsent extends Component {
className={buttonClasses} className={buttonClasses}
id={buttonId} id={buttonId}
aria-label={ariaAcceptLabel} aria-label={ariaAcceptLabel}
onClick={this.accept} onClick={() => {
this.accept();
}}
> >
{buttonText} {buttonText}
</ButtonComponent> </ButtonComponent>