summaryrefslogtreecommitdiffstats
path: root/ui/src/components/user-listing.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-04-10 16:55:57 -0400
committerDessalines <tyhou13@gmx.com>2020-04-10 16:55:57 -0400
commitbb287cbd076940bd09f6afb61b642370d020f91e (patch)
treef3fe3afa29b6445fbb2232a8c5a9133b8d691a91 /ui/src/components/user-listing.tsx
parented264aba3c12243352f68c2de6a5f21f23778bd0 (diff)
Adding an admin settings page.
- Fixes #620 - Adding a UserListing component. Fixes #627
Diffstat (limited to 'ui/src/components/user-listing.tsx')
-rw-r--r--ui/src/components/user-listing.tsx36
1 files changed, 36 insertions, 0 deletions
diff --git a/ui/src/components/user-listing.tsx b/ui/src/components/user-listing.tsx
new file mode 100644
index 00000000..1f136e00
--- /dev/null
+++ b/ui/src/components/user-listing.tsx
@@ -0,0 +1,36 @@
+import { Component } from 'inferno';
+import { Link } from 'inferno-router';
+import { UserView } from '../interfaces';
+import { pictshareAvatarThumbnail, showAvatars } from '../utils';
+
+interface UserOther {
+ name: string;
+ avatar?: string;
+}
+
+interface UserListingProps {
+ user: UserView | UserOther;
+}
+
+export class UserListing extends Component<UserListingProps, any> {
+ constructor(props: any, context: any) {
+ super(props, context);
+ }
+
+ render() {
+ let user = this.props.user;
+ return (
+ <Link className="text-body font-weight-bold" to={`/u/${user.name}`}>
+ {user.avatar && showAvatars() && (
+ <img
+ height="32"
+ width="32"
+ src={pictshareAvatarThumbnail(user.avatar)}
+ class="rounded-circle mr-2"
+ />
+ )}
+ <span>{user.name}</span>
+ </Link>
+ );
+ }
+}