Browse Source

create CommentControl.tsx

jam411 3 năm trước cách đây
mục cha
commit
e798ba91f5

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

@@ -16,7 +16,7 @@ import HistoryIcon from '../Icons/HistoryIcon';
 import RevisionRenderer from '../Page/RevisionRenderer';
 import RevisionRenderer from '../Page/RevisionRenderer';
 import Username from '../User/Username';
 import Username from '../User/Username';
 
 
-import CommentControl from './CommentControl';
+import { CommentControl } from './CommentControl';
 import CommentEditor from './CommentEditor';
 import CommentEditor from './CommentEditor';
 
 
 type CommentProps = {
 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>
+  );
+};