mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 16:14:16 +08:00
A11Y: Add href
to frequent poster avatars (#18627)
This commit is contained in:
parent
1b22ff461b
commit
de9ed8792a
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user