Compare commits

..

No commits in common. "d8993bead28fbacf363fa801b3ae2d903f2e5b49" and "d1c72525464bb3989ea7bc23a3e4bcf22397f561" have entirely different histories.

9 changed files with 6 additions and 17 deletions

View File

@ -5,10 +5,6 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [[7.5.0]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.5.0)
- Added `customDeclineButtonProps` to add custom properties to the decline button
## [[7.4.1]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.4.1) ## [[7.4.1]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.4.1)
- Small version error in package.json that actually didn't make it work with React 18 - Small version error in package.json that actually didn't make it work with React 18

View File

@ -184,7 +184,6 @@ That option would be interesting if you want to allow user to change their conse
| onOverlayClick | function | `() => {}` | allows you to react to a click on the overlay | | onOverlayClick | function | `() => {}` | allows you to react to a click on the overlay |
| acceptOnOverlayClick | boolean | false | Determines whether the cookies should be accepted after clicking on the overlay | | acceptOnOverlayClick | boolean | false | Determines whether the cookies should be accepted after clicking on the overlay |
| customButtonProps | object | `{}` | Allows you to set custom props on the button component | | customButtonProps | object | `{}` | Allows you to set custom props on the button component |
| customDeclineButtonProps | object | `{}` | Allows you to set custom props on the decline button component |
## Debugging it ## Debugging it

1
build/index.d.ts vendored
View File

@ -48,7 +48,6 @@ export interface CookieConsentProps {
customContentAttributes?: object; customContentAttributes?: object;
customContainerAttributes?: object; customContainerAttributes?: object;
customButtonProps?: object; customButtonProps?: object;
customDeclineButtonProps?: object;
} }
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {} export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit 8f1152c04d7bc70ba098783db2b752379ed7ec0f Subproject commit bff8dd76c5c13a0bf38a555b2d551e11540d30f0

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "react-cookie-consent", "name": "react-cookie-consent",
"version": "7.5.0", "version": "7.4.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "react-cookie-consent", "name": "react-cookie-consent",
"version": "7.5.0", "version": "7.4.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",

View File

@ -4,7 +4,7 @@
"name": "Rick van Lieshout", "name": "Rick van Lieshout",
"email": "info@rickvanlieshout.com" "email": "info@rickvanlieshout.com"
}, },
"version": "7.5.0", "version": "7.4.1",
"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",

1
src/index.d.ts vendored
View File

@ -48,7 +48,6 @@ export interface CookieConsentProps {
customContentAttributes?: object; customContentAttributes?: object;
customContainerAttributes?: object; customContainerAttributes?: object;
customButtonProps?: object; customButtonProps?: object;
customDeclineButtonProps?: object;
} }
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {} export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}

View File

@ -293,7 +293,6 @@ class CookieConsent extends Component {
customContainerAttributes, customContainerAttributes,
customContentAttributes, customContentAttributes,
customButtonProps, customButtonProps,
customDeclineButtonProps,
} = this.props; } = this.props;
let myStyle = {}; let myStyle = {};
@ -353,7 +352,6 @@ class CookieConsent extends Component {
onClick={() => { onClick={() => {
this.decline(); this.decline();
}} }}
{...customDeclineButtonProps}
> >
{declineButtonText} {declineButtonText}
</ButtonComponent> </ButtonComponent>
@ -362,6 +360,7 @@ class CookieConsent extends Component {
// add accept button // add accept button
buttonsToRender.push( buttonsToRender.push(
<ButtonComponent <ButtonComponent
{...customButtonProps}
key="acceptButton" key="acceptButton"
style={myButtonStyle} style={myButtonStyle}
className={buttonClasses} className={buttonClasses}
@ -370,7 +369,6 @@ class CookieConsent extends Component {
onClick={() => { onClick={() => {
this.accept(); this.accept();
}} }}
{...customButtonProps}
> >
{buttonText} {buttonText}
</ButtonComponent> </ButtonComponent>
@ -457,7 +455,6 @@ CookieConsent.propTypes = {
customContentAttributes: PropTypes.object, customContentAttributes: PropTypes.object,
customContainerAttributes: PropTypes.object, customContainerAttributes: PropTypes.object,
customButtonProps: PropTypes.object, customButtonProps: PropTypes.object,
customDeclineButtonProps: PropTypes.object,
}; };
CookieConsent.defaultProps = { CookieConsent.defaultProps = {
@ -500,7 +497,6 @@ CookieConsent.defaultProps = {
customContentAttributes: {}, customContentAttributes: {},
customContainerAttributes: {}, customContainerAttributes: {},
customButtonProps: {}, customButtonProps: {},
customDeclineButtonProps: {},
}; };
export default CookieConsent; export default CookieConsent;