office-ui-fabric-react#IPersona TypeScript Examples

The following examples show how to use office-ui-fabric-react#IPersona. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IPeoplePickerItems.ts    From sp-site-designs-studio with MIT License 6 votes vote down vote up
export class SharePointUserPersona  implements IPersona {
    private _user:IEnsurableSharePointUser;
    public get User(): IEnsurableSharePointUser {
        return this._user;
    }

    public set User(user: IEnsurableSharePointUser) {
        this._user = user;
        this.primaryText = user.Title;
        this.secondaryText = user.EntityData.Title;
        this.tertiaryText = user.EntityData.Department;
        this.imageShouldFadeIn = true;
        this.imageUrl = `/_layouts/15/userphoto.aspx?size=S&accountname=${this.User.Key.substr(this.User.Key.lastIndexOf('|') + 1)}`;
    }

    constructor (user: IEnsurableSharePointUser) {
        this.User = user;
    }

    public primaryText: string;
    public secondaryText: string;
    public tertiaryText: string;
    public imageUrl: string;
    public imageShouldFadeIn: boolean;
}