Palmabit-IT / react-cookie-law

React Cookie Law is a cookie-info banner compliance with the GDPR and the EU cookie law. It allows the user to give consent in a granular way.
113 stars 55 forks source link

Re-open Cookie notice after accept-decline #4

Open MKlblangenois opened 4 years ago

MKlblangenois commented 4 years ago

Is there a way to update our preference about cookie once the user has click on accept on decline ?

asarzina commented 4 years ago

I'm sorry, not now. We are working for this new feature.

wortkotze commented 3 years ago

any idea, when it will be available?

asarzina commented 3 years ago

Since the banner is hidden when the user gives preferences, it's necessary a button or something else to show the banner again. I want to give users the ability to customize the graphic style of a button and need more work.

For now you need to create a wrapper component that remove the rcl_consent_given cookie and render CookieBanner. Like this:

const removeCookie = (cookieName) => {
  // Remove "rcl_consent_given" and render component
}

render () {
  <div>
    <button onClick={removeCookie}>Modify preferences</button>
    <CookieBanner />
  </div>
}