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 };
|
14
src/components/comment/CommentTextBlock/styles.scss
Normal file
14
src/components/comment/CommentTextBlock/styles.scss
Normal file
|
@ -0,0 +1,14 @@
|
|||
.text {
|
||||
padding: $gap;
|
||||
font-weight: 300;
|
||||
font: $font_16_medium;
|
||||
line-height: 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
color: #cccccc;
|
||||
word-break: break-word;
|
||||
|
||||
b {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue