0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed links in Portal signup terms

Because we load Portal in an iFrame the anchor tags do nto work
correctly. We've intercepted all clicks on them and manually opened
the URL in a new window instead.
This commit is contained in:
Fabien "egg" O'Carroll 2023-04-07 14:24:42 +07:00
parent aaaedbf715
commit 4225377436

View file

@ -519,8 +519,15 @@ class SignupPage extends React.Component {
const className = `gh-portal-signup-terms ${errorClassName}`;
const interceptAnchorClicks = (e) => {
if (e.target.tagName === 'A') {
e.preventDefault();
window.open(e.target.href, '_blank');
}
};
return (
<div className={className}>
<div className={className} onClick={interceptAnchorClicks}>
{signupTerms}
</div>
);