mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-06 15:07:25 +02:00
Export WhitespaceMode typing
This commit is contained in:
@@ -17,8 +17,7 @@
|
||||
import React, { FC, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Checkbox } from "@scm-manager/ui-core";
|
||||
|
||||
export type HideWhiteSpaceMode = "ALL" | "NONE";
|
||||
import { WhitespaceMode } from "./LoadingDiff";
|
||||
|
||||
type DiffDropDownProps = {
|
||||
collapseDiffs: () => void;
|
||||
@@ -27,8 +26,8 @@ type DiffDropDownProps = {
|
||||
*/
|
||||
ignoreWhitespaces?: () => void;
|
||||
renderOnMount: boolean;
|
||||
ignoreWhitespacesMode?: HideWhiteSpaceMode;
|
||||
setIgnoreWhitespacesMode?: (hideWhiteSpaceMode: HideWhiteSpaceMode) => void;
|
||||
ignoreWhitespacesMode?: WhitespaceMode;
|
||||
setIgnoreWhitespacesMode?: (hideWhiteSpaceMode: WhitespaceMode) => void;
|
||||
};
|
||||
const DiffDropDown: FC<DiffDropDownProps> = ({
|
||||
collapseDiffs,
|
||||
|
||||
@@ -29,7 +29,8 @@ import DiffFileTree from "./diff/DiffFileTree";
|
||||
import { DiffContent, FileTreeContent } from "./diff/styledElements";
|
||||
import { useHistory, useLocation } from "react-router-dom";
|
||||
import { getFileNameFromHash } from "./diffs";
|
||||
import { HideWhiteSpaceMode } from "./DiffDropDown";
|
||||
|
||||
export type WhitespaceMode = "ALL" | "NONE";
|
||||
|
||||
type Props = DiffObjectProps & {
|
||||
url: string;
|
||||
@@ -56,7 +57,7 @@ const PartialNotification: FC<NotificationProps> = ({ fetchNextPage, isFetchingN
|
||||
};
|
||||
|
||||
const LoadingDiff: FC<Props> = ({ url, limit, refetchOnWindowFocus, ...props }) => {
|
||||
const [ignoreWhitespace, setIgnoreWhitespace] = useState<HideWhiteSpaceMode>("NONE");
|
||||
const [ignoreWhitespace, setIgnoreWhitespace] = useState<WhitespaceMode>("NONE");
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
const [prevHash, setPrevHash] = useState("");
|
||||
const location = useLocation();
|
||||
@@ -107,7 +108,7 @@ const LoadingDiff: FC<Props> = ({ url, limit, refetchOnWindowFocus, ...props })
|
||||
collapseDiffs={collapseDiffs}
|
||||
renderOnMount={true}
|
||||
ignoreWhitespacesMode={ignoreWhitespace}
|
||||
setIgnoreWhitespacesMode={(hideWhiteSpaceMode: HideWhiteSpaceMode) => {
|
||||
setIgnoreWhitespacesMode={(hideWhiteSpaceMode: WhitespaceMode) => {
|
||||
setIgnoreWhitespace(hideWhiteSpaceMode);
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
AnnotationFactoryContext,
|
||||
DiffEventHandler,
|
||||
DiffEventContext,
|
||||
DiffObjectProps
|
||||
DiffObjectProps,
|
||||
} from "./DiffTypes";
|
||||
|
||||
import { FileDiff as File, FileChangeType, Hunk, Change, ChangeType } from "@scm-manager/ui-types";
|
||||
@@ -36,7 +36,7 @@ export { default as Diff } from "./Diff";
|
||||
export { default as DiffFile } from "./DiffFile";
|
||||
export { default as DiffButton } from "./DiffButton";
|
||||
export { FileControlFactory } from "./DiffTypes";
|
||||
export { default as LoadingDiff } from "./LoadingDiff";
|
||||
export { default as LoadingDiff, WhitespaceMode } from "./LoadingDiff";
|
||||
export { DefaultCollapsed, DefaultCollapsedFunction } from "./defaultCollapsed";
|
||||
export { default as RepositoryAvatar } from "./RepositoryAvatar";
|
||||
export { default as RepositoryEntry } from "./RepositoryEntry";
|
||||
@@ -46,7 +46,7 @@ export { default as CommitAuthor } from "./CommitAuthor";
|
||||
export { default as HealthCheckFailureDetail } from "./HealthCheckFailureDetail";
|
||||
export { default as RepositoryFlags } from "./RepositoryFlags";
|
||||
export { default as DiffDropDown } from "./DiffDropDown";
|
||||
export { default as DiffStatistics } from "./DiffStatistics"
|
||||
export { default as DiffStatistics } from "./DiffStatistics";
|
||||
|
||||
export {
|
||||
File,
|
||||
@@ -59,5 +59,5 @@ export {
|
||||
AnnotationFactoryContext,
|
||||
DiffEventHandler,
|
||||
DiffEventContext,
|
||||
DiffObjectProps
|
||||
DiffObjectProps,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user