Further accessibility and semantic improvements

This commit is contained in:
Bad Manners 2024-08-15 23:50:23 -03:00
parent dafb240517
commit bf82d8bcd6
21 changed files with 82 additions and 480 deletions

View file

@ -3,6 +3,7 @@ import { t, type Lang } from "../i18n";
type Props = {
lang: Lang;
children: any;
};
const { lang } = Astro.props;

View file

@ -3,6 +3,7 @@ import { t, type Lang } from "../i18n";
type Props = {
lang: Lang;
children: any;
};
const { lang } = Astro.props;

View file

@ -24,7 +24,7 @@ const charactersPerUser = copyrightedCharacters ? await formatCopyrightedCharact
t(lang, "characters/characters_are_copyrighted_by", user, characters[0] === "" ? [] : characters)
}
>
<UserComponent lang={lang} user={user} />
<UserComponent class="p-name" lang={lang} user={user} />
</CopyrightedCharactersItem>
))}
</ul>

View file

@ -3,6 +3,7 @@ import { t, type Lang } from "../i18n";
type Props = {
lang: Lang;
children: any;
};
const { lang } = Astro.props;

View file

@ -6,19 +6,20 @@ import { getUsernameForLang } from "../utils/get_username_for_lang";
type Props = {
lang: Lang;
user: CollectionEntry<"users">;
class?: string;
};
const { user, lang } = Astro.props;
const { user, lang, class: className } = Astro.props;
const username = getUsernameForLang(user, lang);
const link = user.data.preferredLink ? user.data.links[user.data.preferredLink]!.link : null;
---
{
link ? (
<a href={link} class="text-link underline" target="_blank">
<a href={link} class:list={["h-card u-url text-link underline", className]} target="_blank">
{username}
</a>
) : (
<span>{username}</span>
<span class:list={["h-card", className]}>{username}</span>
)
}