]> Untitled Git - lemmy.git/commitdiff
User details ui fix (#1032)
authorernestwisniewski <ernestwisniewski2@gmail.com>
Tue, 28 Jul 2020 00:05:29 +0000 (02:05 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Jul 2020 00:05:29 +0000 (20:05 -0400)
* User details ui fix

* User details ui fix

ui/src/components/comment-node.tsx
ui/src/components/comment-nodes.tsx
ui/src/components/user-details.tsx

index 07afaea3b167af08fe6d645b1bbe27ab96494659..51b051617f61d36ec98ab9c69a684dcbae90088a 100644 (file)
@@ -64,6 +64,7 @@ interface CommentNodeState {
 
 interface CommentNodeProps {
   node: CommentNodeI;
+  noBorder?: boolean;
   noIndent?: boolean;
   viewOnly?: boolean;
   locked?: boolean;
@@ -136,9 +137,9 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
       >
         <div
           id={`comment-${node.comment.id}`}
-          className={`details comment-node border-top border-light py-2 ${
-            this.isCommentNew ? 'mark' : ''
-          }`}
+          className={`details comment-node py-2 ${
+            !this.props.noBorder ? 'border-top border-light' : ''
+          } ${this.isCommentNew ? 'mark' : ''}`}
           style={
             !this.props.noIndent &&
             this.props.node.comment.parent_id &&
index bd5ec20bd997b355b670f45d37f672774650e7bd..62693f7662a45a0bf04271f7f3a6c9817b69b4ff 100644 (file)
@@ -16,6 +16,7 @@ interface CommentNodesProps {
   moderators?: Array<CommunityUser>;
   admins?: Array<UserView>;
   postCreatorId?: number;
+  noBorder?: boolean;
   noIndent?: boolean;
   viewOnly?: boolean;
   locked?: boolean;
@@ -42,6 +43,7 @@ export class CommentNodes extends Component<
           <CommentNode
             key={node.comment.id}
             node={node}
+            noBorder={this.props.noBorder}
             noIndent={this.props.noIndent}
             viewOnly={this.props.viewOnly}
             locked={this.props.locked}
index c990ce189a2607014869da683ca029b014f00c6c..913cb5e90be8368fb65d545c956d5a33f182da5c 100644 (file)
@@ -146,25 +146,30 @@ export class UserDetails extends Component<UserDetailsProps, UserDetailsState> {
     return (
       <div>
         {combined.map(i => (
-          <div>
-            {i.type === 'posts' ? (
-              <PostListing
-                post={i.data as Post}
-                admins={this.props.admins}
-                showCommunity
-                enableDownvotes={this.props.enableDownvotes}
-                enableNsfw={this.props.enableNsfw}
-              />
-            ) : (
-              <CommentNodes
-                nodes={[{ comment: i.data as Comment }]}
-                admins={this.props.admins}
-                noIndent
-                showContext
-                enableDownvotes={this.props.enableDownvotes}
-              />
-            )}
-          </div>
+          <>
+            <div>
+              {i.type === 'posts' ? (
+                <PostListing
+                  post={i.data as Post}
+                  admins={this.props.admins}
+                  showCommunity
+                  enableDownvotes={this.props.enableDownvotes}
+                  enableNsfw={this.props.enableNsfw}
+                />
+              ) : (
+                <CommentNodes
+                  nodes={[{ comment: i.data as Comment }]}
+                  admins={this.props.admins}
+                  noBorder
+                  noIndent
+                  showCommunity
+                  showContext
+                  enableDownvotes={this.props.enableDownvotes}
+                />
+              )}
+            </div>
+            <hr class="my-3" />
+          </>
         ))}
       </div>
     );
@@ -177,6 +182,7 @@ export class UserDetails extends Component<UserDetailsProps, UserDetailsState> {
           nodes={commentsToFlatNodes(this.state.comments)}
           admins={this.props.admins}
           noIndent
+          showCommunity
           showContext
           enableDownvotes={this.props.enableDownvotes}
         />
@@ -188,13 +194,16 @@ export class UserDetails extends Component<UserDetailsProps, UserDetailsState> {
     return (
       <div>
         {this.state.posts.map(post => (
-          <PostListing
-            post={post}
-            admins={this.props.admins}
-            showCommunity
-            enableDownvotes={this.props.enableDownvotes}
-            enableNsfw={this.props.enableNsfw}
-          />
+          <>
+            <PostListing
+              post={post}
+              admins={this.props.admins}
+              showCommunity
+              enableDownvotes={this.props.enableDownvotes}
+              enableNsfw={this.props.enableNsfw}
+            />
+            <hr class="my-3" />
+          </>
         ))}
       </div>
     );