updates users structure

This commit is contained in:
Christoph Wolfes
2018-07-25 15:04:19 +02:00
parent fdce7be66e
commit d1bbb6a14f
14 changed files with 67 additions and 61 deletions

View File

@@ -0,0 +1,31 @@
// @flow
import React from "react";
import { Link } from "react-router-dom";
import type { User } from "../../types/User";
type Props = {
user: User
};
export default class UserRow extends React.Component<Props> {
renderLink(to: string, label: string) {
return <Link to={to}>{label}</Link>;
}
render() {
const { user } = this.props;
const to = `/user/${user.name}`;
return (
<tr>
<td className="is-hidden-mobile">{this.renderLink(to, user.name)}</td>
<td>{this.renderLink(to, user.displayName)}</td>
<td>
<a href={`mailto: ${user.mail}`}>{user.mail}</a>
</td>
<td className="is-hidden-mobile">
<input type="checkbox" id="admin" checked={user.admin} readOnly />
</td>
</tr>
);
}
}