@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
88 lines (79 loc) • 2.31 kB
TypeScript
import { ButtonBaseProps } from '@mui/material';
import { SCUserType } from '@selfcommunity/types';
import React, { ReactNode } from 'react';
import { FollowUserButtonProps } from '../FollowUserButton/FollowUserButton';
import { FriendshipButtonProps } from '../FriendshipUserButton/FriendshipUserButton';
import { WidgetProps } from '../Widget';
export interface UserProps extends WidgetProps {
/**
* User Id
* @default null
*/
userId?: number;
/**
* User Object
* @default null
*/
user?: SCUserType;
/**
* Handles actions ignore
* @default null
*/
handleIgnoreAction?: (u: any) => void;
/**
* Props to spread to follow/friendship button
* @default {}
*/
followConnectUserButtonProps?: FollowUserButtonProps | FriendshipButtonProps;
/**
* Prop to show user followers as secondary text
* @default false
*/
showFollowers?: boolean;
/**
* Badge content to show as user avatar badge if show reaction is true.
*/
badgeContent?: any;
/**
* If true, shows a custom label next to the user username
* @default false
*/
isGroupAdmin?: boolean;
/**
* Prop to add actions
* @default null
*/
actions?: React.ReactNode;
/**
* Props to spread to the button
* @default {}
*/
buttonProps?: ButtonBaseProps | null;
secondary?: ReactNode | null;
/**
* Any other properties
*/
[p: string]: any;
}
/**
* > API documentation for the Community-JS User component. Learn about the available props and the CSS API.
*
*
* This component renders a user item.
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/User)
#### Import
```jsx
import {User} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCUser` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCUser-root|Styles applied to the root element.|
|avatar|.SCUser-avatar|Styles applied to the avatar element.|
|staffBadgeLabel|.SCUser-staff-badge-label|Styles applied to the staff badge label element.|
*
* @param inProps
*/
export default function User(inProps: UserProps): JSX.Element;