mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix(website): accessibility
This commit is contained in:
@@ -13,14 +13,14 @@ export interface RemarksBlockProps {
|
||||
}
|
||||
|
||||
export function CommentSection({ node, textClassName }: RemarksBlockProps): JSX.Element {
|
||||
const createNode = (node: ReturnType<CommentNode['toJSON']>): ReactNode => {
|
||||
const createNode = (node: ReturnType<CommentNode['toJSON']>, idx?: number): ReactNode => {
|
||||
switch (node.kind) {
|
||||
case 'PlainText':
|
||||
return <span>{(node as ReturnType<PlainTextCommentNode['toJSON']>).text}</span>;
|
||||
case 'Paragraph':
|
||||
return (
|
||||
<p className={textClassName}>
|
||||
{(node as ReturnType<CommentNodeContainer['toJSON']>).nodes.map((node) => createNode(node))}
|
||||
<p key={idx} className={textClassName}>
|
||||
{(node as ReturnType<CommentNodeContainer['toJSON']>).nodes.map((node, idx) => createNode(node, idx))}
|
||||
</p>
|
||||
);
|
||||
case 'SoftBreak':
|
||||
@@ -52,7 +52,7 @@ export function CommentSection({ node, textClassName }: RemarksBlockProps): JSX.
|
||||
return (
|
||||
<div>
|
||||
{node.kind === 'Paragraph' || node.kind === 'Section' ? (
|
||||
<>{(node as CommentNodeContainer).nodes.map(createNode)}</>
|
||||
<>{(node as CommentNodeContainer).nodes.map((node, idx) => createNode(node, idx))}</>
|
||||
) : (
|
||||
<>{createNode(node)}</>
|
||||
)}
|
||||
|
||||
@@ -25,7 +25,12 @@ export function ItemSidebar({ packageName, data, selectedMember }: ItemListProps
|
||||
<VscPackage />
|
||||
{`${packageName}`}
|
||||
</h2>
|
||||
<button className="lg:hidden mr-2 bg-transparent border-none cursor-pointer" onClick={onMenuClick}>
|
||||
<button
|
||||
type="button"
|
||||
className="lg:hidden mr-2 bg-transparent border-none cursor-pointer"
|
||||
title="Menu"
|
||||
onClick={onMenuClick}
|
||||
>
|
||||
<FiMenu size={32} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,12 @@ export function MethodItem({ data }: MethodItemProps) {
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<div className="flex">
|
||||
<button className="bg-transparent border-none cursor-pointer dark:text-white" onClick={onAnchorClick}>
|
||||
<button
|
||||
type="button"
|
||||
className="bg-transparent border-none cursor-pointer dark:text-white"
|
||||
title="Anchor"
|
||||
onClick={onAnchorClick}
|
||||
>
|
||||
<FiLink size={16} />
|
||||
</button>
|
||||
<div className="flex flex-col">
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function IndexRoute() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex place-content-center">
|
||||
<a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss">
|
||||
<a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss" title="Vercel">
|
||||
<Image
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
src={vercelLogo}
|
||||
|
||||
Reference in New Issue
Block a user