X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fmodlog.tsx;h=ca1cb3326b2cfef3a2ca454d00d071d454e72abc;hb=ed0fd264de3d2162a3837733632fee69696681aa;hp=91da558ff42b8da0291f168c7f6e2a1a47b6846c;hpb=ced7b887d21bc53b5b3ac18c535a70f74d705f04;p=lemmy-ui.git diff --git a/src/shared/components/modlog.tsx b/src/shared/components/modlog.tsx index 91da558..ca1cb33 100644 --- a/src/shared/components/modlog.tsx +++ b/src/shared/components/modlog.tsx @@ -1,6 +1,21 @@ -import { debounce, getQueryParams, getQueryString } from "@utils/helpers"; +import { + fetchUsers, + getUpdatedSearchId, + myAuth, + personToChoice, + setIsoData, +} from "@utils/app"; +import { + debounce, + formatPastDate, + getIdFromString, + getPageFromString, + getQueryParams, + getQueryString, +} from "@utils/helpers"; import { amAdmin, amMod } from "@utils/roles"; import type { QueryParams } from "@utils/types"; +import { Choice, RouteDataResponse } from "@utils/types"; import { NoOptionI18nKeys } from "i18next"; import { Component, linkEvent } from "inferno"; import { T } from "inferno-i18next-dess"; @@ -30,23 +45,10 @@ import { ModlogActionType, Person, } from "lemmy-js-client"; -import moment from "moment"; -import { i18n } from "../i18next"; +import { fetchLimit } from "../config"; import { InitialFetchRequest } from "../interfaces"; -import { FirstLoadService } from "../services/FirstLoadService"; +import { FirstLoadService, I18NextService } from "../services"; import { HttpService, RequestState } from "../services/HttpService"; -import { - Choice, - RouteDataResponse, - fetchLimit, - fetchUsers, - getIdFromString, - getPageFromString, - getUpdatedSearchId, - myAuth, - personToChoice, - setIsoData, -} from "../utils"; import { HtmlTags } from "./common/html-tags"; import { Icon, Spinner } from "./common/icon"; import { MomentTime } from "./common/moment-time"; @@ -310,6 +312,7 @@ function renderModlogType({ type_, view }: ModlogType) { const { mod_feature_post: { featured, is_featured_community }, post: { id, name }, + community, } = view as ModFeaturePostView; return ( @@ -318,7 +321,12 @@ function renderModlogType({ type_, view }: ModlogType) { Post {name} - {is_featured_community ? " In Community" : " In Local"} + + {is_featured_community + ? " in community " + : " in Local, from community "} + + ); } @@ -369,7 +377,7 @@ function renderModlogType({ type_, view }: ModlogType) { )} {expires && ( -
expires: {moment.utc(expires).fromNow()}
+
expires: {formatPastDate(expires)}
)} @@ -401,7 +409,7 @@ function renderModlogType({ type_, view }: ModlogType) { )} {expires && ( -
expires: {moment.utc(expires).fromNow()}
+
expires: {formatPastDate(expires)}
)} @@ -465,7 +473,7 @@ function renderModlogType({ type_, view }: ModlogType) { )} {expires && ( -
expires: {moment.utc(expires).fromNow()}
+
expires: {formatPastDate(expires)}
)} @@ -530,7 +538,7 @@ function renderModlogType({ type_, view }: ModlogType) { return ( <> - Purged a Post from from + Purged a Post from {reason && ( @@ -583,14 +591,14 @@ const Filter = ({ }) => (
id === person.id ) - ? i18n.t("admin") - : i18n.t("mod"); + ? I18NextService.i18n.t("admin") + : I18NextService.i18n.t("mod"); } get documentTitle(): string { @@ -745,87 +757,83 @@ export class Modlog extends Component< path={this.context.router.route.match.url} /> -
-
- - - ### - -
- {this.state.communityRes.state === "success" && ( -
- - /c/{this.state.communityRes.data.community_view.community.name}{" "} - - {i18n.t("modlog")} -
- )} -
-
- -
+

{I18NextService.i18n.t("modlog")}

+ +
+ + + ### + +
+ {this.state.communityRes.state === "success" && ( +
+ + /c/{this.state.communityRes.data.community_view.community.name}{" "} + + {I18NextService.i18n.t("modlog")} +
+ )} +
+
+
-
+
+
+ + {!this.isoData.site_res.site_view.local_site + .hide_modlog_mod_names && ( - {!this.isoData.site_res.site_view.local_site - .hide_modlog_mod_names && ( - - )} -
- {this.renderModlogTable()} + )}
+ {this.renderModlogTable()}
); } @@ -845,9 +853,9 @@ export class Modlog extends Component< - - - + + + {this.combined}
{i18n.t("time")}{i18n.t("mod")}{i18n.t("action")} {I18NextService.i18n.t("time")}{I18NextService.i18n.t("mod")}{I18NextService.i18n.t("action")}