mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
fix(website): static badge and overload switcher
This commit is contained in:
@@ -32,7 +32,7 @@ export default function OverloadSwitcher({ overloads, children }: PropsWithChild
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col place-items-start gap-2">
|
<div className="flex flex-col place-items-start gap-2">
|
||||||
<MenuButton
|
<MenuButton
|
||||||
className="rounded bg-light-700 p-3 outline-0 active:bg-light-800 dark:bg-dark-600 hover:bg-light-800 focus:ring focus:ring-width-2 focus:ring-blurple dark:active:bg-dark-400 dark:hover:bg-dark-500"
|
className="mb-2 rounded bg-white p-3 outline-0 active:bg-light-900 dark:bg-dark-400 hover:bg-light-800 focus:ring focus:ring-width-2 focus:ring-blurple md:-ml-2 dark:active:bg-dark-200 dark:hover:bg-dark-300"
|
||||||
state={menu}
|
state={menu}
|
||||||
>
|
>
|
||||||
<div className="flex flex-row place-content-between place-items-center gap-2">
|
<div className="flex flex-row place-content-between place-items-center gap-2">
|
||||||
|
|||||||
@@ -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 type { PropsWithChildren } from 'react';
|
||||||
import { Anchor } from './Anchor';
|
import { Anchor } from './Anchor';
|
||||||
import { ExcerptText } from './ExcerptText';
|
import { ExcerptText } from './ExcerptText';
|
||||||
@@ -17,7 +22,7 @@ export function Property({
|
|||||||
inheritedFrom,
|
inheritedFrom,
|
||||||
}: PropsWithChildren<{
|
}: PropsWithChildren<{
|
||||||
inheritedFrom?: (ApiDeclaredItem & ApiItemContainerMixin) | undefined;
|
inheritedFrom?: (ApiDeclaredItem & ApiItemContainerMixin) | undefined;
|
||||||
item: ApiPropertyItem;
|
item: ApiProperty | ApiPropertySignature;
|
||||||
separator?: PropertySeparatorType;
|
separator?: PropertySeparatorType;
|
||||||
}>) {
|
}>) {
|
||||||
const isDeprecated = Boolean(item.tsdocComment?.deprecatedBlock);
|
const isDeprecated = Boolean(item.tsdocComment?.deprecatedBlock);
|
||||||
@@ -26,7 +31,7 @@ export function Property({
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col scroll-mt-30 gap-4" id={item.displayName}>
|
<div className="flex flex-col scroll-mt-30 gap-4" id={item.displayName}>
|
||||||
<div className="flex flex-col gap-2 md:-ml-9">
|
<div className="flex flex-col gap-2 md:-ml-9">
|
||||||
{isDeprecated || item.isReadonly || item.isOptional ? (
|
{isDeprecated || item.isReadonly || item.isOptional || (item as ApiProperty).isStatic ? (
|
||||||
<div className="flex flex-row gap-1 md:ml-7">
|
<div className="flex flex-row gap-1 md:ml-7">
|
||||||
{isDeprecated ? (
|
{isDeprecated ? (
|
||||||
<div className="h-5 flex flex-row place-content-center place-items-center rounded-full bg-red-500 px-3 text-center text-xs font-semibold uppercase text-white">
|
<div className="h-5 flex flex-row place-content-center place-items-center rounded-full bg-red-500 px-3 text-center text-xs font-semibold uppercase text-white">
|
||||||
@@ -43,6 +48,11 @@ export function Property({
|
|||||||
Optional
|
Optional
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
{(item as ApiProperty).isStatic ? (
|
||||||
|
<div className="h-5 flex flex-row place-content-center place-items-center rounded-full bg-blurple px-3 text-center text-xs font-semibold uppercase text-white">
|
||||||
|
Static
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<div className="flex flex-row flex-wrap place-items-center gap-1">
|
<div className="flex flex-row flex-wrap place-items-center gap-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user