Add divider for not parsed hunks

This commit is contained in:
René Pfeuffer
2020-06-10 13:11:44 +02:00
parent 86282e570f
commit e6deecca17
2 changed files with 343 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ import { withTranslation, WithTranslation } from "react-i18next";
import classNames from "classnames";
import styled from "styled-components";
// @ts-ignore
import { getChangeKey, Hunk } from "react-diff-view";
import { Decoration, getChangeKey, Hunk } from "react-diff-view";
import { ButtonGroup } from "../buttons";
import Tag from "../Tag";
import Icon from "../Icon";
@@ -82,6 +82,10 @@ const ButtonWrapper = styled.div`
margin-left: auto;
`;
const HunkDivider = styled.hr`
margin: 0.5rem 0;
`;
const ChangeTypeTag = styled(Tag)`
margin-left: 0.75rem;
`;
@@ -304,6 +308,8 @@ class DiffFile extends React.Component<Props, State> {
const items = [];
if (file._links?.lines) {
items.push(this.createHunkHeader(expandableHunk));
} else if (i > 0) {
items.push(<Decoration><HunkDivider /></Decoration>);
}
items.push(