fix(website): accessibility

This commit is contained in:
iCrawl
2022-08-12 17:03:04 +02:00
parent c97977a3e8
commit 2447165c82
4 changed files with 17 additions and 7 deletions

View File

@@ -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)}</>
)}

View File

@@ -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>

View File

@@ -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">

View File

@@ -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}