Skip to content

Display rich Comment view with Header, Content and Show More Text

Latest

Choose a tag to compare

@KeitelDOG KeitelDOG released this 20 Dec 22:20
· 2 commits to main since this release
121c857

Retrieving content from CommentInput is one thing, parsing it to display it in a Comment view is another. To avoid complication, a set of Components is provided and now CommentInput and CoreInput can provide content in array of objects.

Input ContentParts:
Prop contentType can be 'string' | 'parts'.

  • string like 'Hello {{1}}'
  • parts like { type: 'text', data: 'Hello ', type: 'mention', data: { id: 1, name: 'KeitelDOG', image: 'image-url' }}

Comment:
New components:

  • Comment complete, using CommentHeader, ShowMoreText wrapping CommentContent
  • CommentHeader
  • CommentContent
  • ShowMoreText to wrap CommentContent if needed. It uses -webkit-line-clamp and -webkit-box display with height calculation.