ソースを参照

Change style comment reply

satof3 2 年 前
コミット
a2b9ff6ad7

+ 1 - 2
apps/app/src/components/PageComment.module.scss

@@ -9,8 +9,7 @@
 
 
   // reply button
   // reply button
   .btn-comment-reply {
   .btn-comment-reply {
-    margin-top: 0.5em;
-    border: none;
+
   }
   }
 
 
   // TODO: Refacotr Soft-coding
   // TODO: Refacotr Soft-coding

+ 8 - 9
apps/app/src/components/PageComment.tsx

@@ -4,7 +4,7 @@ import React, {
 } from 'react';
 } from 'react';
 
 
 import { isPopulated, getIdForRef, type IRevisionHasId } from '@growi/core';
 import { isPopulated, getIdForRef, type IRevisionHasId } from '@growi/core';
-import { Button } from 'reactstrap';
+import { UserPicture } from '@growi/ui/dist/components';
 
 
 import { apiPost } from '~/client/util/apiv1-client';
 import { apiPost } from '~/client/util/apiv1-client';
 import { toastError } from '~/client/util/toastr';
 import { toastError } from '~/client/util/toastr';
@@ -171,16 +171,15 @@ export const PageComment: FC<PageCommentProps> = memo((props: PageCommentProps):
                   <div className="d-flex flex-row-reverse">
                   <div className="d-flex flex-row-reverse">
                     <NotAvailableForGuest>
                     <NotAvailableForGuest>
                       <NotAvailableForReadOnlyUser>
                       <NotAvailableForReadOnlyUser>
-                        <Button
-                          data-testid="comment-reply-button"
-                          outline
-                          color="secondary"
-                          size="sm"
-                          className="btn-comment-reply"
+                        <button
+                          type="button"
+                          id="comment-reply-button"
+                          className="btn btn-secondary btn-comment-reply text-start w-100 ms-5"
                           onClick={() => onReplyButtonClickHandler(comment._id)}
                           onClick={() => onReplyButtonClickHandler(comment._id)}
                         >
                         >
-                          <span className="material-symbols-outlined">replay</span> Reply
-                        </Button>
+                          <UserPicture user={currentUser} noLink noTooltip additionalClassName="me-2" />
+                          <span className="material-symbols-outlined me-1 fs-5 pb-1">reply</span><small>Reply...</small>
+                        </button>
                       </NotAvailableForReadOnlyUser>
                       </NotAvailableForReadOnlyUser>
                     </NotAvailableForGuest>
                     </NotAvailableForGuest>
                   </div>
                   </div>

+ 1 - 5
apps/app/src/components/PageComment/Comment.tsx

@@ -111,10 +111,6 @@ export const Comment = (props: CommentProps): JSX.Element => {
     deleteBtnClicked(comment);
     deleteBtnClicked(comment);
   };
   };
 
 
-  const renderText = (comment: string) => {
-    return <span style={{ whiteSpace: 'pre-wrap' }}>{comment}</span>;
-  };
-
   const commentBody = useMemo(() => {
   const commentBody = useMemo(() => {
     if (rendererOptions == null) {
     if (rendererOptions == null) {
       return <></>;
       return <></>;
@@ -151,7 +147,7 @@ export const Comment = (props: CommentProps): JSX.Element => {
         />
         />
       ) : (
       ) : (
         <div id={commentId} className={rootClassName}>
         <div id={commentId} className={rootClassName}>
-          <div className="page-comment-main bg-secondary rounded">
+          <div className="page-comment-main bg-secondary rounded mb-2">
             <div className="d-flex align-items-center">
             <div className="d-flex align-items-center">
               <UserPicture user={creator} additionalClassName="me-2" />
               <UserPicture user={creator} additionalClassName="me-2" />
               <div className="small fw-bold me-3">
               <div className="small fw-bold me-3">

+ 1 - 1
apps/app/src/components/PageComment/CommentEditor.tsx

@@ -349,7 +349,7 @@ export const CommentEditor = (props: CommentEditorProps): JSX.Element => {
           </div>
           </div>
         </div>
         </div>
 
 
-        <div className="comment-submit px-3 pb-3">
+        <div className="comment-submit px-3 pb-3 mb-2">
           <div className="d-flex">
           <div className="d-flex">
             <span className="flex-grow-1" />
             <span className="flex-grow-1" />
             <span className="d-none d-sm-inline">{errorMessage && errorMessage}</span>
             <span className="d-none d-sm-inline">{errorMessage && errorMessage}</span>

+ 1 - 1
apps/app/src/components/PageComment/ReplyComments.tsx

@@ -40,7 +40,7 @@ export const ReplyComments = (props: ReplycommentsProps): JSX.Element => {
 
 
   const renderReply = (reply: ICommentHasId) => {
   const renderReply = (reply: ICommentHasId) => {
     return (
     return (
-      <div key={reply._id} className={`${styles['page-comment-reply']} ms-4 ms-sm-5 me-3`}>
+      <div key={reply._id} className={`${styles['page-comment-reply']} mt-2 ms-4 ms-sm-5`}>
         <Comment
         <Comment
           rendererOptions={rendererOptions}
           rendererOptions={rendererOptions}
           comment={reply}
           comment={reply}