mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
Add option to hide whitepace changes in diffs
Co-authored-by: Florian Scholdei<florian.scholdei@cloudogu.com> Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com> Reviewed-by: Florian Scholdei <florian.scholdei@cloudogu.com>
This commit is contained in:
@@ -35,6 +35,7 @@ type Props = DiffObjectProps & {
|
||||
url: string;
|
||||
limit?: number;
|
||||
refetchOnWindowFocus?: boolean;
|
||||
ignoreWhitespace?: string;
|
||||
};
|
||||
|
||||
type NotificationProps = {
|
||||
@@ -54,8 +55,12 @@ const PartialNotification: FC<NotificationProps> = ({ fetchNextPage, isFetchingN
|
||||
);
|
||||
};
|
||||
|
||||
const LoadingDiff: FC<Props> = ({ url, limit, refetchOnWindowFocus, ...props }) => {
|
||||
const { error, isLoading, data, fetchNextPage, isFetchingNextPage } = useDiff(url, { limit, refetchOnWindowFocus });
|
||||
const LoadingDiff: FC<Props> = ({ url, limit, refetchOnWindowFocus, ignoreWhitespace, ...props }) => {
|
||||
const { error, isLoading, data, fetchNextPage, isFetchingNextPage } = useDiff(url, {
|
||||
limit,
|
||||
refetchOnWindowFocus,
|
||||
ignoreWhitespace,
|
||||
});
|
||||
const [t] = useTranslation("repos");
|
||||
|
||||
if (error) {
|
||||
@@ -70,7 +75,7 @@ const LoadingDiff: FC<Props> = ({ url, limit, refetchOnWindowFocus, ...props })
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Diff diff={data.files} {...props} />
|
||||
<Diff diff={data.files} ignoreWhitespace={ignoreWhitespace} {...props} />
|
||||
{data.partial ? (
|
||||
<PartialNotification fetchNextPage={fetchNextPage} isFetchingNextPage={isFetchingNextPage} />
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user