1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

comment locking initial

This commit is contained in:
Fedor Katurov 2019-11-29 12:21:11 +07:00
parent 6eafc227da
commit 59d544c5f4
10 changed files with 139 additions and 44 deletions

View file

@ -1,7 +1,6 @@
import React, { FC, HTMLAttributes, memo } from 'react';
import { CommentWrapper } from '~/components/containers/CommentWrapper';
import { ICommentGroup } from '~/redux/types';
import { getURL } from '~/utils/dom';
import { ICommentGroup, IComment } from '~/redux/types';
import { CommentContent } from '~/components/node/CommentContent';
import * as styles from './styles.scss';
@ -10,10 +9,12 @@ type IProps = HTMLAttributes<HTMLDivElement> & {
is_loading?: boolean;
comment_group?: ICommentGroup;
is_same?: boolean;
can_edit?: boolean;
onDelete: (id: IComment['id'], is_deteted: boolean) => void;
};
const Comment: FC<IProps> = memo(
({ comment_group, is_empty, is_same, is_loading, className, ...props }) => {
({ comment_group, is_empty, is_same, is_loading, className, can_edit, onDelete, ...props }) => {
return (
<CommentWrapper
className={className}
@ -25,7 +26,12 @@ const Comment: FC<IProps> = memo(
>
<div className={styles.wrap}>
{comment_group.comments.map(comment => (
<CommentContent comment={comment} key={comment.id} />
<CommentContent
comment={comment}
key={comment.id}
can_edit={can_edit}
onDelete={onDelete}
/>
))}
</div>
</CommentWrapper>