Skip to main content

CommentsFeedObject

Interfaces

CommentsFeedObjectProps

Indexable

[p: string]: any

Properties

PropertyTypeDescription
CommentComponent?(inProps: CommentObjectProps) => ElementCommentComponent component
Useful to override the single Comment render component

Default
CommentObject
CommentComponentProps?CommentObjectPropsProps to spread to CommentObject component

Default
{variant: 'outlined}
CommentObjectSkeletonProps?anyProps to spread to CommentObject component

Default
{elevation: 0, variant: 'outlined'}
cacheStrategy?CacheStrategiesCaching strategies
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
comments?SCCommentType[]additional comments to show in the header/footer
useful when from a feedObject publish a comment

Default
[]
commentsOrderBy?SCCommentsOrderBycomments orderBy

Default
SCCommentsOrderBy.ADDED_AT_DESC
commentsPageCount?numbercomments per page

Default
null
feedObject?SCFeedObjectTypeFeed object

Default
null
feedObjectId?numberId of feed object

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

Default
SCContributionType.POST
id?stringId of the CommentsObject

Default
comments_object_<feedObjectType>_<feedObjectId | feedObject.id>
infiniteScrolling?booleanenable/disable infinite scrolling

Default
true
onChangePage?(page: any) => anyCallback invoked when load comments page
Usefull to sync location path for SEO optimization
page?numberpage

Default
1
renderCommentNotFound?() => ElementrenderCommentNotFound function
invoked when comment not found

Default
null
renderNoComments?() => ElementrenderNoComment function
invoked when no comments founds

Default
null
showTitle?booleanshow title (number of comments)

Functions

CommentsFeedObject()

CommentsFeedObject(inProps): JSX.Element

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

This component renders a list of comment items. Take a look at our demo component here

Import

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

Component Name

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

CSS

Rule NameGlobal classDescription
root.SCCommentsFeedObject-rootStyles applied to the root element.
noComments.SCCommentsFeedObject-no-commentsStyles applied to the 'no comments' section.
commentNotFound.SCCommentsFeedObject-comment-not-foundStyles applied to the label 'Comment not found'.

Parameters

ParameterTypeDescription
inPropsCommentsFeedObjectProps

Returns

JSX.Element

Source

packages/react-ui/src/components/CommentsFeedObject/CommentsFeedObject.tsx:189


CommentsFeedObjectSkeleton()

CommentsFeedObjectSkeleton(props): JSX.Element

Parameters

ParameterType
propsany

Returns

JSX.Element

Source

packages/react-ui/src/components/CommentsFeedObject/Skeleton.tsx:15