[feature] Allow user to set "bot" flag; show bot icon on profile (#3135)

* [feature] Allow user to set "bot" flag; show bot icon on profile

* tweak

* update customs
This commit is contained in:
tobi
2024-07-24 10:40:56 +02:00
committed by GitHub
parent db0a47126e
commit 325b4a2b4a
7 changed files with 117 additions and 32 deletions

View File

@ -19,7 +19,7 @@
import React from "react";
export default function FakeProfile({ avatar, header, display_name, username, role }) {
export default function FakeProfile({ avatar, header, display_name, bot, username, role }) {
return ( // Keep in sync with web/template/profile.tmpl
<div className="profile">
<div className="profile-header">
@ -35,8 +35,24 @@ export default function FakeProfile({ avatar, header, display_name, username, ro
<dl className="namerole">
<dt className="sr-only">Display name</dt>
<dd className="displayname text-cutoff">{display_name.trim().length > 0 ? display_name : username}</dd>
<dt className="sr-only">Username</dt>
<dd className="username text-cutoff">@{username}</dd>
<div className="bot-username-wrapper">
{ bot && <>
<dt className="sr-only">Bot account</dt>
<dd>
<span className="sr-only">true</span>
<div
className="bot-legend-wrapper"
aria-hidden="true"
title="This is a bot account."
>
<i className="bot-icon fa fa-microchip"></i>
<span className="bot-legend">bot</span>
</div>
</dd>
</>}
<dt className="sr-only">Username</dt>
<dd className="username text-cutoff">@{username}</dd>
</div>
<dt className="sr-only">Role</dt>
{
(role && role.name != "user") ?