X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fmodlog.tsx;h=ca1cb3326b2cfef3a2ca454d00d071d454e72abc;hb=ed0fd264de3d2162a3837733632fee69696681aa;hp=e8c707ed69deede81d54d8e928462e119637e739;hpb=a22fda4b6ef8995142cedb7ec9493c1c3f4efc7e;p=lemmy-ui.git diff --git a/src/shared/components/modlog.tsx b/src/shared/components/modlog.tsx index e8c707e..ca1cb33 100644 --- a/src/shared/components/modlog.tsx +++ b/src/shared/components/modlog.tsx @@ -5,9 +5,9 @@ import { personToChoice, setIsoData, } from "@utils/app"; -import { isBrowser } from "@utils/browser"; import { debounce, + formatPastDate, getIdFromString, getPageFromString, getQueryParams, @@ -45,7 +45,6 @@ import { ModlogActionType, Person, } from "lemmy-js-client"; -import moment from "moment"; import { fetchLimit } from "../config"; import { InitialFetchRequest } from "../interfaces"; import { FirstLoadService, I18NextService } from "../services"; @@ -313,6 +312,7 @@ function renderModlogType({ type_, view }: ModlogType) { const { mod_feature_post: { featured, is_featured_community }, post: { id, name }, + community, } = view as ModFeaturePostView; return ( @@ -321,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 "} + + ); } @@ -372,7 +377,7 @@ function renderModlogType({ type_, view }: ModlogType) { )} {expires && ( -
expires: {moment.utc(expires).fromNow()}
+
expires: {formatPastDate(expires)}
)} @@ -404,7 +409,7 @@ function renderModlogType({ type_, view }: ModlogType) { )} {expires && ( -
expires: {moment.utc(expires).fromNow()}
+
expires: {formatPastDate(expires)}
)} @@ -468,7 +473,7 @@ function renderModlogType({ type_, view }: ModlogType) { )} {expires && ( -
expires: {moment.utc(expires).fromNow()}
+
expires: {formatPastDate(expires)}
)} @@ -533,7 +538,7 @@ function renderModlogType({ type_, view }: ModlogType) { return ( <> - Purged a Post from from + Purged a Post from {reason && ( @@ -661,7 +666,7 @@ export class Modlog extends Component< this.handleModChange = this.handleModChange.bind(this); // Only fetch the data if coming from another route - if (!isBrowser() || FirstLoadService.isFirstLoad) { + if (FirstLoadService.isFirstLoad) { const { res, communityRes, modUserResponse, userResponse } = this.isoData.routeData; @@ -752,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}{" "} - - {I18NextService.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()}
); }