mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
Migrate react-i18next translate components
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { translate } from "react-i18next";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import classNames from "classnames";
|
||||
import styled from "styled-components";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
@@ -11,15 +11,12 @@ import FileButtonAddons from "../components/content/FileButtonAddons";
|
||||
import SourcesView from "./SourcesView";
|
||||
import HistoryView from "./HistoryView";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
loading: boolean;
|
||||
file: File;
|
||||
repository: Repository;
|
||||
revision: string;
|
||||
path: string;
|
||||
|
||||
// context props
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -209,4 +206,4 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(translate("repos")(Content));
|
||||
export default connect(mapStateToProps)(withTranslation("repos")(Content));
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Branch, Repository } from "@scm-manager/ui-types";
|
||||
import FileTree from "../components/FileTree";
|
||||
import { BranchSelector, Breadcrumb, ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||
import { translate } from "react-i18next";
|
||||
import FileTree from "../components/FileTree";
|
||||
import {
|
||||
fetchBranches,
|
||||
getBranches,
|
||||
@@ -15,7 +15,7 @@ import { compose } from "redux";
|
||||
import Content from "./Content";
|
||||
import { fetchSources, isDirectory } from "../modules/sources";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
loading: boolean;
|
||||
error: Error;
|
||||
@@ -33,7 +33,6 @@ type Props = {
|
||||
history: any;
|
||||
match: any;
|
||||
location: any;
|
||||
t: (p: string) => string;
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -203,7 +202,7 @@ const mapDispatchToProps = dispatch => {
|
||||
};
|
||||
|
||||
export default compose(
|
||||
translate("repos"),
|
||||
withTranslation("repos"),
|
||||
withRouter,
|
||||
connect(
|
||||
mapStateToProps,
|
||||
|
||||
Reference in New Issue
Block a user