From 2f9a052f89fe8d34fedcd2219e644dd51cda5505 Mon Sep 17 00:00:00 2001
From: Richard <richard@tripaneer.com>
Date: Fri, 31 Jan 2020 21:52:27 +0100
Subject: usability features

This are all the commits from another PR combined into a single commit.
---
 ui/src/components/community.tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'ui/src/components/community.tsx')

diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx
index 3c5f6890..30756344 100644
--- a/ui/src/components/community.tsx
+++ b/ui/src/components/community.tsx
@@ -128,11 +128,11 @@ export class Community extends Component<any, State> {
     return (
       <div class="container">
         {this.state.loading ? (
-          <h5>
+          <p class="text-center">
             <svg class="icon icon-spinner spin">
               <use xlinkHref="#icon-spinner"></use>
             </svg>
-          </h5>
+          </p>
         ) : (
           <div class="row">
             <div class="col-12 col-md-8">
@@ -140,12 +140,12 @@ export class Community extends Component<any, State> {
                 {this.state.community.title}
                 {this.state.community.removed && (
                   <small className="ml-2 text-muted font-italic">
-                    <T i18nKey="removed">#</T>
+                    { i18n.t('removed') }
                   </small>
                 )}
                 {this.state.community.nsfw && (
                   <small className="ml-2 text-muted font-italic">
-                    <T i18nKey="nsfw">#</T>
+                    { i18n.t('nsfw') }
                   </small>
                 )}
               </h5>
@@ -192,7 +192,7 @@ export class Community extends Component<any, State> {
             class="btn btn-sm btn-secondary mr-1"
             onClick={linkEvent(this, this.prevPage)}
           >
-            <T i18nKey="prev">#</T>
+            { i18n.t('prev') }
           </button>
         )}
         {this.state.posts.length == fetchLimit && (
@@ -200,7 +200,7 @@ export class Community extends Component<any, State> {
             class="btn btn-sm btn-secondary"
             onClick={linkEvent(this, this.nextPage)}
           >
-            <T i18nKey="next">#</T>
+            { i18n.t('next') }
           </button>
         )}
       </div>
-- 
cgit v1.2.3


From ac943f8951fe7da86aaa9f41ee879ab670786c86 Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Sun, 2 Feb 2020 13:50:44 -0500
Subject: Finishing up interpolation rework.

---
 ui/src/components/community.tsx | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

(limited to 'ui/src/components/community.tsx')

diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx
index 30756344..da456fe5 100644
--- a/ui/src/components/community.tsx
+++ b/ui/src/components/community.tsx
@@ -14,7 +14,7 @@ import {
   GetCommunityForm,
   ListingType,
   GetPostsResponse,
-  CreatePostLikeResponse,
+  PostResponse,
   WebSocketJsonResponse,
 } from '../interfaces';
 import { WebSocketService, UserService } from '../services';
@@ -28,7 +28,6 @@ import {
   postRefetchSeconds,
   toast,
 } from '../utils';
-import { T } from 'inferno-i18next';
 import { i18n } from '../i18next';
 
 interface State {
@@ -128,11 +127,11 @@ export class Community extends Component<any, State> {
     return (
       <div class="container">
         {this.state.loading ? (
-          <p class="text-center">
+          <h5>
             <svg class="icon icon-spinner spin">
               <use xlinkHref="#icon-spinner"></use>
             </svg>
-          </p>
+          </h5>
         ) : (
           <div class="row">
             <div class="col-12 col-md-8">
@@ -140,12 +139,12 @@ export class Community extends Component<any, State> {
                 {this.state.community.title}
                 {this.state.community.removed && (
                   <small className="ml-2 text-muted font-italic">
-                    { i18n.t('removed') }
+                    {i18n.t('removed')}
                   </small>
                 )}
                 {this.state.community.nsfw && (
                   <small className="ml-2 text-muted font-italic">
-                    { i18n.t('nsfw') }
+                    {i18n.t('nsfw')}
                   </small>
                 )}
               </h5>
@@ -192,7 +191,7 @@ export class Community extends Component<any, State> {
             class="btn btn-sm btn-secondary mr-1"
             onClick={linkEvent(this, this.prevPage)}
           >
-            { i18n.t('prev') }
+            {i18n.t('prev')}
           </button>
         )}
         {this.state.posts.length == fetchLimit && (
@@ -200,7 +199,7 @@ export class Community extends Component<any, State> {
             class="btn btn-sm btn-secondary"
             onClick={linkEvent(this, this.nextPage)}
           >
-            { i18n.t('next') }
+            {i18n.t('next')}
           </button>
         )}
       </div>
@@ -287,7 +286,7 @@ export class Community extends Component<any, State> {
       this.state.loading = false;
       this.setState(this.state);
     } else if (res.op == UserOperation.CreatePostLike) {
-      let data = res.data as CreatePostLikeResponse;
+      let data = res.data as PostResponse;
       let found = this.state.posts.find(c => c.id == data.post.id);
       found.my_vote = data.post.my_vote;
       found.score = data.post.score;
-- 
cgit v1.2.3

