mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 23:54:45 +12:00
fix(website): switch signature with overload (#9643)
This commit is contained in:
parent
cd6986854f
commit
7b494aca5b
1 changed files with 8 additions and 10 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue