synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
40 lines (39 loc) • 2.3 kB
TypeScript
import React from 'react';
import { MenuAction } from './UserCardContextMenu';
import { UserProfile } from '../utils/synapseTypes/';
import { AvatarSize } from './Avatar';
export declare type UserCardSize = 'AVATAR' | 'SMALL USER CARD' | 'MEDIUM USER CARD' | 'LARGE USER CARD';
export declare type UserCardProps = {
/** A UserProfile may be used for data for the card. You must supply one of `userProfile`, `alias`, `ownerId` */
userProfile?: UserProfile;
/** Whether or not to hide the user's Synapse email address */
hideEmail?: boolean;
/** If set, the corresponding image will be shown for the user. */
preSignedURL?: string;
/** An alias that resolves the ownerId for the UserProfile. You must supply one of `userProfile`, `alias`, `ownerId` */
alias?: string;
/** The unique ownerId of the UserProfile. You must supply one of `userProfile`, `alias`, `ownerId` */
ownerId?: string;
/** Specifies the card size */
size: UserCardSize;
/** For the small user card or avatar, shows the medium user card on mouseover */
showCardOnHover?: boolean;
/** For the small user card, hides the tooltip observed when hovering over the profile image. */
hideTooltip?: boolean;
/** Specifies the dropdown menu functionality for the ellipsis on medium/large cards. If field === 'SEPERATOR' then a break will occur in the menu. If left undefined, the menu will not render to the screen. */
menuActions?: MenuAction[];
/** The link to point to on the user name, defaults to https://www.synapse.org/#!Profile:${userProfile.ownerId} */
link?: string;
openLinkInNewTab?: boolean;
/** Disables the `@username` link for the small user card (if `showCardOnHover` is false). For the medium user card, disables linking the user's name to their profile (or other specified destination) */
disableLink?: boolean;
isCertified?: boolean;
isValidated?: boolean;
/** Determines the size of the avatar when size === 'AVATAR' or (size === 'SMALL' and withAvatar is true) */
avatarSize?: AvatarSize;
/** Whether to show the avatar with the name for the small user card */
withAvatar?: boolean;
className?: string;
};
export declare const UserCard: React.FunctionComponent<UserCardProps>;
export default UserCard;