🐛 Fixed support and powered by links not working

closes https://github.com/TryGhost/Ghost/issues/12367

- Support and powered by links were not opened through `href` inside iframe
- Adds support to open these links via `window.open` to bypass iframe restriction
This commit is contained in:
Rish 2020-11-24 22:47:29 +05:30
parent dff46b99a2
commit e36b9360e7
3 changed files with 13 additions and 3 deletions

View File

@ -152,7 +152,13 @@ class PopupContent extends React.Component {
{this.renderPopupNotification()}
{this.renderActivePage()}
</div>
<div className={'gh-portal-powered' + (hasMode(['preview']) ? ' hidden' : '')}><a href='https://ghost.org' target='_blank' rel='noopener noreferrer'><PoweredIcon /> <span>Publish with Ghost</span></a></div>
<div className={'gh-portal-powered' + (hasMode(['preview']) ? ' hidden' : '')}>
<a href='https://ghost.org' target='_blank' rel='noopener noreferrer' onClick={() => {
window.open('https://ghost.org', '_blank');
}}>
<PoweredIcon /> <span>Publish with Ghost</span>
</a>
</div>
</div>
);
}

View File

@ -107,7 +107,9 @@ const NotificationText = ({message, site}) => {
);
}
return (
<p> An unexpected error occured. Please try again or <a href={supportAddressMail}>contact support</a> if the error persists.</p>
<p> An unexpected error occured. Please try again or <a href={supportAddressMail} onClick={() => {
supportAddressMail && window.open(supportAddressMail);
}}>contact support</a> if the error persists.</p>
);
};

View File

@ -111,7 +111,9 @@ const AccountFooter = ({onClose, handleSignout, supportAddress = ''}) => {
</ul>
<div className='gh-portal-account-footerright'>
<ul className='gh-portal-account-footermenu'>
<li><a className='gh-portal-btn gh-portal-btn-branded' href={supportAddressMail}>Contact support</a></li>
<li><a className='gh-portal-btn gh-portal-btn-branded' href={supportAddressMail} onClick={() => {
supportAddressMail && window.open(supportAddressMail);
}}>Contact support</a></li>
</ul>
</div>
</footer>