mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +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>{children}</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
{kind === 'Class' && methods && properties ? (
|
{kind === 'Class' && (methods?.length || properties?.length) ? (
|
||||||
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
||||||
<Aside
|
<Aside
|
||||||
sx={{ backgroundColor: 'transparent' }}
|
sx={{ backgroundColor: 'transparent' }}
|
||||||
@@ -113,7 +113,7 @@ export function DocContainer({
|
|||||||
withBorder={false}
|
withBorder={false}
|
||||||
>
|
>
|
||||||
<ScrollArea p="xs">
|
<ScrollArea p="xs">
|
||||||
<TableOfContentItems properties={properties} methods={methods}></TableOfContentItems>
|
<TableOfContentItems properties={properties ?? []} methods={methods ?? []}></TableOfContentItems>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</Aside>
|
</Aside>
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
|
|||||||
@@ -68,10 +68,18 @@ export function TableOfContentItems({
|
|||||||
<VscListSelection size={20} />
|
<VscListSelection size={20} />
|
||||||
<Text>Table of content</Text>
|
<Text>Table of content</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Text>Properties</Text>
|
{propertyItems.length ? (
|
||||||
{propertyItems}
|
<>
|
||||||
<Text>Methods</Text>
|
<Text>Properties</Text>
|
||||||
{methodItems}
|
{propertyItems}
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
{methodItems.length ? (
|
||||||
|
<>
|
||||||
|
<Text>Methods</Text>
|
||||||
|
{methodItems}
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user