Skip to main content

CommentObject

Interfaces

CommentObjectProps

Indexable

[p: string]: any

Other props

Properties

PropertyTypeDescription
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
CommentObjectReplyProps?CardPropsProps to spread to single comment object CommentObjectReply Default {elevation: 0}
CommentObjectSkeletonProps?CardPropsProps to spread to single comment object skeleton Default {elevation: 0}
commentReply?SCCommentTypecomment to reply Used to initial open reply box for that comment Default null
CommentsObjectComponentProps?CommentsObjectPropsProps to spread to sub comments object Default {elevation: 0, WidgetProps: {variant: 'outlined'} as WidgetProps}
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) => voidCallback on collapsed the comment Default null
onDelete?(comment) => voidCallback on delete the comment Default null
onOpenReply?(comment) => voidCallback on open reply box Default null
onRestore?(comment) => voidCallback on restore the comment Default null
onVote?(comment) => voidCallback on vote the comment or a sub-comment (latest_comments) Default null
showActions?booleanProp to show comment actions section (below text) Default true
truncateContent?booleanShow all summary initially (otherwise it will be truncated) Default false

Functions

CommentObject()

CommentObject(inProps): 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

Element


CommentObjectSkeleton()

CommentObjectSkeleton(props): 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

Element