Compare commits

...

3 Commits

Author SHA1 Message Date
e96b4fe4c0 release 7.3.1 2022-02-10 14:25:18 +01:00
Davor Peic
3d8c766911
Update index.d.ts (#151) 2022-02-10 14:22:20 +01:00
Abe Tomoaki
3c17b66191
docs(readme): update line number of link to code (#152) 2022-02-10 14:21:55 +01:00
6 changed files with 17 additions and 13 deletions

View File

@ -5,6 +5,10 @@ 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.3.1]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.3.1)
- Added type annotations on public functions
## [[7.3.0]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.3.0) ## [[7.3.0]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.3.0)
- added `customButtonProps` that allows to use custom props with the button component. Specifically useful for library buttons components, for e.g. MUI Button. - added `customButtonProps` that allows to use custom props with the button component. Specifically useful for library buttons components, for e.g. MUI Button.

View File

@ -205,7 +205,7 @@ So react-cookie-consent fixes this like so:
- set the fallback cookie (e.g -legacy) first, this will always succeed (on all browsers) - set the fallback cookie (e.g -legacy) first, this will always succeed (on all browsers)
- set the correct cookie second (this will work on modern browsers, fail on older ones) - set the correct cookie second (this will work on modern browsers, fail on older ones)
This happens on lines [186-192](https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L186-L192) This happens on lines [29-37](https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L29-L37)
When checking the cookie it'll do it in reverse. If the regular cookie exists, it'll use that. If no regular cookie exists it'll check whether the legacy cookie exists. If both are non-existent no consent was given. When checking the cookie it'll do it in reverse. If the regular cookie exists, it'll use that. If no regular cookie exists it'll check whether the legacy cookie exists. If both are non-existent no consent was given.
@ -336,11 +336,11 @@ You can also generate a page-obfuscating overlay that will prevent actions other
<!-- links --> <!-- links -->
[style]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L18-L29 [style]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L78-L89
[buttonstyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L30-L40 [buttonstyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L90-L100
[declinebuttonstyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L41-L51 [declinebuttonstyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L101-L111
[contentstyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L52-L55 [contentstyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L112-L115
[overlaystyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L62-L69 [overlaystyle]: https://github.com/Mastermindzh/react-cookie-consent/blob/master/src/index.js#L116-L124
## Contributor information ## Contributor information

4
build/index.d.ts vendored
View File

@ -65,12 +65,12 @@ export function getCookieConsentValue(name?: string): string;
* Remove the cookie on browser in order to allow user to change their consent * Remove the cookie on browser in order to allow user to change their consent
* @param {*} name optional name of the cookie * @param {*} name optional name of the cookie
*/ */
export function resetCookieConsentValue(name?: string); export function resetCookieConsentValue(name?: string): void;
/** /**
* Get the legacy cookie name by the regular cookie name * Get the legacy cookie name by the regular cookie name
* @param {string} name of cookie to get * @param {string} name of cookie to get
*/ */
export function getLegacyCookieName(name: string); export function getLegacyCookieName(name: string): string;
export { Cookies }; export { Cookies };

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "react-cookie-consent", "name": "react-cookie-consent",
"version": "7.3.0", "version": "7.3.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "7.3.0", "version": "7.3.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.3.0", "version": "7.3.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",

4
src/index.d.ts vendored
View File

@ -65,12 +65,12 @@ export function getCookieConsentValue(name?: string): string;
* Remove the cookie on browser in order to allow user to change their consent * Remove the cookie on browser in order to allow user to change their consent
* @param {*} name optional name of the cookie * @param {*} name optional name of the cookie
*/ */
export function resetCookieConsentValue(name?: string); export function resetCookieConsentValue(name?: string): void;
/** /**
* Get the legacy cookie name by the regular cookie name * Get the legacy cookie name by the regular cookie name
* @param {string} name of cookie to get * @param {string} name of cookie to get
*/ */
export function getLegacyCookieName(name: string); export function getLegacyCookieName(name: string): string;
export { Cookies }; export { Cookies };