From: Nutomic <me@nutomic.com> Date: Mon, 14 Mar 2022 20:09:29 +0000 (+0000) Subject: Differentiate between mods and admins in mod log (#597) X-Git-Url: http://these/git/%7B%60/feeds/README.md?a=commitdiff_plain;h=3fe9dc0d7bd7992e3d1f0e1fd27ec84688b78f25;p=lemmy-ui.git Differentiate between mods and admins in mod log (#597) --- diff --git a/src/shared/components/modlog.tsx b/src/shared/components/modlog.tsx index cc3c7a1..e01b81e 100644 --- a/src/shared/components/modlog.tsx +++ b/src/shared/components/modlog.tsx @@ -16,6 +16,7 @@ import { ModRemovePostView, ModStickyPostView, ModTransferCommunityView, + PersonSafe, SiteView, UserOperation, } from "lemmy-js-client"; @@ -399,7 +400,7 @@ export class Modlog extends Component<any, ModlogState> { {this.isAdminOrMod ? ( <PersonListing person={i.view.moderator} /> ) : ( - <div>{i18n.t("mod")}</div> + <div>{this.modOrAdminText(i.view.moderator)}</div> )} </td> <td>{this.renderModlogType(i)}</td> @@ -424,6 +425,16 @@ export class Modlog extends Component<any, ModlogState> { return isAdmin || isMod; } + modOrAdminText(person: PersonSafe): Text { + if ( + this.isoData.site_res.admins.map(a => a.person.id).includes(person.id) + ) { + return i18n.t("admin"); + } else { + return i18n.t("mod"); + } + } + get documentTitle(): string { return `Modlog - ${this.state.site_view.site.name}`; }