UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

95 lines (85 loc) 2.76 kB
import { CardProps } from '@mui/material'; import { SCCourseCommentType, SCCourseLessonType } from '@selfcommunity/types'; import { CacheStrategies } from '@selfcommunity/utils'; export interface LessonCommentObjectProps { /** * Overrides or extends the styles applied to the component. * @default null */ className?: string; /** * Id of the comment object * @default null */ commentObjectId?: number; /** * Comment object * @default null */ commentObject?: SCCourseCommentType; /** * Id of lesson object * @default null */ lessonObjectId?: number; /** * Feed object * @default null */ lessonObject?: SCCourseLessonType; /** * Callback on delete the comment * @default null */ onDelete?: (comment: SCCourseCommentType) => void; /** * Callback on comment edit * @default false */ isEditing?: (editing: boolean) => void; /** * Props to spread to single comment object skeleton * @default {elevation: 0} */ CommentObjectSkeletonProps?: CardProps; /** * Props to spread to single comment object CommentObjectReply * @default {elevation: 0} */ CommentObjectReplyProps?: CardProps; /** * Caching strategies * @default CacheStrategies.CACHE_FIRST */ cacheStrategy?: CacheStrategies; /** * Other props */ [p: string]: any; } /** * > 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 <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/CommentObject) #### Import ```jsx 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.| |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.| |mediaContent|.SCCommentObject-media-content|Styles applied to media content section.| |commentActionsMenu|.SCCommentObject-comment-actions-menu|Styles applied to comment action menu element.| * @param inProps */ export default function LessonCommentObject(inProps: LessonCommentObjectProps): JSX.Element;