소스 검색

create CommentControl.tsx

jam411 3 년 전
부모
커밋
e798ba91f5
2개의 변경된 파일22개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/app/src/components/PageComment/Comment.tsx
  2. 21 0
      packages/app/src/components/PageComment/CommentControl.tsx

+ 1 - 1
packages/app/src/components/PageComment/Comment.tsx

@@ -16,7 +16,7 @@ import HistoryIcon from '../Icons/HistoryIcon';
 import RevisionRenderer from '../Page/RevisionRenderer';
 import Username from '../User/Username';
 
-import CommentControl from './CommentControl';
+import { CommentControl } from './CommentControl';
 import CommentEditor from './CommentEditor';
 
 type CommentProps = {

+ 21 - 0
packages/app/src/components/PageComment/CommentControl.tsx

@@ -0,0 +1,21 @@
+import React from 'react';
+
+type CommentControlProps = {
+  onClickEditBtn: () => void,
+  onClickDeleteBtn: () => void,
+}
+
+export const CommentControl = (props: CommentControlProps): JSX.Element => {
+  const { onClickEditBtn, onClickDeleteBtn } = props;
+
+  return (
+    <div className="page-comment-control">
+      <button type="button" className="btn btn-link p-2" onClick={onClickEditBtn}>
+        <i className="ti ti-pencil"></i>
+      </button>
+      <button type="button" className="btn btn-link p-2 mr-2" onClick={onClickDeleteBtn}>
+        <i className="ti ti-close"></i>
+      </button>
+    </div>
+  );
+};