Skip to content

Instantly share code, notes, and snippets.

@cwardzala
Created February 28, 2020 18:21
Show Gist options
  • Save cwardzala/3850e3a0d1eb869f76f12d522c61c6fd to your computer and use it in GitHub Desktop.
Save cwardzala/3850e3a0d1eb869f76f12d522c61c6fd to your computer and use it in GitHub Desktop.
React component to embed Iubenda privacy policy.
const Iubenda = ({
policyId
}) => {
useEffect(() => {
var s = document.createElement("script");
let tag = document.getElementsByTagName("script")[0];
s.src="https://cdn.iubenda.com/iubenda.js";
tag.parentNode.insertBefore(s,tag);
}, []);
return <a href={`https://www.iubenda.com/privacy-policy/${policyId}`} class="iubenda-white iubenda-embed" title="Privacy Policy ">Privacy Policy</a>
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment