fix a ton of typescript errors

This commit is contained in:
Eduard Heimbuch
2020-01-08 13:40:07 +01:00
parent 15a9a5b09b
commit a43ffacf03
41 changed files with 229 additions and 311 deletions

View File

@@ -1,6 +1,7 @@
import React from "react";
import BranchView from "../components/BranchView";
import { connect } from "react-redux";
import { compose } from "redux";
import { Redirect, Route, Switch, withRouter } from "react-router-dom";
import { Repository, Branch } from "@scm-manager/ui-types";
import { fetchBranch, getBranch, getFetchBranchFailure, isFetchBranchPending } from "../modules/branches";
@@ -28,7 +29,6 @@ type Props = {
class BranchRoot extends React.Component<Props> {
componentDidMount() {
const { fetchBranch, repository, branchName } = this.props;
fetchBranch(repository, branchName);
}
@@ -96,9 +96,4 @@ const mapDispatchToProps = (dispatch: any) => {
};
};
export default withRouter(
connect(
mapStateToProps,
mapDispatchToProps
)(BranchRoot)
);
export default compose(withRouter, connect(mapStateToProps, mapDispatchToProps))(BranchRoot);

View File

@@ -75,7 +75,7 @@ class BranchesOverview extends React.Component<Props> {
}
}
const mapStateToProps = (state, ownProps) => {
const mapStateToProps = (state: any, ownProps: Props) => {
const { repository } = ownProps;
const loading = isFetchBranchesPending(state, repository);
const error = getFetchBranchesFailure(state, repository);
@@ -91,7 +91,7 @@ const mapStateToProps = (state, ownProps) => {
};
};
const mapDispatchToProps = dispatch => {
const mapDispatchToProps = (dispatch: any) => {
return {
fetchBranches: (repository: Repository) => {
dispatch(fetchBranches(repository));
@@ -102,8 +102,5 @@ const mapDispatchToProps = dispatch => {
export default compose(
withTranslation("repos"),
withRouter,
connect(
mapStateToProps,
mapDispatchToProps
)
connect(mapStateToProps, mapDispatchToProps)
)(BranchesOverview);