mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
Add feature to specify href for logo explicitly.
This commit is contained in:
parent
ab98ab0cb2
commit
2873b6a79a
|
@ -96,6 +96,7 @@ The information about API logo
|
|||
| url | string | The URL pointing to the spec logo. MUST be in the format of a URL. It SHOULD be an absolute URL so your API definition is usable from any location
|
||||
| backgroundColor | string | background color to be used. MUST be RGB color in [hexadecimal format] (https://en.wikipedia.org/wiki/Web_colors#Hex_triplet)
|
||||
| altText | string | Text to use for alt tag on the logo. Defaults to 'logo' if nothing is provided.
|
||||
| href | string | The URL pointing to the contact page. Default to 'info.contact.url' field of the OAS.
|
||||
|
||||
|
||||
###### x-logo example
|
||||
|
|
|
@ -24,7 +24,10 @@ export class ApiLogo extends React.Component<{ info: OpenAPIInfo }> {
|
|||
);
|
||||
return (
|
||||
<LogoWrap>
|
||||
{info.contact && info.contact.url ? LinkWrap(info.contact.url)(logo) : logo}{' '}
|
||||
{
|
||||
logoInfo.href ? LinkWrap(logoInfo.href)(logo) :
|
||||
info.contact && info.contact.url ? LinkWrap(info.contact.url)(logo) : logo
|
||||
}{' '}
|
||||
</LogoWrap>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user