mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Fix: Hide the server select panel, not just the select, if no or only one server is present (#1374)
* fix(packages/openapi): only show server select panel if servers exist * Create spotty-buckets-nail.md --------- Co-authored-by: Michael Ermer <[email protected]>
This commit is contained in:
co-authored by
Michael Ermer
parent
33d47f7a30
commit
ff9bf0f7df
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fumadocs-openapi": patch
|
||||
---
|
||||
|
||||
Fix: Hide the server select panel, not just the select, if no or only one server is present
|
||||
@@ -106,7 +106,7 @@ export function APIPlayground({
|
||||
ResultDisplay: FC<{ data: FetchResult }>;
|
||||
}>;
|
||||
} & HTMLAttributes<HTMLFormElement>) {
|
||||
const { serverRef } = useApiContext();
|
||||
const { serverRef, servers } = useApiContext();
|
||||
const dynamicRef = useRef(new Map<string, DynamicField>());
|
||||
const form = useForm<FormValues>({
|
||||
defaultValues: {
|
||||
@@ -244,9 +244,11 @@ export function APIPlayground({
|
||||
route={route}
|
||||
isLoading={testQuery.isLoading}
|
||||
/>
|
||||
<CollapsiblePanel title="Server URL">
|
||||
<ServerSelect />
|
||||
</CollapsiblePanel>
|
||||
{servers.length > 1 ? (
|
||||
<CollapsiblePanel title="Server URL">
|
||||
<ServerSelect />
|
||||
</CollapsiblePanel>
|
||||
) : null}
|
||||
|
||||
{header.length > 0 || authorization ? (
|
||||
<CollapsiblePanel title="Headers">
|
||||
|
||||
Reference in New Issue
Block a user