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

fixed comment attachments click

This commit is contained in:
Fedor Katurov 2022-12-14 09:39:12 +06:00
parent 6957813cd0
commit dd8b4e9dcf
2 changed files with 10 additions and 6 deletions

View file

@ -69,6 +69,12 @@ const CommentContent: FC<IProps> = memo(
onDelete(comment.id, !comment.deleted_at);
}, [comment, onDelete]);
const onImageClick = useCallback(
(file: IFile) =>
onShowImageModal(groupped.image, groupped.image.indexOf(file)),
[onShowImageModal, groupped],
);
const menu = useMemo(
() => (
<div>
@ -130,7 +136,7 @@ const CommentContent: FC<IProps> = memo(
<div className={classnames(styles.block, styles.block_image)}>
{menu}
<CommentImageGrid files={groupped.image} />
<CommentImageGrid files={groupped.image} onClick={onImageClick} />
<div className={styles.date}>
{getPrettyDate(comment.created_at)}