A11Y: Add href to frequent poster avatars (#18627)

This commit is contained in:
Keegan George 2022-10-17 14:08:59 -07:00 committed by GitHub
parent 1b22ff461b
commit de9ed8792a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
import { replaceEmoji } from "discourse/widgets/emoji";
import autoGroupFlairForUser from "discourse/lib/avatar-flair";
import { userPath } from "discourse/lib/url";
const LINKS_SHOWN = 5;
@ -87,12 +88,15 @@ createWidget("topic-participant", {
linkContents.push(this.attach("avatar-flair", autoFlairAttrs));
}
}
return h(
"a.poster.trigger-user-card",
{
className: state.toggled ? "toggled" : null,
attributes: { title: attrs.username, "data-user-card": attrs.username },
attributes: {
title: attrs.username,
"data-user-card": attrs.username,
href: userPath(attrs.username),
},
},
linkContents
);