Migrate react-i18next translate components

This commit is contained in:
Florian Scholdei
2019-10-23 15:47:08 +02:00
parent e4668ae304
commit db075974db
121 changed files with 498 additions and 740 deletions

View File

@@ -1,16 +1,13 @@
import * as React from "react";
import { translate } from "react-i18next";
import { WithTranslation, withTranslation } from "react-i18next";
import classNames from "classnames";
import styled from "styled-components";
import { InfoItem } from "./InfoItem";
import { Icon } from "@scm-manager/ui-components";
type Props = {
type Props = WithTranslation & {
type: "plugin" | "feature";
item: InfoItem;
// context props
t: (p: string) => string;
};
const BottomMarginA = styled.a`
@@ -73,4 +70,4 @@ class InfoBox extends React.Component<Props> {
}
}
export default translate("commons")(InfoBox);
export default withTranslation("commons")(InfoBox);

View File

@@ -1,15 +1,12 @@
import React from "react";
import { translate } from "react-i18next";
import { WithTranslation, withTranslation } from "react-i18next";
import styled from "styled-components";
import { Image, ErrorNotification, InputField, SubmitButton, UnauthorizedError } from "@scm-manager/ui-components";
type Props = {
type Props = WithTranslation & {
error?: Error;
loading: boolean;
loginHandler: (username: string, password: string) => void;
// context props
t: (p: string) => string;
};
type State = {
@@ -106,4 +103,4 @@ class LoginForm extends React.Component<Props, State> {
}
}
export default translate("commons")(LoginForm);
export default withTranslation("commons")(LoginForm);