Skip to main content

Feed

Interfaces

FeedProps

Properties

PropertyTypeDescription
cacheStrategy?CacheStrategiesCaching strategies Default CacheStrategies.CACHE_FIRST
className?stringOverrides or extends the styles applied to the component. Default null
CustomAdvProps?CustomAdvPropsProps to spread to single custom adv element (this props can be used only if Custom Adv are enabled) Default {}
disablePaginationLinks?booleanAdd/remove pagination links on top/bottom of items Default false
emptyFeedPlaceholder?ReactNodeEmpty feed placeholder, rendered when no feed item can be displayed Default null
enabledCustomAdvPositions?SCCustomAdvPosition[]Props to programmatically enable the custom adv position in the feed Default [SCCustomAdvPosition.POSITION_FEED_SIDEBAR, SCCustomAdvPosition.POSITION_FEED]
endMessage?ReactNodeEnd message, rendered when no more feed item can be displayed Default <FormattedMessage id="ui.feed.noOtherFeedObject" defaultMessage="ui.feed.noOtherFeedObject" />
endpointEndpointTypeFeed API Endpoint
endpointQueryParams?Record<string, string | number>Feed API Query Params Default [{'limit': 5}]
FeedSidebarProps?StickyBoxPropsProps to spread to the sidebar Default {}
FooterComponent?ElementTypeComponent used as footer. It will be displayed after the end messages Default <Footer>
FooterComponentProps?anyProps to spread to FooterComponent Default empty object
HeaderComponent?ElementComponent used as header. It will be displayed at the beginning of the feed Default null
hideAdvs?booleanShow/hide adv banners Default false
hidePaginationLinks?booleanShow/hide pagination links Default true
id?stringId of the feed object Default 'feed'
ItemComponentElementTypeComponent used to render single feed item retrieved by the endpoint
itemIdGenerator(item) => anyFunction used to generate an id from the single result returned by the Endpoint
ItemProps?anyProps to spread to single feed item Default empty object
itemPropsGenerator(scUser, item) => anyFunction used to convert the single result returned by the Endpoint into the props necessary to render the ItemComponent
ItemSkeletonElementTypeSkeleton used to render loading effect during fetch
ItemSkeletonProps?anyProps to spread to single feed item skeleton Default empty object
onNextData?(page, offset, total, data) => anyCallback invoked whenever data is loaded during paging next
onPreviousData?(page, offset, total, data) => anyCallback invoked whenever data is loaded during paging previous
PaginationLinkProps?Record<string, any>Props to spread to the pagination Link component Default {}
paginationLinksPageQueryParam?stringPage query parameter name Default 'page'
prefetchedData?SCPaginatedResponse<SCFeedUnitType>Prefetch data. Useful for SSR. Use this to init the component (in particular useSCFetchFeed)
refreshMessage?ReactNodeRefresh message, rendered when no more feed item can be displayed Default <FormattedMessage id="ui.feed.refreshRelease" defaultMessage="ui.feed.refreshRelease" />
requireAuthentication?booleanAuthenticated or not
scrollableTargetId?stringIf the feed is being rendered in a "scrollable container" (for example, if one of the parent elements of the list is styled with max-height and overflow: auto), then passing the "scrollableTargetId"
VirtualizedScrollerProps?VirtualizedScrollerCommonPropsProps to spread to VirtualizedScroller object. Default {}
widgets?SCFeedWidgetType[]Widgets to insert into the feed Default empty array

Type Aliases

FeedRef

FeedRef = object

FeedRef props

Properties

PropertyType
addFeedData(obj, syncPagination?) => void
getCurrentFeedObjectIds() => number[]
refresh() => void

FeedSidebarProps

FeedSidebarProps = StickyBoxProps

FeedSidebarProps has the same props as StickyBoxProps type

Variables

feed

feed: ForwardRefExoticComponent<FeedProps & RefAttributes<FeedRef>>

Functions

FeedSkeleton()

FeedSkeleton(props): Element

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

Import

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

Component Name

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

CSS

Rule NameGlobal classDescription
root.SCFeed-skeleton-rootStyles applied to the root element.
left.SCFeed-leftStyles applied to the left section.
right.SCFeed-rightStyles applied to the right section.

Parameters

ParameterType
propsFeedSkeletonProps

Returns

Element