mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed comment block separation
This commit is contained in:
parent
5dbf4245bf
commit
1fc04e62a6
3 changed files with 16 additions and 8 deletions
|
@ -49,6 +49,14 @@ const CommentContent: FC<IProps> = memo(
|
|||
[can_edit, comment, onEditClick, onLockClick]
|
||||
);
|
||||
|
||||
const blocks = useMemo(
|
||||
() =>
|
||||
!!comment.text.trim()
|
||||
? formatCommentText(path(['user', 'username'], comment), comment.text)
|
||||
: [],
|
||||
[comment]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
{comment.text && (
|
||||
|
@ -56,7 +64,7 @@ const CommentContent: FC<IProps> = memo(
|
|||
{menu}
|
||||
|
||||
<Group className={styles.renderers}>
|
||||
{formatCommentText(path(['user', 'username'], comment), comment.text).map(
|
||||
{blocks.map(
|
||||
(block, key) =>
|
||||
COMMENT_BLOCK_RENDERERS[block.type] &&
|
||||
createElement(COMMENT_BLOCK_RENDERERS[block.type], { block, key })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue