]> Untitled Git - lemmy.git/commitdiff
Refactoring chat sidebar. #237
authorDessalines <tyhou13@gmx.com>
Sun, 25 Aug 2019 17:42:10 +0000 (10:42 -0700)
committerDessalines <tyhou13@gmx.com>
Sun, 25 Aug 2019 17:42:10 +0000 (10:42 -0700)
ui/src/components/post.tsx
ui/src/translations/en.ts

index a6df4105edc7db7bdbb5c053d94288a52da692bf..91f8f4db76b73e90916f9ebefeb5f739e0385610 100644 (file)
@@ -119,7 +119,7 @@ export class Post extends Component<any, PostState> {
         {this.state.loading ? 
         <h5><svg class="icon icon-spinner spin"><use xlinkHref="#icon-spinner"></use></svg></h5> : 
         <div class="row">
-            <div class="col-12 col-md-8 col-lg-6 mb-3">
+            <div class="col-12 col-md-8 mb-3">
               <PostListing 
                 post={this.state.post} 
                 showBody 
@@ -139,11 +139,9 @@ export class Post extends Component<any, PostState> {
               {this.sortRadios()}
               {this.commentsTree()}
             </div>
-            <div class="col-12 col-md-4 col-lg-3 mb-3 d-none d-md-block px-0">
-              {this.state.comments.length > 0 && this.newComments()}
-            </div>
-            <div class="col-12 col-sm-12 col-lg-3">
+            <div class="col-12 col-sm-12 col-md-4">
               {this.sidebar()}
+              {this.state.comments.length > 0 && this.newComments()}
             </div>
           </div>
         }
@@ -175,25 +173,26 @@ export class Post extends Component<any, PostState> {
 
   newComments() {
     return (
-      <div class="container-fluid sticky-top new-comments">
-        <h5><T i18nKey="chat">#</T></h5>
-        <CommentForm postId={this.state.post.id} disabled={this.state.post.locked} />
-        {this.state.comments.map(comment => 
-          <CommentNodes 
-            nodes={[{comment: comment}]} 
-            noIndent 
-            locked={this.state.post.locked} 
-            moderators={this.state.moderators} 
-            admins={this.state.admins}
-          />
-        )}
+      <div class="d-none d-md-block sticky-top new-comments card border-secondary">
+        <div class="card-body small">
+          <h6><T i18nKey="recent_comments">#</T></h6>
+          {this.state.comments.map(comment => 
+            <CommentNodes 
+              nodes={[{comment: comment}]} 
+              noIndent 
+              locked={this.state.post.locked} 
+              moderators={this.state.moderators} 
+              admins={this.state.admins}
+            />
+          )}
+        </div>
       </div>
     )
   }
 
   sidebar() {
     return ( 
-      <div class="">
+      <div class="mb-3">
         <Sidebar 
           community={this.state.community} 
           moderators={this.state.moderators} 
index c854ea7be85dbc9793f2e36c6042c22364bf874e..79249214113703913a6e0c9119ae89f0909b4f72 100644 (file)
@@ -109,6 +109,7 @@ export const en = {
     expand_here: 'Expand here',
     subscribe_to_communities: 'Subscribe to some <1>communities</1>.',
     chat: 'Chat',
+    recent_comments: 'Recent Comments',
     no_results: 'No results.',
     setup: 'Setup',
     lemmy_instance_setup: 'Lemmy Instance Setup',