mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
simplify logoHref
This commit is contained in:
parent
2873b6a79a
commit
f7e7f19165
|
@ -11,6 +11,8 @@ export class ApiLogo extends React.Component<{ info: OpenAPIInfo }> {
|
|||
if (!logoInfo || !logoInfo.url) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const logoHref = logoInfo.href || (info.contact && info.contact.url);
|
||||
|
||||
// Use the english word logo if no alt text is provided
|
||||
const altText = logoInfo.altText ? logoInfo.altText : 'logo';
|
||||
|
@ -25,9 +27,8 @@ export class ApiLogo extends React.Component<{ info: OpenAPIInfo }> {
|
|||
return (
|
||||
<LogoWrap>
|
||||
{
|
||||
logoInfo.href ? LinkWrap(logoInfo.href)(logo) :
|
||||
info.contact && info.contact.url ? LinkWrap(info.contact.url)(logo) : logo
|
||||
}{' '}
|
||||
logoHref ? LinkWrap(logoHref)(logo) : logo
|
||||
}
|
||||
</LogoWrap>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user