From b1335b17ee4e00a7fc068afb1450102fc0653773 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 6 Mar 2019 15:03:08 +0100 Subject: [PATCH] makes only the title clickable for collapse instead the whole panel header --- .../ui-components/src/repos/DiffFile.js | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/scm-ui-components/packages/ui-components/src/repos/DiffFile.js b/scm-ui-components/packages/ui-components/src/repos/DiffFile.js index e874ef8df3..24aa407fb0 100644 --- a/scm-ui-components/packages/ui-components/src/repos/DiffFile.js +++ b/scm-ui-components/packages/ui-components/src/repos/DiffFile.js @@ -16,7 +16,7 @@ const styles = { panel: { fontSize: "1rem" }, - header: { + titleHeader: { cursor: "pointer" }, title: { @@ -139,18 +139,26 @@ class DiffFile extends React.Component { }; render() { - const { file, fileControlFactory, fileAnnotationFactory, sideBySide, classes } = this.props; + const { + file, + fileControlFactory, + fileAnnotationFactory, + sideBySide, + classes + } = this.props; const { collapsed } = this.state; const viewType = sideBySide ? "split" : "unified"; let body = null; let icon = "fa fa-angle-right"; if (!collapsed) { - const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null; + const fileAnnotations = fileAnnotationFactory + ? fileAnnotationFactory(file) + : null; icon = "fa fa-angle-down"; body = (
- { fileAnnotations } + {fileAnnotations} {file.hunks.map(this.renderHunk)} @@ -161,12 +169,12 @@ class DiffFile extends React.Component { const fileControls = fileControlFactory ? fileControlFactory(file) : null; return (
-
+
-
+
{this.renderFileTitle(file)} @@ -175,9 +183,7 @@ class DiffFile extends React.Component { {this.renderChangeTag(file)}
-
- { fileControls } -
+
{fileControls}
{body}