mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(website): link to external constructors (#10869)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod';
|
|||||||
import { Code2, LinkIcon } from 'lucide-react';
|
import { Code2, LinkIcon } from 'lucide-react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { ENV } from '@/util/env';
|
import { ENV } from '@/util/env';
|
||||||
|
import { Badges } from './Badges';
|
||||||
import { ExampleNode } from './ExampleNode';
|
import { ExampleNode } from './ExampleNode';
|
||||||
import { ParameterNode } from './ParameterNode';
|
import { ParameterNode } from './ParameterNode';
|
||||||
import { SeeNode } from './SeeNode';
|
import { SeeNode } from './SeeNode';
|
||||||
@@ -20,11 +21,14 @@ export async function ConstructorNode({ node, version }: { readonly node: any; r
|
|||||||
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group px-2 font-mono font-semibold break-all`}
|
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group px-2 font-mono font-semibold break-all`}
|
||||||
id="constructor"
|
id="constructor"
|
||||||
>
|
>
|
||||||
{/* constructor({parsedContent.constructor.parametersString}) */}
|
<Badges node={node} />
|
||||||
<Link className="float-left -ml-6 hidden pr-2 pb-2 group-hover:block" href="#constructor">
|
<span>
|
||||||
<LinkIcon aria-hidden size={16} />
|
{/* constructor({parsedContent.constructor.parametersString}) */}
|
||||||
</Link>
|
<Link className="float-left -ml-6 hidden pr-2 pb-2 group-hover:block" href="#constructor">
|
||||||
constructor({node.parameters?.length ? <ParameterNode node={node.parameters} version={version} /> : null})
|
<LinkIcon aria-hidden size={16} />
|
||||||
|
</Link>
|
||||||
|
constructor({node.parameters?.length ? <ParameterNode node={node.parameters} version={version} /> : null})
|
||||||
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|||||||
@@ -690,12 +690,8 @@ function itemParameters(item: ApiDocumentedItem & ApiParameterListMixin) {
|
|||||||
|
|
||||||
function itemConstructor(item: ApiConstructor) {
|
function itemConstructor(item: ApiConstructor) {
|
||||||
return {
|
return {
|
||||||
kind: item.kind,
|
...itemInfo(item),
|
||||||
name: item.displayName,
|
|
||||||
sourceURL: item.sourceLocation.fileUrl,
|
|
||||||
sourceLine: item.sourceLocation.fileLine,
|
|
||||||
parametersString: parametersString(item),
|
parametersString: parametersString(item),
|
||||||
summary: item.tsdocComment ? itemTsDoc(item.tsdocComment, item) : null,
|
|
||||||
parameters: itemParameters(item),
|
parameters: itemParameters(item),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user