Feed - posts #227
@ -1,13 +1,26 @@
|
|||||||
import { useTextLimit } from 'hooks/useTextLimit'
|
import { NoteRender } from 'components/Notes/NoteRender'
|
||||||
|
import { useTextLimit } from 'hooks'
|
||||||
|
|
||||||
interface CommentContentProps {
|
interface CommentContentProps {
|
||||||
content: string
|
content: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CommentContent = ({ content }: CommentContentProps) => {
|
export const CommentContent = ({ content }: CommentContentProps) => {
|
||||||
const { text, isTextOverflowing, isExpanded, toggle } = useTextLimit(content)
|
const { text, isTextOverflowing, isExpanded, toggle } = useTextLimit(content)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p className='IBMSMSMBSSCL_CBText'>{text}</p>
|
{isExpanded && (
|
||||||
|
<div
|
||||||
|
className='IBMSMSMBSSCL_CBExpand IBMSMSMBSSCL_CBExpandAlt'
|
||||||
|
onClick={toggle}
|
||||||
|
>
|
||||||
|
<p>Hide full post</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<p className='IBMSMSMBSSCL_CBText'>
|
||||||
|
<NoteRender content={text} />
|
||||||
|
</p>
|
||||||
{isTextOverflowing && (
|
{isTextOverflowing && (
|
||||||
<div className='IBMSMSMBSSCL_CBExpand' onClick={toggle}>
|
<div className='IBMSMSMBSSCL_CBExpand' onClick={toggle}>
|
||||||
<p>{isExpanded ? 'Hide' : 'View'} full post</p>
|
<p>{isExpanded ? 'Hide' : 'View'} full post</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user