translate users module

This commit is contained in:
Sebastian Sdorra
2018-07-24 16:04:55 +02:00
parent d4eadc21df
commit fd01cb0573
6 changed files with 89 additions and 32 deletions

View File

@@ -1,26 +1,28 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import UserRow from "./UserRow";
import type { User } from "../types/User";
import type { UserEntry } from "../types/UserEntry";
type Props = {
t: string => string,
entries: Array<UserEntry>,
deleteUser: User => void
};
class UserTable extends React.Component<Props> {
render() {
const { deleteUser } = this.props;
const { deleteUser, t } = this.props;
const entries = this.props.entries;
return (
<table className="table is-hoverable is-fullwidth">
<thead>
<tr>
<th>Name</th>
<th>Display Name</th>
<th>E-Mail</th>
<th>Admin</th>
<th>{t("user.name")}</th>
<th>{t("user.displayName")}</th>
<th>{t("user.mail")}</th>
<th>{t("user.admin")}</th>
<th />
<th />
</tr>
@@ -37,4 +39,4 @@ class UserTable extends React.Component<Props> {
}
}
export default UserTable;
export default translate("users")(UserTable);