From 623c8c7a5fe7a72387f748a6dd0988c866a689d8 Mon Sep 17 00:00:00 2001 From: Matteo Guglielmetti Date: Mon, 21 Oct 2019 08:42:17 +0200 Subject: [PATCH] Revert "Adds i18n to Prev and Next buttons in modlog" This reverts commit 272361ea5fb3361c77d7868f4bbed083b7cdeddf. --- ui/src/components/modlog.tsx | 45 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/ui/src/components/modlog.tsx b/ui/src/components/modlog.tsx index 1c1a7bac3..3af122a8e 100644 --- a/ui/src/components/modlog.tsx +++ b/ui/src/components/modlog.tsx @@ -8,7 +8,6 @@ import { msgOp, addTypeInfo, fetchLimit } from '../utils'; import { MomentTime } from './moment-time'; import * as moment from 'moment'; import { i18n } from '../i18next'; -import { T } from 'inferno-i18next'; interface ModlogState { combined: Array<{type_: string, data: ModRemovePost | ModLockPost | ModStickyPost | ModRemoveCommunity | ModAdd | ModBan}>, @@ -90,42 +89,42 @@ export class Modlog extends Component { {i.data.mod_user_name} - {i.type_ == 'removed_posts' && + {i.type_ == 'removed_posts' && <> - {(i.data as ModRemovePost).removed? 'Removed' : 'Restored'} + {(i.data as ModRemovePost).removed? 'Removed' : 'Restored'} Post {(i.data as ModRemovePost).post_name}
{(i.data as ModRemovePost).reason && ` reason: ${(i.data as ModRemovePost).reason}`}
} - {i.type_ == 'locked_posts' && + {i.type_ == 'locked_posts' && <> - {(i.data as ModLockPost).locked? 'Locked' : 'Unlocked'} + {(i.data as ModLockPost).locked? 'Locked' : 'Unlocked'} Post {(i.data as ModLockPost).post_name} } - {i.type_ == 'stickied_posts' && + {i.type_ == 'stickied_posts' && <> - {(i.data as ModStickyPost).stickied? 'Stickied' : 'Unstickied'} + {(i.data as ModStickyPost).stickied? 'Stickied' : 'Unstickied'} Post {(i.data as ModStickyPost).post_name} } - {i.type_ == 'removed_comments' && + {i.type_ == 'removed_comments' && <> - {(i.data as ModRemoveComment).removed? 'Removed' : 'Restored'} + {(i.data as ModRemoveComment).removed? 'Removed' : 'Restored'} Comment {(i.data as ModRemoveComment).comment_content} by {(i.data as ModRemoveComment).comment_user_name}
{(i.data as ModRemoveComment).reason && ` reason: ${(i.data as ModRemoveComment).reason}`}
} - {i.type_ == 'removed_communities' && + {i.type_ == 'removed_communities' && <> - {(i.data as ModRemoveCommunity).removed ? 'Removed' : 'Restored'} + {(i.data as ModRemoveCommunity).removed ? 'Removed' : 'Restored'} Community {(i.data as ModRemoveCommunity).community_name}
{(i.data as ModRemoveCommunity).reason && ` reason: ${(i.data as ModRemoveCommunity).reason}`}
{(i.data as ModRemoveCommunity).expires && ` expires: ${moment.utc((i.data as ModRemoveCommunity).expires).fromNow()}`}
} - {i.type_ == 'banned_from_community' && + {i.type_ == 'banned_from_community' && <> {(i.data as ModBanFromCommunity).banned ? 'Banned ' : 'Unbanned '} {(i.data as ModBanFromCommunity).other_user_name} @@ -135,7 +134,7 @@ export class Modlog extends Component {
{(i.data as ModBanFromCommunity).expires && ` expires: ${moment.utc((i.data as ModBanFromCommunity).expires).fromNow()}`}
} - {i.type_ == 'added_to_community' && + {i.type_ == 'added_to_community' && <> {(i.data as ModAddCommunity).removed ? 'Removed ' : 'Appointed '} {(i.data as ModAddCommunity).other_user_name} @@ -143,7 +142,7 @@ export class Modlog extends Component { {(i.data as ModAddCommunity).community_name} } - {i.type_ == 'banned' && + {i.type_ == 'banned' && <> {(i.data as ModBan).banned ? 'Banned ' : 'Unbanned '} {(i.data as ModBan).other_user_name} @@ -151,7 +150,7 @@ export class Modlog extends Component {
{(i.data as ModBan).expires && ` expires: ${moment.utc((i.data as ModBan).expires).fromNow()}`}
} - {i.type_ == 'added' && + {i.type_ == 'added' && <> {(i.data as ModAdd).removed ? 'Removed ' : 'Appointed '} {(i.data as ModAdd).other_user_name} @@ -171,8 +170,8 @@ export class Modlog extends Component { render() { return (
- {this.state.loading ? -
: + {this.state.loading ? +
:
{this.state.communityName && /c/{this.state.communityName} } @@ -200,21 +199,21 @@ export class Modlog extends Component { paginator() { return (
- {this.state.page > 1 && - + {this.state.page > 1 && + } - +
); } - nextPage(i: Modlog) { + nextPage(i: Modlog) { i.state.page++; i.setState(i.state); i.refetch(); } - prevPage(i: Modlog) { + prevPage(i: Modlog) { i.state.page--; i.setState(i.state); i.refetch(); @@ -240,6 +239,6 @@ export class Modlog extends Component { this.state.loading = false; window.scrollTo(0,0); this.setCombined(res); - } + } } }