universe:cookie-info
ReactJS component for showing information about using cookies by your app/site.
Adding default cookie info nag
1import CookieNag from 'meteor/universe:cookie-nag'; 2 3<CookieNag />
Adding custom component as info content
If you add your own component, you have to call props.onConsent() when user agrees.
1import CookieNag from 'meteor/universe:cookie-nag'; 2 3const YourComponentWithInfo = (props) => ( 4 <div className="cookie-policy"> 5 <p> 6 This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. <a href="/cookies">Find out more here</a>. 7 </p> 8 <p> 9 <a href="#" onClick={e => {e.preventDefault(); props.onConsent();}}> 10 <span className="sr-only">OK</span> 11 </a> 12 </p> 13 </div> 14); 15 16<CookieNag> 17 <YourComponentWithInfo /> 18</CookieNag>
Removing default styling
Just set "clearStyle" prop to CookieNag.
1<CookieNag clearStyle> 2 <YourComponentWithInfo /> 3</CookieNag>