Skip to main content

CommentObject

Interfaces

CommentObjectProps

Indexable

[p: string]: any

Properties

PropertyTypeDescription
CommentObjectReplyProps?CardPropsProps to spread to single comment object CommentObjectReply

Default
{elevation: 0}
CommentObjectSkeletonProps?CardPropsProps to spread to single comment object skeleton

Default
{elevation: 0}
CommentsObjectComponentProps?CommentsObjectPropsProps to spread to sub comments object

Default
{elevation: 0, WidgetProps: {variant: 'outlined'} as WidgetProps}
cacheStrategy?CacheStrategiesCaching strategies

Default
CacheStrategies.CACHE_FIRST
className?stringOverrides or extends the styles applied to the component.

Default
null
commentObject?SCCommentTypeComment object

Default
null
commentObjectId?numberId of the comment object

Default
null
commentReply?SCCommentTypecomment to reply
Used to initial open reply box for that comment

Default
null
commentsOrderBy?SCCommentsOrderBycomments orderBy

Default
SCCommentsOrderBy.ADDED_AT_DESC
commentsPageCount?numbercomments per page (latest_comments)

Default
null
feedObject?SCFeedObjectTypeFeed object

Default
null
feedObjectId?numberId of feed object

Default
null
feedObjectType?DISCUSSION | POST | STATUSType of feed object

Default
SCContributionType.POST
linkableCommentDateTime?booleanIf datetime is linkable or not

Default
true
onCollapsed?(comment: SCCommentType) => voidCallback on collapsed the comment

Default
null
onDelete?(comment: SCCommentType) => voidCallback on delete the comment

Default
null
onOpenReply?(comment: SCCommentType) => voidCallback on open reply box

Default
null
onRestore?(comment: SCCommentType) => voidCallback on restore the comment

Default
null
onVote?(comment: SCCommentType) => voidCallback on vote the comment or a sub-comment (latest_comments)

Default
null
truncateContent?booleanShow all summary initially (otherwise it will be truncated)

Default
false

Functions

CommentObject()

CommentObject(inProps): JSX.Element

API documentation for the Community-JS Comment Object component. Learn about the available props and the CSS API.

This component renders a comment item. Take a look at our demo component here

Import

import {CommentObject} from '@selfcommunity/react-ui';

Component Name

The name SCCommentObject can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCCommentObject-rootStyles applied to the root element.
comment.SCCommentObject-commentStyles applied to comment element.
nestedComments.SCCommentObject-nestedCommentsStyles applied to nested comments element wrapper.
avatar.SCCommentObject-avatarStyles applied to the avatar element.
author.SCCommentObject-authorStyles applied to the author section.
content.SCCommentObject-contentStyles applied to content section.
textContent.SCCommentObject-text-contentStyles applied to text content section.
vote.SCCommentObject-voteStyles applied to the votes section.
btnVotes.SCCommentObject-vote-audienceStyles applied to the votes audience section.
commentActionsMenu.SCCommentObject-comment-actions-menuStyles applied to comment action menu element.
deleted.SCCommentObject-deletedStyles applied to tdeleted element.
activityAt.SCCommentObject-activity-atStyles applied to activity at section.
reply.SCCommentObject-replyStyles applied to the reply element.
contentSubSection.SCCommentObject-content-sub-sectionStyles applied to the comment subsection

Parameters

ParameterTypeDescription
inPropsCommentObjectProps

Returns

JSX.Element

Source

packages/react-ui/src/components/CommentObject/CommentObject.tsx:232


CommentObjectSkeleton()

CommentObjectSkeleton(props): JSX.Element

API documentation for the Community-JS Comment Object Skeleton component. Learn about the available props and the CSS API.

Import

import {CommentObjectSkeleton} from '@selfcommunity/react-ui';

Component Name

The name SCCommentObject-skeleton-root can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCCommentObject-skeleton-rootStyles applied to the root element.

Parameters

ParameterType
propsany

Returns

JSX.Element

Source

packages/react-ui/src/components/CommentObject/Skeleton.tsx:41