@selfcommunity/react-templates
Version:
React Templates Components to integrate a Community created with SelfCommunity.
112 lines (105 loc) • 3.53 kB
TypeScript
import React from 'react';
import { FeedObjectProps, FeedSidebarProps, SCFeedWidgetType, UserProfileHeaderProps } from '@selfcommunity/react-ui';
import { UserFeedProps } from '../UserFeed';
import { SCUserType } from '@selfcommunity/types';
export interface UserProfileProps {
/**
* Id of the user profile
* @default 'user'
*/
id?: string;
/**
* Overrides or extends the styles applied to the component.
* @default null
*/
className?: string;
/**
* User Object
* @default null
*/
user?: SCUserType;
/**
* Id of the user for filter the feed
* @default null
*/
userId?: number | string;
/**
* Actions to be inserted before default user profile actions
*/
startActions?: React.ReactNode | null;
/**
* Actions to be inserted after default user profile actions
*/
endActions?: React.ReactNode | null;
/**
* Actions to be inserted before default user profile actions if is not my profile (view mode)
*/
viewStartActions?: React.ReactNode | null;
/**
* Actions to be inserted after default user profile actions if is not my profile (view mode)
*/
viewEndActions?: React.ReactNode | null;
/**
* Actions to be inserted before default user profile actions if it is my profile (edit mode)
*/
editStartActions?: React.ReactNode | null;
/**
* Actions to be inserted after default user profile actions if it is my profile (edit mode)
*/
editEndActions?: React.ReactNode | null;
/**
* Widgets to be rendered into the feed
* @default [UserFollowedCategoriesWidget, UserFollowedUsersWidget]
*/
widgets?: SCFeedWidgetType[] | null;
/**
* Props to spread to single feed object
* @default empty object
*/
FeedObjectProps?: FeedObjectProps;
/**
* Props to spread to single feed object
* @default {top: 0, bottomBoundary: `#${id}`}
*/
FeedSidebarProps?: FeedSidebarProps;
/**
* Props to spread to UserTagStack component
* @default {}
*/
UserProfileHeaderProps?: UserProfileHeaderProps;
/**
* Click handler for edit button
* @default null
*/
onEditClick?: (user: SCUserType) => void;
/**
* Props to spread to feed component
* @default {}
*/
UserFeedProps?: UserFeedProps;
}
/**
* > API documentation for the Community-JS User Profile Template. Learn about the available props and the CSS API.
*
*
* This component renders a specific user's profile template.
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-templates/Components/UserProfile)
#### Import
```jsx
import {UserProfile} from '@selfcommunity/react-templates';
```
#### Component Name
The name `SCUserProfileTemplate` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCUserProfileTemplate-root|Styles applied to the root element.|
|counters|.SCUserProfileTemplate-counters|Styles applied to the counters section.|
|tags|.SCUserProfileTemplate-tags|Styles applied to the tags section.|
|info|.SCUserProfileTemplate-info|Styles applied to the info section.|
|feed|.SCUserProfileTemplate-feed|Styles applied to the feed section.|
|actions|.SCUserProfileTemplate-actions|Styles applied to the actions section.|
*
* @param inProps
*/
export default function UserProfile(inProps: UserProfileProps): JSX.Element;