Skip to content

Commit

Permalink
fix(renovate): fix diffviewer interface
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixBlaisThon committed Apr 23, 2024
1 parent bf56fbf commit 6b77cea
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions packages/react/src/components/diffViewer/DiffViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {FunctionComponent, ReactNode} from 'react';
import {parseDiff, Decoration, Diff, Hunk} from 'react-diff-view';
import {FunctionComponent} from 'react';
import {Decoration, Diff, Hunk, HunkData, parseDiff} from 'react-diff-view';

import {BlankSlate} from '../blankSlate';

Expand All @@ -8,26 +8,8 @@ enum DIFF_VIEWER_VIEW_TYPE {
UNIFIED = 'unified',
}

interface HunkModel {
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
content: string;
changes: Array<{
type: 'delete' | 'insert' | 'normal';
content: string | ReactNode;
isNormal?: boolean;
isInsert?: boolean;
isDelete?: boolean;
lineNumber?: number;
oldLineNumber?: number;
newLineNumber?: number;
}>;
}

interface DiffByFileProps {
hunks: HunkModel[];
hunks: HunkData[];
newRevision: string;
oldRevision: string;
type: 'add' | 'delete' | 'modify' | 'rename' | 'copy';
Expand All @@ -36,8 +18,8 @@ interface DiffByFileProps {

const DiffByFile: FunctionComponent<DiffByFileProps> = ({oldRevision, newRevision, hunks, type, viewType}) => (
<Diff key={`${oldRevision}-${newRevision}`} diffType={type} hunks={hunks} viewType={viewType}>
{(collectionHunk: HunkModel[]) =>
collectionHunk.map((hunk: HunkModel) => (
{(collectionHunk: HunkData[]) =>
collectionHunk.map((hunk: HunkData) => (
<>
<Decoration key={`decoration-${hunk.content}`}>
<span />
Expand Down

0 comments on commit 6b77cea

Please sign in to comment.