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