mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
Migrate react-i18next translate components
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user