refactor to use file control factory

This commit is contained in:
Konstantin Schaper
2020-08-10 20:48:08 +02:00
parent 08efc9421d
commit c69ab4ea65
12 changed files with 226 additions and 190 deletions

View File

@@ -23,17 +23,15 @@
*/
import React from "react";
import DiffFile from "./DiffFile";
import { DiffObjectProps, File } from "./DiffTypes";
import {DiffObjectProps, File, FileControlFactory} from "./DiffTypes";
import Notification from "../Notification";
import { WithTranslation, withTranslation } from "react-i18next";
import {Changeset} from "@scm-manager/ui-types";
import {WithTranslation, withTranslation} from "react-i18next";
type Props = WithTranslation &
DiffObjectProps & {
diff: File[];
changeset: Changeset;
baseUrl?: string;
};
diff: File[];
fileControlFactory?: FileControlFactory;
};
class Diff extends React.Component<Props> {
static defaultProps: Partial<Props> = {
@@ -41,7 +39,7 @@ class Diff extends React.Component<Props> {
};
render() {
const { diff, t, ...fileProps } = this.props;
const {diff, t, ...fileProps} = this.props;
return (
<>
{diff.length === 0 ? (