Skip to main content

FeedObject

Interfaces

FeedObjectProps

Extends

  • CardProps.VirtualScrollerItemProps

Indexable

[p: string]: any

Properties

PropertyTypeDescriptionOverridesInherited from
ActionsProps?ActionsPropsProps to spread to Actions component

Default
{}
--
ActivitiesProps?ActivitiesPropsProps to spread to Activities component

Default
{}
--
CommentComponentProps?CommentObjectPropsProps to spread to CommentObject component

Default
{variant: 'outlined}
--
CommentObjectReplyComponent?(inProps: CommentObjectReplyProps) => ElementCommentObjectReplyComponent component
Usefull to override the single CommentObjectReply render component

Default
CommentObject
--
CommentObjectReplyComponentProps?CommentObjectReplyPropsProps to spread to single reply comment object

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

Default
{elevation: 0, variant: 'outlined'}
--
ContributionActionsMenuProps?ContributionActionsMenuPropsProps to spread to ContributionActionsMenu component

Default
{}
--
ContributorsFeedObjectProps?ContributorsFeedObjectPropsProps to spread to ContributorsFeedObject component

Default
{elevation: 0}
--
FeedObjectMediaPreviewProps?FeedObjectMediaPreviewPropsProps to spread to MediasPreview component

Default
{}
--
FeedObjectSkeletonProps?FeedObjectSkeletonPropsProps to spread to ContributionActionsMenu component

Default
{elevation: 0}
--
FollowButtonProps?FollowPropsProps to spread to Follow button component

Default
{}
--
PollObjectProps?PollObjectPropsProps to spread to PollObject component

Default
{}
--
activitiesExpanded?booleanShow activities as default

Default
false
--
activitiesExpandedType?SCFeedObjectActivitiesTypeActivities type shown initially. If not set, they are shown in order:
RELEVANCE_ACTIVITIES, RECENT_COMMENTS
If the obj has no comments/activites, or activitiesExpanded == false
nothing will be shown
--
cacheStrategy?CacheStrategiesCaching strategies

Default
CacheStrategies.CACHE_FIRST
--
className?stringOverrides or extends the styles applied to the component.

Default
null
CardProps.classNameCardProps.className
feedObject?SCFeedObjectTypeFeed Object

Default
null
--
feedObjectActivities?any[]Feed Object latest activities

Default
null
--
feedObjectId?numberId of feed object

Default
null
--
feedObjectType?DISCUSSION | POST | STATUSFeed Object type

Default
'post'
--
hideFollowAction?booleanHide follow action object

Default
false
--
hideParticipantsPreview?booleanHide Participants preview

Default
false
--
id?stringId of the feedObject

Default
feed_object_<feedObjectType>_<feedObjectId | feedObject.id>
CardProps.idCardProps.id
markRead?booleanMark the FeedObject as read when enter in viewport

Default
false
--
onHeightChange?() => voidMust be called whenever a list item's height changes
(for example, when a user clicks an "Expand"/"Collapse" button of
a list item): it re-measures the item's height and updates VirtualScroller
layout. Every change in an item's height must come as a result of
changing some kind of a state, be it the item's state in VirtualScroller
via .onItemStateChange(), or some other state managed by the application.
Call this method to re-measure the current element.
VirtualScrollerItemProps.onHeightChangeVirtualScrollerItemProps.onHeightChange
onReply?(SCCommentType: any) => voidCallback on reply--
onStateChange?(state: any) => voidSave current state and when the component re-mount
restore previous state using props. It is used to keep a copy of
VirtualScroller state so that it could be quickly restored
in case the VirtualScroller component gets unmounted and then
re-mounted back again — for example, when the user navigates away
by clicking on a list item and then navigates "Back" to the list.
VirtualScrollerItemProps.onStateChangeVirtualScrollerItemProps.onStateChange
pollVisible?booleanShow poll as default if exist

Default
false
--
summaryExpanded?booleanShow all summary initially (otherwise it will be truncated)

Default
false
--
template?SCFeedObjectTemplateTypeFeed Object template type

Default
'preview'
--

Functions

FeedObject()

FeedObject(inProps): JSX.Element

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

This component renders a feed object item (post, discussion or status). Take a look at our demo component here

Import

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

Component Name

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

CSS

Rule NameGlobal classDescription
root.SCFeedObject-rootStyles applied to the root element.
deleted.SCFeedObject-deletedStyles applied to the feed obj when is deleted (visible only for admin and moderator).
header.SCFeedObject-headerStyles applied to the header of the card.
category.SCFeedObject-categoryStyles applied to the category element.
group.SCFeedObject-groupStyles applied to the group element.
avatar.SCFeedObject-avatarStyles applied to the avatar element.
username.SCFeedObject-usernameStyles applied to the username element.
activityAt.SCFeedObject-activity-atStyles applied to the activity at section.
tag.SCFeedObject-tagStyles applied to the tag element.
location.SCFeedObject-locationStyles applied to the location element.
content.SCFeedObject-contentStyles applied to the content section. Content section include: title-section, text-section, snippetContent, subContent, medias-section, polls-section, info-section.
error.SCFeedObject-errorStyles applied to the error element.
title-section.SCFeedObject-title-sectionStyles applied to the title section.
title.SCFeedObject-titleStyles applied to the title element.
text-section.SCFeedObject-text-sectionStyles applied to the text section.
text.SCFeedObject-textStyles applied to the text element.
snippet.SCFeedObject-snippetStyles applied to snippet element.
snippet-content.SCFeedObject-snippet-contentStyles applied to snippet content element.
medias-section.SCFeedObject-medias-sectionStyles applied to the medias section.
polls-section.SCFeedObject-polls-sectionStyles applied to the polls section.
info-section.SCFeedObject-info-sectionStyles applied to the info section.
actions-section.SCFeedObject-actions-sectionStyles applied to the actions container.
reply-content.SCFeedObject-reply-contentStyles applied to the reply box.
activitiesSection.SCFeedObject-activities-sectionStyles applied to the activities section element.
activitiesContent.SCFeedObject-activities-contentStyles applied to the activities content element.
followButton.SCFeedObject-follow-buttonStyles applied to the follow button element.

Parameters

ParameterTypeDescription
inPropsFeedObjectProps

Returns

JSX.Element

Source

packages/react-ui/src/components/FeedObject/FeedObject.tsx:326


FeedObjectSkeleton()

FeedObjectSkeleton(props): JSX.Element

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

Import

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

Component Name

The name SCFeedObject-skeleton-root can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCFeedObject-skeleton-rootStyles applied to the root element.
media.SCFeedObject-mediaStyles applied to the media element.

Parameters

ParameterType
propsobject
props.template?SCFeedObjectTemplateType

Returns

JSX.Element

Source

packages/react-ui/src/components/FeedObject/Skeleton.tsx:54