yusuketk 5 anni fa
parent
commit
f168286b24

+ 2 - 9
src/client/js/components/PageComment/Comment.jsx

@@ -16,6 +16,7 @@ import UserPicture from '../User/UserPicture';
 import Username from '../User/Username';
 import Username from '../User/Username';
 import CommentEditor from './CommentEditor';
 import CommentEditor from './CommentEditor';
 import CommentControl from './CommentControl';
 import CommentControl from './CommentControl';
+import RecentChangesIcon from '../Icons/RecentChangesIcon';
 
 
 /**
 /**
  *
  *
@@ -38,7 +39,6 @@ class Comment extends React.PureComponent {
     this.isCurrentUserIsAuthor = this.isCurrentUserEqualsToAuthor.bind(this);
     this.isCurrentUserIsAuthor = this.isCurrentUserEqualsToAuthor.bind(this);
     this.isCurrentRevision = this.isCurrentRevision.bind(this);
     this.isCurrentRevision = this.isCurrentRevision.bind(this);
     this.getRootClassName = this.getRootClassName.bind(this);
     this.getRootClassName = this.getRootClassName.bind(this);
-    this.getRevisionLabelClassName = this.getRevisionLabelClassName.bind(this);
     this.deleteBtnClickedHandler = this.deleteBtnClickedHandler.bind(this);
     this.deleteBtnClickedHandler = this.deleteBtnClickedHandler.bind(this);
     this.renderText = this.renderText.bind(this);
     this.renderText = this.renderText.bind(this);
     this.renderHtml = this.renderHtml.bind(this);
     this.renderHtml = this.renderHtml.bind(this);
@@ -109,11 +109,6 @@ class Comment extends React.PureComponent {
     return className;
     return className;
   }
   }
 
 
-  getRevisionLabelClassName() {
-    return `page-comment-revision badge ${
-      this.isCurrentRevision() ? 'badge-primary' : 'badge-secondary'}`;
-  }
-
   deleteBtnClickedHandler() {
   deleteBtnClickedHandler() {
     this.props.deleteBtnClicked(this.props.comment);
     this.props.deleteBtnClicked(this.props.comment);
   }
   }
@@ -166,8 +161,6 @@ class Comment extends React.PureComponent {
     const rootClassName = this.getRootClassName(comment);
     const rootClassName = this.getRootClassName(comment);
     const commentBody = isMarkdown ? this.renderRevisionBody() : this.renderText(comment.comment);
     const commentBody = isMarkdown ? this.renderRevisionBody() : this.renderText(comment.comment);
     const revHref = `?revision=${comment.revision}`;
     const revHref = `?revision=${comment.revision}`;
-    const revFirst8Letters = comment.revision.substr(-8);
-    const revisionLavelClassName = this.getRevisionLabelClassName();
 
 
     const editedDateId = `editedDate-${comment._id}`;
     const editedDateId = `editedDate-${comment._id}`;
     const editedDateFormatted = isEdited
     const editedDateFormatted = isEdited
@@ -207,7 +200,7 @@ class Comment extends React.PureComponent {
                     <UncontrolledTooltip placement="bottom" fade={false} target={editedDateId}>{editedDateFormatted}</UncontrolledTooltip>
                     <UncontrolledTooltip placement="bottom" fade={false} target={editedDateId}>{editedDateFormatted}</UncontrolledTooltip>
                   </>
                   </>
                 ) }
                 ) }
-                <span className="ml-2"><a className={revisionLavelClassName} href={revHref}>{revFirst8Letters}</a></span>
+                <span className="ml-2"><a className="page-comment-revision" href={revHref}><RecentChangesIcon /></a></span>
               </div>
               </div>
               { this.checkPermissionToControlComment() && (
               { this.checkPermissionToControlComment() && (
                 <CommentControl
                 <CommentControl

+ 5 - 0
src/client/styles/scss/_comment.scss

@@ -40,6 +40,11 @@
       font-size: 0.9em;
       font-size: 0.9em;
       color: $gray-400;
       color: $gray-400;
     }
     }
+
+    .page-comment-revision svg {
+      width: 16px;
+      height: 16px;
+    }
   }
   }
 
 
   .page-comment-main {
   .page-comment-main {