mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(website): switch signature with overload (#9643)
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
ApiMethodSignature,
|
||||
} from '@microsoft/api-extractor-model';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { Fragment } from 'react';
|
||||
import { MethodDocumentation } from './MethodDocumentation';
|
||||
import { MethodHeader } from './MethodHeader';
|
||||
|
||||
@@ -20,17 +21,14 @@ export function Method({
|
||||
if (method.getMergedSiblings().length > 1) {
|
||||
// We have overloads, use the overload switcher, but render
|
||||
// each overload node on the server.
|
||||
const overloads = method
|
||||
.getMergedSiblings()
|
||||
.map((sibling, idx) => (
|
||||
<MethodDocumentation key={`${sibling.displayName}-${idx}`} method={sibling as ApiMethod | ApiMethodSignature} />
|
||||
));
|
||||
const overloads = method.getMergedSiblings().map((sibling, idx) => (
|
||||
<Fragment key={`${sibling.displayName}-${idx}`}>
|
||||
<MethodHeader method={sibling as ApiMethod | ApiMethodSignature} />
|
||||
<MethodDocumentation method={sibling as ApiMethod | ApiMethodSignature} />
|
||||
</Fragment>
|
||||
));
|
||||
|
||||
return (
|
||||
<OverloadSwitcher overloads={overloads}>
|
||||
<MethodHeader method={method} />
|
||||
</OverloadSwitcher>
|
||||
);
|
||||
return <OverloadSwitcher overloads={overloads} />;
|
||||
}
|
||||
|
||||
// We have just a single method, render it on the server.
|
||||
|
||||
Reference in New Issue
Block a user