CommentObject
Interfaces
CommentObjectProps
Indexable
[p
: string
]: any
Properties
Property | Type | Description |
---|---|---|
CommentObjectReplyProps? | CardProps | Props to spread to single comment object CommentObjectReply Default {elevation: 0} |
CommentObjectSkeletonProps? | CardProps | Props to spread to single comment object skeleton Default {elevation: 0} |
CommentsObjectComponentProps? | CommentsObjectProps | Props to spread to sub comments object Default {elevation: 0, WidgetProps: {variant: 'outlined'} as WidgetProps} |
cacheStrategy? | CacheStrategies | Caching strategies Default CacheStrategies.CACHE_FIRST |
className? | string | Overrides or extends the styles applied to the component. Default null |
commentObject? | SCCommentType | Comment object Default null |
commentObjectId? | number | Id of the comment object Default null |
commentReply? | SCCommentType | comment to reply Used to initial open reply box for that comment Default null |
commentsOrderBy? | SCCommentsOrderBy | comments orderBy Default SCCommentsOrderBy.ADDED_AT_DESC |
commentsPageCount? | number | comments per page (latest_comments) Default null |
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 |
linkableCommentDateTime? | boolean | If datetime is linkable or not Default true |
onCollapsed? | (comment : SCCommentType ) => void | Callback on collapsed the comment Default null |
onDelete? | (comment : SCCommentType ) => void | Callback on delete the comment Default null |
onOpenReply? | (comment : SCCommentType ) => void | Callback on open reply box Default null |
onRestore? | (comment : SCCommentType ) => void | Callback on restore the comment Default null |
onVote? | (comment : SCCommentType ) => void | Callback on vote the comment or a sub-comment (latest_comments) Default null |
truncateContent? | boolean | Show 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 Name | Global class | Description |
---|---|---|
root | .SCCommentObject-root | Styles applied to the root element. |
comment | .SCCommentObject-comment | Styles applied to comment element. |
nestedComments | .SCCommentObject-nestedComments | Styles applied to nested comments element wrapper. |
avatar | .SCCommentObject-avatar | Styles applied to the avatar element. |
author | .SCCommentObject-author | Styles applied to the author section. |
content | .SCCommentObject-content | Styles applied to content section. |
textContent | .SCCommentObject-text-content | Styles applied to text content section. |
vote | .SCCommentObject-vote | Styles applied to the votes section. |
btnVotes | .SCCommentObject-vote-audience | Styles applied to the votes audience section. |
commentActionsMenu | .SCCommentObject-comment-actions-menu | Styles applied to comment action menu element. |
deleted | .SCCommentObject-deleted | Styles applied to tdeleted element. |
activityAt | .SCCommentObject-activity-at | Styles applied to activity at section. |
reply | .SCCommentObject-reply | Styles applied to the reply element. |
contentSubSection | .SCCommentObject-content-sub-section | Styles applied to the comment subsection |
Parameters
Parameter | Type | Description |
---|---|---|
inProps | CommentObjectProps |
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 Name | Global class | Description |
---|---|---|
root | .SCCommentObject-skeleton-root | Styles applied to the root element. |
Parameters
Parameter | Type |
---|---|
props | any |
Returns
JSX.Element
Source
packages/react-ui/src/components/CommentObject/Skeleton.tsx:41