1.0.3 • Published 7 years ago
@cuban-engineer/react-cookies-consent v1.0.3
@cuban-engineer/react-cookies-consent
React component for the managing the user awareness regarding cookies usage
Install
npm install --save @cuban-engineer/react-cookies-consentor
yarn add @cuban-engineer/react-cookies-consentUsage
import React, { Component } from 'react'
import CookiesConsent from '@cuban-engineer/react-cookies-consent'
class Example extends Component {
render () {
return (
<CookiesConsent />
)
}
}Available props
cookiesIdValue with which the cookie will be save in the browser: (Type:String, Default value: 'cookies-consent')messageMessage that will be show to the user: (TypeString, Default value: 'Cookies help us deliver our services. By using our services, you agree to our use of cookies.')buttonMessageText of the submit action button: (Type:String, Default value: 'OK')expiresInTime needed for the cookie to expire: (Type:Number, Default value: 365)linkLink for more information pages: (Type:Object, Default values: { url: undefined, text: undefined, target: '_blank'})
Styling
By default the rendered component will be fixed at the bottom and will look like this:

But the styles can be modified by overriding this css classes:
1. .cookies-consent: Entire Component container.
2. .cookies-consent-text: Container of the message showed to the user.
3. .cookies-consent-button Container of the Button for accepting the use of cookies.
4. .cookies-consent-link Container of the a tag for the link.
License
@cuban-engineer/react-cookies-consent is MIT-licensed.