mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Fix OpenAPI enum display (#3077)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
'@gitbook/react-openapi': patch
|
||||||
|
'gitbook': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix OpenAPI enum display
|
||||||
@@ -265,15 +265,11 @@
|
|||||||
|
|
||||||
/* Schema Enum */
|
/* Schema Enum */
|
||||||
.openapi-schema-enum {
|
.openapi-schema-enum {
|
||||||
@apply flex flex-row text-sm leading-relaxed gap-2 flex-wrap text-tint;
|
@apply text-sm leading-relaxed max-w-full text-tint;
|
||||||
}
|
|
||||||
|
|
||||||
.openapi-schema-enum-list {
|
|
||||||
@apply flex flex-row gap-1.5 items-center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.openapi-schema-enum-value {
|
.openapi-schema-enum-value {
|
||||||
@apply text-sm;
|
@apply text-sm mr-1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.openapi-schema-enum-value:first-child {
|
.openapi-schema-enum-value:first-child {
|
||||||
|
|||||||
@@ -275,22 +275,20 @@ function OpenAPISchemaEnum(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="openapi-schema-enum">
|
<span className="openapi-schema-enum">
|
||||||
<span>Available options:</span>
|
Available options:{' '}
|
||||||
<div className="openapi-schema-enum-list">
|
{enumValues.map((item, index) => (
|
||||||
{enumValues.map((item, index) => (
|
<span key={index} className="openapi-schema-enum-value">
|
||||||
<span key={index} className="openapi-schema-enum-value">
|
<OpenAPICopyButton
|
||||||
<OpenAPICopyButton
|
value={item.value}
|
||||||
value={item.value}
|
label={item.description}
|
||||||
label={item.description}
|
withTooltip={!!item.description}
|
||||||
withTooltip={!!item.description}
|
>
|
||||||
>
|
<code>{`${item.value}`}</code>
|
||||||
<code>{`${item.value}`}</code>
|
</OpenAPICopyButton>
|
||||||
</OpenAPICopyButton>
|
</span>
|
||||||
</span>
|
))}
|
||||||
))}
|
</span>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user