mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: properly check for properties and methods
This commit is contained in:
@@ -104,7 +104,7 @@ export function DocContainer({
|
||||
<Stack>{children}</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
{kind === 'Class' && methods && properties ? (
|
||||
{kind === 'Class' && (methods?.length || properties?.length) ? (
|
||||
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
||||
<Aside
|
||||
sx={{ backgroundColor: 'transparent' }}
|
||||
@@ -113,7 +113,7 @@ export function DocContainer({
|
||||
withBorder={false}
|
||||
>
|
||||
<ScrollArea p="xs">
|
||||
<TableOfContentItems properties={properties} methods={methods}></TableOfContentItems>
|
||||
<TableOfContentItems properties={properties ?? []} methods={methods ?? []}></TableOfContentItems>
|
||||
</ScrollArea>
|
||||
</Aside>
|
||||
</MediaQuery>
|
||||
|
||||
@@ -68,10 +68,18 @@ export function TableOfContentItems({
|
||||
<VscListSelection size={20} />
|
||||
<Text>Table of content</Text>
|
||||
</Group>
|
||||
<Text>Properties</Text>
|
||||
{propertyItems}
|
||||
<Text>Methods</Text>
|
||||
{methodItems}
|
||||
{propertyItems.length ? (
|
||||
<>
|
||||
<Text>Properties</Text>
|
||||
{propertyItems}
|
||||
</>
|
||||
) : null}
|
||||
{methodItems.length ? (
|
||||
<>
|
||||
<Text>Methods</Text>
|
||||
{methodItems}
|
||||
</>
|
||||
) : null}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user