Sidemenu: Fix logout button (#38747)

This commit is contained in:
Ashley Harrison 2021-08-31 11:33:38 +01:00 committed by GitHub
parent 3fb5afb9e3
commit b40d48258d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,15 +26,16 @@ const DropDownChild = ({ isDivider = false, icon, onClick, target, text, url }:
let anchor = <a onClick={onClick}>{linkContent}</a>;
if (url) {
anchor = url.startsWith('/') ? (
<Link onClick={onClick} href={url}>
{linkContent}
</Link>
) : (
<a href={url} target={target} rel="noopener" onClick={onClick}>
{linkContent}
</a>
);
anchor =
!target && url.startsWith('/') ? (
<Link onClick={onClick} href={url}>
{linkContent}
</Link>
) : (
<a href={url} target={target} rel="noopener" onClick={onClick}>
{linkContent}
</a>
);
}
return isDivider ? <li data-testid="dropdown-child-divider" className="divider" /> : <li>{anchor}</li>;