OpenAPI: Fix display on property components

This commit is contained in:
fuma-nama
2024-08-25 00:37:48 +08:00
parent 9a72c66bc1
commit 029a1565a6
3 changed files with 12 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-openapi': patch
---
Fix `display` on property components
+5 -1
View File
@@ -2,6 +2,10 @@ import { createSourceAuto } from '@fumadocs/mdx-remote/github';
import { loader } from 'fumadocs-core/source';
import { cache } from 'react';
const token = process.env.GITHUB_TOKEN;
if (!token) throw new Error('`GITHUB_TOKEN` is missing');
export const getDocs = cache(async () => {
return loader({
source: await createSourceAuto({
@@ -10,7 +14,7 @@ export const getDocs = cache(async () => {
repo: 'fumadocs',
directory: 'examples/remote-mdx/content',
treeSha: 'dev',
accessToken: process.env.GITHUB_TOKEN ?? '',
accessToken: token,
},
}),
rootDir: 'docs',
+2 -2
View File
@@ -88,8 +88,8 @@ export function Property({
children,
}: PropertyProps): React.ReactElement {
return (
<div className="mb-4 flex flex-col rounded-lg border bg-fd-card p-3 prose-no-margin">
<h4 className="inline-flex items-center gap-4">
<div className="mb-4 rounded-lg border bg-fd-card p-3 prose-no-margin">
<h4 className="flex flex-row items-center gap-4">
<code>{name}</code>
{required ? (
<div className={cn(badgeVariants({ color: 'red' }))}>Required</div>