gdpr-cookie-consent-banner
gdpr-cookie-consent-banner copied to clipboard
How to toggle the cookie banner from different button?
I would like to open the cookie banner from click of different button other than the button provided by the "ShowEditIcon". I want to display a edit cookie option on the site navigation menu which would open the cookie consent modal. The library function provides only function to attachBanner but there is no other function to trigger the toggle of cookie consent modal. One other thing with the showing edit modal is for the user to update their preference but if the user disables any of the preferences then I dont get any events. So could you provide a event if the user opts-out of any preferences?
Hi There,
It would be possible to add a method which allows triggering of the modal. You basically just need to export
a function from the main component. I'd happily accept a PR which does this.
As for updating preferences, whilst it would be possible to fire an event when a user unchecks an event, this doesn't make much sense logically - since you'd have to somehow remove tracking from the page after it had been added, or something.
Again I'd happily accept PRs for either of these things, I'm just not sure the second one would do what you want it to do.
btw, I think the second feature was also requested here https://github.com/beyonk-adventures/gdpr-cookie-consent-banner/issues/7
Closing due to inactivity