mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
splitting comment text by blocks
This commit is contained in:
parent
d74c9ee739
commit
93afa626db
8 changed files with 206 additions and 158 deletions
20
src/components/comment/CommentTextBlock/index.tsx
Normal file
20
src/components/comment/CommentTextBlock/index.tsx
Normal file
|
@ -0,0 +1,20 @@
|
|||
import React, { FC } from 'react';
|
||||
import { ICommentBlock } from '~/constants/comment';
|
||||
import styles from './styles.scss';
|
||||
|
||||
interface IProps {
|
||||
block: ICommentBlock;
|
||||
}
|
||||
|
||||
const CommentTextBlock: FC<IProps> = ({ block }) => {
|
||||
return (
|
||||
<div
|
||||
className={styles.text}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `<p>${block.content}</p>`,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export { CommentTextBlock };
|
Loading…
Add table
Add a link
Reference in a new issue