mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
feat: deprecation badges
This commit is contained in:
@@ -35,6 +35,11 @@ export function CodeListing({
|
|||||||
return (
|
return (
|
||||||
<Stack spacing="xs" key={name}>
|
<Stack spacing="xs" key={name}>
|
||||||
<Group>
|
<Group>
|
||||||
|
{deprecation ? (
|
||||||
|
<Badge variant="filled" color="red">
|
||||||
|
Deprecated
|
||||||
|
</Badge>
|
||||||
|
) : null}
|
||||||
{readonly ? <Badge variant="filled">Readonly</Badge> : null}
|
{readonly ? <Badge variant="filled">Readonly</Badge> : null}
|
||||||
{optional ? <Badge variant="filled">Optional</Badge> : null}
|
{optional ? <Badge variant="filled">Optional</Badge> : null}
|
||||||
<Title order={4} className="font-mono">
|
<Title order={4} className="font-mono">
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ export function MethodItem({ data }: { data: MethodResolvable }) {
|
|||||||
<Group>
|
<Group>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Group>
|
<Group>
|
||||||
|
{data.deprecated ? (
|
||||||
|
<Badge variant="filled" color="red">
|
||||||
|
Deprecated
|
||||||
|
</Badge>
|
||||||
|
) : null}
|
||||||
{data.kind === 'Method' && method.visibility === Visibility.Protected ? (
|
{data.kind === 'Method' && method.visibility === Visibility.Protected ? (
|
||||||
<Badge variant="filled">Protected</Badge>
|
<Badge variant="filled">Protected</Badge>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export function ExampleBlock({ children, exampleIndex }: ExampleBlockProps): JSX
|
|||||||
|
|
||||||
export function DeprecatedBlock({ children }: { children: ReactNode }): JSX.Element {
|
export function DeprecatedBlock({ children }: { children: ReactNode }): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Alert icon={<VscWarning />} title="Deprecated" color="red" radius="xs">
|
<Alert icon={<VscWarning />} title="Deprecated" variant="filled" color="red" radius="xs">
|
||||||
{children}
|
{children}
|
||||||
</Alert>
|
</Alert>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export function TSDoc({ node }: { node: AnyDocNodeJSON }): JSX.Element {
|
|||||||
(block) => block.tag.tagName.toUpperCase() === StandardTags.example.tagNameWithUpperCase,
|
(block) => block.tag.tagName.toUpperCase() === StandardTags.example.tagNameWithUpperCase,
|
||||||
).length;
|
).length;
|
||||||
|
|
||||||
return <div key={idx}>{comment.customBlocks.map((node, idx) => createNode(node, idx))}</div>;
|
return <Box key={idx}>{comment.customBlocks.map((node, idx) => createNode(node, idx))}</Box>;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
console.log(`Captured unknown node kind: ${node.kind}`);
|
console.log(`Captured unknown node kind: ${node.kind}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user