mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
Fix empty content in modal view of collapsed panel
This commit is contained in:
@@ -415,12 +415,8 @@ class DiffFile extends React.Component<Props, State> {
|
|||||||
const { file, collapsed, sideBySide, diffExpander, expansionError } = this.state;
|
const { file, collapsed, sideBySide, diffExpander, expansionError } = this.state;
|
||||||
const viewType = sideBySide ? "split" : "unified";
|
const viewType = sideBySide ? "split" : "unified";
|
||||||
|
|
||||||
let body = null;
|
|
||||||
let icon = "angle-right";
|
|
||||||
if (!collapsed) {
|
|
||||||
const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null;
|
const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null;
|
||||||
icon = "angle-down";
|
const innerContent = (
|
||||||
body = (
|
|
||||||
<div className="panel-block is-paddingless">
|
<div className="panel-block is-paddingless">
|
||||||
{fileAnnotations}
|
{fileAnnotations}
|
||||||
<TokenizedDiffView className={viewType} viewType={viewType} file={file}>
|
<TokenizedDiffView className={viewType} viewType={viewType} file={file}>
|
||||||
@@ -432,13 +428,18 @@ class DiffFile extends React.Component<Props, State> {
|
|||||||
</TokenizedDiffView>
|
</TokenizedDiffView>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
let icon = "angle-right";
|
||||||
|
let body = null;
|
||||||
|
if (!collapsed) {
|
||||||
|
icon = "angle-down";
|
||||||
|
body = innerContent;
|
||||||
}
|
}
|
||||||
const collapseIcon = this.hasContent(file) ? <Icon name={icon} color="inherit" /> : null;
|
const collapseIcon = this.hasContent(file) ? <Icon name={icon} color="inherit" /> : null;
|
||||||
const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null;
|
const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null;
|
||||||
const openInFullscreen = file?.hunks?.length ? (
|
const openInFullscreen = file?.hunks?.length ? (
|
||||||
<OpenInFullscreenButton
|
<OpenInFullscreenButton
|
||||||
modalTitle={file.type === "delete" ? file.oldPath : file.newPath}
|
modalTitle={file.type === "delete" ? file.oldPath : file.newPath}
|
||||||
modalBody={<MarginlessModalContent>{body}</MarginlessModalContent>}
|
modalBody={<MarginlessModalContent>{innerContent}</MarginlessModalContent>}
|
||||||
/>
|
/>
|
||||||
) : null;
|
) : null;
|
||||||
const sideBySideToggle = file?.hunks?.length && (
|
const sideBySideToggle = file?.hunks?.length && (
|
||||||
|
|||||||
Reference in New Issue
Block a user