From 8fa31edaae694903667f13cae342655597592c0b Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 20 Apr 2021 15:31:49 +0800 Subject: [PATCH] =?UTF-8?q?md=E6=96=87=E4=BB=B6=E8=A6=81=E7=94=A8Markdown?= =?UTF-8?q?=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 5 +++++ src/forge/Main/CoderRootFileDetail.js | 4 ++-- src/forge/Main/Index.scss | 1 + src/forge/Main/list.css | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 15032641..4907c3fc 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -230,6 +230,10 @@ function CoderDepot(props){ } }) } + + let n = fileInfo && fileInfo.name; + const mdFlag = n && n.substring(n.length-3,n.length) === ".md"; + return( setOpenModal(false)} onOk={okUpdate}/> @@ -353,6 +357,7 @@ function CoderDepot(props){ {...props} detail={fileInfo} readOnly={readOnly} + md={mdFlag} onEdit={onEdit} currentBranch={branchName || (projectDetail && projectDetail.default_branch)} type={projectDetail.type} diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index 1455086d..13939981 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -24,7 +24,7 @@ class CoderRootFileDetail extends Component { } componentDidMount = () => { - const { detail } = this.props; + const { detail , mdFlag } = this.props; this.setState({ value: detail.content, }); @@ -176,9 +176,9 @@ class CoderRootFileDetail extends Component { current_user, isManager, isDeveloper, - md, currentBranch, platform, + md, type } = this.props; const { language, languages, description } = this.state; diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index 1e9a8967..631d52c9 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -295,6 +295,7 @@ border-radius: 4px; .ant-dropdown-menu-item{ border-radius: 8px; + text-align: left; a{ width: 350px; overflow: hidden; diff --git a/src/forge/Main/list.css b/src/forge/Main/list.css index 07991f6a..9854a0a3 100644 --- a/src/forge/Main/list.css +++ b/src/forge/Main/list.css @@ -281,7 +281,6 @@ height:100%; } .files-md{ - border:1px solid #eee; padding:20px; } /* 详情-代码 */