From 70da3746f880d0b83f04ea0485850f49f7945a62 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Thu, 13 Apr 2023 20:56:44 +0200 Subject: [PATCH] fix(website): static badge and overload switcher --- apps/website/src/components/OverloadSwitcher.tsx | 2 +- apps/website/src/components/Property.tsx | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/website/src/components/OverloadSwitcher.tsx b/apps/website/src/components/OverloadSwitcher.tsx index c7bc283a2..cff7a3b53 100644 --- a/apps/website/src/components/OverloadSwitcher.tsx +++ b/apps/website/src/components/OverloadSwitcher.tsx @@ -32,7 +32,7 @@ export default function OverloadSwitcher({ overloads, children }: PropsWithChild return (
diff --git a/apps/website/src/components/Property.tsx b/apps/website/src/components/Property.tsx index 556b45640..db1a01563 100644 --- a/apps/website/src/components/Property.tsx +++ b/apps/website/src/components/Property.tsx @@ -1,4 +1,9 @@ -import type { ApiDeclaredItem, ApiItemContainerMixin, ApiPropertyItem } from '@microsoft/api-extractor-model'; +import type { + ApiDeclaredItem, + ApiItemContainerMixin, + ApiProperty, + ApiPropertySignature, +} from '@microsoft/api-extractor-model'; import type { PropsWithChildren } from 'react'; import { Anchor } from './Anchor'; import { ExcerptText } from './ExcerptText'; @@ -17,7 +22,7 @@ export function Property({ inheritedFrom, }: PropsWithChildren<{ inheritedFrom?: (ApiDeclaredItem & ApiItemContainerMixin) | undefined; - item: ApiPropertyItem; + item: ApiProperty | ApiPropertySignature; separator?: PropertySeparatorType; }>) { const isDeprecated = Boolean(item.tsdocComment?.deprecatedBlock); @@ -26,7 +31,7 @@ export function Property({ return (
- {isDeprecated || item.isReadonly || item.isOptional ? ( + {isDeprecated || item.isReadonly || item.isOptional || (item as ApiProperty).isStatic ? (
{isDeprecated ? (
@@ -43,6 +48,11 @@ export function Property({ Optional
) : null} + {(item as ApiProperty).isStatic ? ( +
+ Static +
+ ) : null}
) : null}