mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
Migrate react-i18next translate components
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { User } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import { Checkbox, MailLink, DateFromNow } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
user: User;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class Details extends React.Component<Props> {
|
||||
@@ -56,4 +55,4 @@ class Details extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("users")(Details);
|
||||
export default withTranslation("users")(Details);
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import { User } from "@scm-manager/ui-types";
|
||||
import { Icon } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
user: User;
|
||||
|
||||
// context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class UserRow extends React.Component<Props> {
|
||||
@@ -39,4 +36,4 @@ class UserRow extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("users")(UserRow);
|
||||
export default withTranslation("users")(UserRow);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import UserRow from "./UserRow";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { User } from "@scm-manager/ui-types";
|
||||
import UserRow from "./UserRow";
|
||||
|
||||
type Props = {
|
||||
t: (p: string) => string;
|
||||
type Props = WithTranslation & {
|
||||
users: User[];
|
||||
};
|
||||
|
||||
@@ -30,4 +29,4 @@ class UserTable extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("users")(UserTable);
|
||||
export default withTranslation("users")(UserTable);
|
||||
|
||||
Reference in New Issue
Block a user