Przeglądaj źródła

add NotAvailableForGuest to comment reply

Yuken Tezuka 3 lat temu
rodzic
commit
050d8911fe
1 zmienionych plików z 16 dodań i 13 usunięć
  1. 16 13
      packages/app/src/components/PageComment.tsx

+ 16 - 13
packages/app/src/components/PageComment.tsx

@@ -13,6 +13,7 @@ import { useCommentForCurrentPageOptions } from '~/stores/renderer';
 import { ICommentHasId, ICommentHasIdList } from '../interfaces/comment';
 import { useSWRxPageComment } from '../stores/comment';
 
+import { NotAvailableForGuest } from './NotAvailableForGuest';
 import { Comment } from './PageComment/Comment';
 import { CommentEditor } from './PageComment/CommentEditor';
 import { DeleteCommentModal } from './PageComment/DeleteCommentModal';
@@ -173,19 +174,21 @@ export const PageComment: FC<PageCommentProps> = memo((props:PageCommentProps):
                   {commentElement(comment)}
                   {hasReply && replyCommentsElement(allReplies[comment._id])}
                   {(!isReadOnly && !showEditorIds.has(comment._id)) && (
-                    <div className="text-right">
-                      <Button
-                        outline
-                        color="secondary"
-                        size="sm"
-                        className="btn-comment-reply"
-                        onClick={() => {
-                          setShowEditorIds(previousState => new Set(previousState.add(comment._id)));
-                        }}
-                      >
-                        <i className="icon-fw icon-action-undo"></i> Reply
-                      </Button>
-                    </div>
+                    <NotAvailableForGuest>
+                      <div className="text-right">
+                        <Button
+                          outline
+                          color="secondary"
+                          size="sm"
+                          className="btn-comment-reply"
+                          onClick={() => {
+                            setShowEditorIds(previousState => new Set(previousState.add(comment._id)));
+                          }}
+                        >
+                          <i className="icon-fw icon-action-undo"></i> Reply
+                        </Button>
+                      </div>
+                    </NotAvailableForGuest>
                   )}
                   {(!isReadOnly && showEditorIds.has(comment._id)) && (
                     <CommentEditor