From fba2bc2e80fcea1d1eb88844cf4affc17127cf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20S=C3=BCwer?= Date: Thu, 1 Nov 2018 10:58:47 +0100 Subject: [PATCH] show text if source is text --- .../src/repos/sources/containers/Content.js | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/scm-ui/src/repos/sources/containers/Content.js b/scm-ui/src/repos/sources/containers/Content.js index 3e6ce183cf..0b764aa6a1 100644 --- a/scm-ui/src/repos/sources/containers/Content.js +++ b/scm-ui/src/repos/sources/containers/Content.js @@ -34,7 +34,7 @@ type State = { language: string, loaded: boolean, collapsed: boolean, - error?: Error, + error?: Error }; const styles = { @@ -129,20 +129,20 @@ class Content extends React.Component { - - + + - - + + - - + + - - + +
Path{file.path}Path{file.path}
Branch{revision}Branch{revision}
Last modified{date}Last modified{date}
Description{description}Description{description}
@@ -154,12 +154,13 @@ class Content extends React.Component { showContent() { const { file, revision } = this.props; - const contentType = this.state.contentType; - const language = this.state.language; + const { contentType, language } = this.state; if (contentType.startsWith("image/")) { return ; } else if (language) { return ; + } else if (contentType.startsWith("text/")) { + return ; } else { return ( { render() { const { file, classes } = this.props; - const error = this.state.error; - const loaded = this.state.loaded; + const { loaded, error } = this.state; if (!file || !loaded) { return ; @@ -202,7 +202,6 @@ class Content extends React.Component { } } - const mapStateToProps = (state: any, ownProps: Props) => { const { repository, revision, path } = ownProps;