mirror of
				https://github.com/Mastermindzh/react-cookie-consent.git
				synced 2025-10-31 00:39:02 +01:00 
			
		
		
		
	Merge branch 'master' of github.com:Mastermindzh/react-cookie-consent into develop
This commit is contained in:
		| @@ -32,7 +32,7 @@ You can import the cookie bar like this: | ||||
| import CookieConsent from "react-cookie-consent"; | ||||
| ``` | ||||
|  | ||||
| If you want to set/remove cookies yourself you can optionally import Cookie (straight from js-cookie) like this: | ||||
| If you want to set/remove cookies yourself you can optionally import `Cookies` (straight from js-cookie) like this: | ||||
|  | ||||
| ``` js | ||||
| import CookieConsent, { Cookies } from "react-cookie-consent"; | ||||
| @@ -261,3 +261,4 @@ The list below features the projects which use react-cookie-consent (that I know | ||||
| - [bs-react-cookie-consent](https://github.com/ctbucha/bs-react-cookie-consent) | ||||
| - [comicrelief's storybook](https://github.com/comicrelief/storybook) | ||||
| - [inici Gatsby theme](https://github.com/kuworking/gatsby-theme-inici#readme) | ||||
| - [Scrivito Example App](https://github.com/Scrivito/scrivito_example_app_js) | ||||
|   | ||||
							
								
								
									
										1
									
								
								build/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								build/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -31,6 +31,7 @@ export interface CookieConsentProps { | ||||
|   extraCookieOptions?: object; | ||||
|   disableButtonStyles?: boolean; | ||||
|   enableDeclineButton?: boolean; | ||||
|   flipButtons?: boolean; | ||||
|   ButtonComponent?: Function | React.ReactElement; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -611,8 +611,8 @@ var CookieConsent = function (_Component) { | ||||
|         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 && _jsCookie2.default.get(cookieName) === undefined || debug) { | ||||
|       // if acceptOnScroll is set to true and (cookie is undefined or debug is set to true), add a listener. | ||||
|       if (this.props.acceptOnScroll && (_jsCookie2.default.get(cookieName) === undefined || debug)) { | ||||
|         window.addEventListener("scroll", this.handleScroll, { passive: true }); | ||||
|       } | ||||
|     } | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								src/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -31,6 +31,7 @@ export interface CookieConsentProps { | ||||
|   extraCookieOptions?: object; | ||||
|   disableButtonStyles?: boolean; | ||||
|   enableDeclineButton?: boolean; | ||||
|   flipButtons?: boolean; | ||||
|   ButtonComponent?: Function | React.ReactElement; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -66,8 +66,8 @@ class CookieConsent extends Component { | ||||
|       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 && Cookies.get(cookieName) === undefined) || debug) { | ||||
|     // if acceptOnScroll is set to true and (cookie is undefined or debug is set to true), add a listener. | ||||
|     if (this.props.acceptOnScroll && (Cookies.get(cookieName) === undefined || debug)) { | ||||
|       window.addEventListener("scroll", this.handleScroll, { passive: true }); | ||||
|     } | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user