diff --git a/README.md b/README.md index efd9d16..1bb8738 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ One of the props (onAccept) is a function, this function will be called after th | extraCookieOptions | object | `{}` | Extra info (apart from expiry date) to add to the cookie| | containerClasses| string | "" | CSS classes to apply to the surrounding container | | buttonClasses | string | "" | CSS classes to apply to the button | +| buttonId | string | "" | Id to apply to the button | | contentClasses| string | "" | CSS classes to apply to the content | | style | object | [look at source][style] | React styling object for the bar. | | buttonStyle | object | [look at source][buttonStyle] | React styling object for the button. | diff --git a/build/index.js b/build/index.js index 20b9b66..d130a8d 100644 --- a/build/index.js +++ b/build/index.js @@ -669,7 +669,8 @@ var CookieConsent = function (_Component) { buttonText = _props3.buttonText, containerClasses = _props3.containerClasses, contentClasses = _props3.contentClasses, - buttonClasses = _props3.buttonClasses; + buttonClasses = _props3.buttonClasses, + buttonId = _props3.buttonId; var myStyle = {}; @@ -714,6 +715,7 @@ var CookieConsent = function (_Component) { { style: myButtonStyle, className: buttonClasses, + id: buttonId, onClick: function onClick() { _this2.accept(); } @@ -746,6 +748,7 @@ CookieConsent.propTypes = { containerClasses: _propTypes2.default.string, contentClasses: _propTypes2.default.string, buttonClasses: _propTypes2.default.string, + buttonId: _propTypes2.default.string, acceptOnScroll: _propTypes2.default.bool, acceptOnScrollPercentage: _propTypes2.default.number, extraCookieOptions: _propTypes2.default.object @@ -766,6 +769,7 @@ CookieConsent.defaultProps = { containerClasses: "", contentClasses: "", buttonClasses: "", + buttonId: "", extraCookieOptions: {} }; diff --git a/package.json b/package.json index 1be80bd..68dff5f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "name": "Rick van Lieshout", "email": "info@rickvanlieshout.com" }, - "version": "1.8.0", + "version": "1.8.1", "description": "A small, simple and customizable cookie consent bar for use in React applications.", "main": "build/index.js", "dependencies": { diff --git a/src/index.js b/src/index.js index ca0895a..1e113fd 100644 --- a/src/index.js +++ b/src/index.js @@ -118,7 +118,8 @@ class CookieConsent extends Component { buttonText, containerClasses, contentClasses, - buttonClasses + buttonClasses, + buttonId, } = this.props; let myStyle = {}; @@ -158,6 +159,7 @@ class CookieConsent extends Component {