mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 12:05:52 +01:00
Migrate react-i18next translate components
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import React, { ChangeEvent } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import React, { ChangeEvent, FormEvent } from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import styled from "styled-components";
|
||||
import { FormEvent } from "react";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
filter: (p: string) => void;
|
||||
value?: string;
|
||||
|
||||
// context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -59,4 +55,4 @@ class FilterInput extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("commons")(FilterInput);
|
||||
export default withTranslation("commons")(FilterInput);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { DisplayedUser } from "@scm-manager/ui-types";
|
||||
import TagGroup from "./TagGroup";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
members: string[];
|
||||
memberListChanged: (p: string[]) => void;
|
||||
label?: string;
|
||||
helpText?: string;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class MemberNameTagGroup extends React.Component<Props> {
|
||||
@@ -39,4 +38,4 @@ class MemberNameTagGroup extends React.Component<Props> {
|
||||
};
|
||||
}
|
||||
|
||||
export default translate("groups")(MemberNameTagGroup);
|
||||
export default withTranslation("groups")(MemberNameTagGroup);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import InputField from "./InputField";
|
||||
|
||||
type State = {
|
||||
@@ -8,11 +8,9 @@ type State = {
|
||||
passwordValid: boolean;
|
||||
passwordConfirmationFailed: boolean;
|
||||
};
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
passwordChanged: (p1: string, p2: boolean) => void;
|
||||
passwordValidator?: (p: string) => boolean;
|
||||
// Context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
class PasswordConfirmation extends React.Component<Props, State> {
|
||||
@@ -106,4 +104,4 @@ class PasswordConfirmation extends React.Component<Props, State> {
|
||||
};
|
||||
}
|
||||
|
||||
export default translate("commons")(PasswordConfirmation);
|
||||
export default withTranslation("commons")(PasswordConfirmation);
|
||||
|
||||
Reference in New Issue
Block a user