Skip to content

Commit

Permalink
feat: deprecation badges
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Aug 18, 2022
1 parent 7f415a2 commit 673262d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/website/src/components/CodeListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export function CodeListing({
return (
<Stack spacing="xs" key={name}>
<Group>
{deprecation ? (
<Badge variant="filled" color="red">
Deprecated
</Badge>
) : null}
{readonly ? <Badge variant="filled">Readonly</Badge> : null}
{optional ? <Badge variant="filled">Optional</Badge> : null}
<Title order={4} className="font-mono">
Expand Down
5 changes: 5 additions & 0 deletions packages/website/src/components/MethodItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export function MethodItem({ data }: { data: MethodResolvable }) {
<Group>
<Stack>
<Group>
{data.deprecated ? (
<Badge variant="filled" color="red">
Deprecated
</Badge>
) : null}
{data.kind === 'Method' && method.visibility === Visibility.Protected ? (
<Badge variant="filled">Protected</Badge>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion packages/website/src/components/tsdoc/BlockComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function ExampleBlock({ children, exampleIndex }: ExampleBlockProps): JSX

export function DeprecatedBlock({ children }: { children: ReactNode }): JSX.Element {
return (
<Alert icon={<VscWarning />} title="Deprecated" color="red" radius="xs">
<Alert icon={<VscWarning />} title="Deprecated" variant="filled" color="red" radius="xs">
{children}
</Alert>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/website/src/components/tsdoc/TSDoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function TSDoc({ node }: { node: AnyDocNodeJSON }): JSX.Element {
(block) => block.tag.tagName.toUpperCase() === StandardTags.example.tagNameWithUpperCase,
).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:
console.log(`Captured unknown node kind: ${node.kind}`);
Expand Down

1 comment on commit 673262d

@vercel
Copy link

@vercel vercel bot commented on 673262d Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.