Move redundant prop to type

This commit is contained in:
Rene Pfeuffer
2020-02-07 15:10:54 +01:00
parent d3d33d5d65
commit bcba3e28cd
4 changed files with 2 additions and 6 deletions

View File

@@ -3,12 +3,10 @@ import DiffFile from "./DiffFile";
import { DiffObjectProps, File } from "./DiffTypes"; import { DiffObjectProps, File } from "./DiffTypes";
import Notification from "../Notification"; import Notification from "../Notification";
import { WithTranslation, withTranslation } from "react-i18next"; import { WithTranslation, withTranslation } from "react-i18next";
import { DefaultCollapsed } from "./defaultCollapsed";
type Props = WithTranslation & type Props = WithTranslation &
DiffObjectProps & { DiffObjectProps & {
diff: File[]; diff: File[];
defaultCollapse?: DefaultCollapsed;
}; };
class Diff extends React.Component<Props> { class Diff extends React.Component<Props> {

View File

@@ -9,14 +9,12 @@ import Tag from "../Tag";
import Icon from "../Icon"; import Icon from "../Icon";
import { Change, ChangeEvent, DiffObjectProps, File, Hunk as HunkType } from "./DiffTypes"; import { Change, ChangeEvent, DiffObjectProps, File, Hunk as HunkType } from "./DiffTypes";
import TokenizedDiffView from "./TokenizedDiffView"; import TokenizedDiffView from "./TokenizedDiffView";
import { DefaultCollapsed } from "./defaultCollapsed";
const EMPTY_ANNOTATION_FACTORY = {}; const EMPTY_ANNOTATION_FACTORY = {};
type Props = DiffObjectProps & type Props = DiffObjectProps &
WithTranslation & { WithTranslation & {
file: File; file: File;
defaultCollapse?: DefaultCollapsed;
}; };
type Collapsible = { type Collapsible = {

View File

@@ -1,4 +1,5 @@
import { ReactNode } from "react"; import { ReactNode } from "react";
import { DefaultCollapsed } from "./defaultCollapsed";
// We place the types here and not in @scm-manager/ui-types, // We place the types here and not in @scm-manager/ui-types,
// because they represent not a real scm-manager related type. // because they represent not a real scm-manager related type.
@@ -77,4 +78,5 @@ export type DiffObjectProps = {
fileAnnotationFactory?: FileAnnotationFactory; fileAnnotationFactory?: FileAnnotationFactory;
annotationFactory?: AnnotationFactory; annotationFactory?: AnnotationFactory;
markConflicts?: boolean; markConflicts?: boolean;
defaultCollapse?: DefaultCollapsed;
}; };

View File

@@ -10,12 +10,10 @@ import { DiffObjectProps, File } from "./DiffTypes";
import { NotFoundError } from "../errors"; import { NotFoundError } from "../errors";
import { Notification } from "../index"; import { Notification } from "../index";
import { withTranslation, WithTranslation } from "react-i18next"; import { withTranslation, WithTranslation } from "react-i18next";
import { DefaultCollapsed } from "./defaultCollapsed";
type Props = WithTranslation & type Props = WithTranslation &
DiffObjectProps & { DiffObjectProps & {
url: string; url: string;
defaultCollapse?: DefaultCollapsed;
}; };
type State = { type State = {