CommentsObject
Interfaces
CommentsObjectProps
Indexable
[p
: string
]: any
Properties
Property | Type | Description |
---|---|---|
CommentComponent? | (inProps : CommentObjectProps ) => Element | CommentComponent component Usefull to override the single Comment render component Default CommentObject |
CommentComponentProps? | CommentObjectProps | Props to spread to single comment object Default {variant: 'outlined'} |
CommentObjectSkeletonProps? | any | Props to spread to single comment object skeleton Default {elevation: 0, WidgetProps: {variant: 'outlined'}}, |
CommentsObjectSkeletonProps? | any | Props to spread to CommentsObjectSkeleton Default {} |
PaginationLinkProps? | Record <string , any > | Props to spread to the pagination Link component Default {} |
cacheStrategy? | CacheStrategies | Caching strategies Default CacheStrategies.CACHE_FIRST |
className? | string | Overrides or extends the styles applied to the component. Default null |
comments? | SCCommentType [] | Comments to show |
disablePaginationLinks? | boolean | Add/remove pagination links on top/bottom of items Default false |
endComments? | SCCommentType [] | Add/show other comments at the end of the component Useful when there is a new comment (reply feed object) |
feedObject? | SCFeedObjectType | Feed object Default null |
feedObjectId? | number | Id of feed object Default null |
feedObjectType? | DISCUSSION | POST | STATUS | Type of feed object Default SCContributionType.POST |
handleNext? | () => void | Handle load next comments callback |
handlePrevious? | () => void | Handle load previous comments callback |
hidePaginationLinks? | boolean | Show/hide pagination links Default true |
id? | string | Id of the CommentsObject Default comments_object_<feedObjectType>_<feedObjectId | feedObject.id> |
inPlaceLoadMoreContents? | boolean | Load more contents in place rather than opening a new page |
infiniteScrolling? | boolean | Enable/disable infinite scrolling If there is comments in startCommments/endComments infiniteScrolling will be disabled Default true |
isLoadingNext? | boolean | Is loading next comments If exist load next button is replaced by comment skeleton |
isLoadingPrevious? | boolean | Is loading previous comments If exist load previous button is replaced by comment skeleton |
next? | string | Next url If exist show load next button |
nextPage? | number | Next page |
page? | number | Current page |
paginationLinksPageQueryParam? | string | Page query parameter name Default 'page' |
previous? | string | Previous url If exist show load previous button |
previousPage? | number | Previous page |
startComments? | SCCommentType [] | Add/show other comments at the head of the component Useful when there is a new comment (reply feed object) |
totalComments? | number | Total number of comments |
totalLoadedComments? | number | Number of comments loaded |
Functions
CommentsObject()
CommentsObject(
inProps
):JSX.Element
API documentation for the Community-JS Comments Object component. Learn about the available props and the CSS API.
Import
import {CommentsObject} from '@selfcommunity/react-ui';
Component Name
The name SCCommentsObject
can be used when providing style overrides in the theme.
CSS
Rule Name | Global class | Description |
---|---|---|
root | .SCCommentsObject-root | Styles applied to the root element. |
pagination | .SCCommentsObject-pagination | Styles applied to the pagination controls. |
paginationLink | .SCCommentsObject-pagination-link | Styles applied to the pagination link. |
loadNextCommentsButton | .SCCommentsObject-load-next-comments-button | Styles applied to the load next comments button. |
loadPreviousCommentsButton | .SCCommentsObject-load-previous-comments-button | Styles applied to the load previous comments button. |
commentsCounter | .SCCommentsObject-comments-counter | Styles applied to the comments counter element. |
Parameters
Parameter | Type | Description |
---|---|---|
inProps | CommentsObjectProps |
Returns
JSX.Element
Source
packages/react-ui/src/components/CommentsObject/CommentsObject.tsx:254
CommentsObjectSkeleton()
CommentsObjectSkeleton(
props
):JSX.Element
API documentation for the Community-JS Comments Object Skeleton component. Learn about the available props and the CSS API.
Import
import {CommentsObjectSkeleton} from '@selfcommunity/react-ui';
Component Name
The name SCCommentsObject-skeleton-root
can be used when providing style overrides in the theme.
CSS
Rule Name | Global class | Description |
---|---|---|
root | .SCCommentsObject-skeleton-root | Styles applied to the root element. |
Parameters
Parameter | Type |
---|---|
props | object |
props.CommentObjectSkeletonProps ? | any |
props.count ? | number |
Returns
JSX.Element
Source
packages/react-ui/src/components/CommentsObject/Skeleton.tsx:36