]> Untitled Git - lemmy.git/blob - ui/src/components/user-listing.tsx
Merge remote-tracking branch 'weblate/master'
[lemmy.git] / ui / src / components / user-listing.tsx
1 import { Component } from 'inferno';
2 import { Link } from 'inferno-router';
3 import { UserView } from '../interfaces';
4 import { pictshareAvatarThumbnail, showAvatars } from '../utils';
5
6 interface UserOther {
7   name: string;
8   avatar?: string;
9 }
10
11 interface UserListingProps {
12   user: UserView | UserOther;
13 }
14
15 export class UserListing extends Component<UserListingProps, any> {
16   constructor(props: any, context: any) {
17     super(props, context);
18   }
19
20   render() {
21     let user = this.props.user;
22     return (
23       <Link className="text-body font-weight-bold" to={`/u/${user.name}`}>
24         {user.avatar && showAvatars() && (
25           <img
26             height="32"
27             width="32"
28             src={pictshareAvatarThumbnail(user.avatar)}
29             class="rounded-circle mr-2"
30           />
31         )}
32         <span>{user.name}</span>
33       </Link>
34     );
35   }
36 }