From 4c295bc38c1a2bd2076d0d844e9cf5bd717f78d0 Mon Sep 17 00:00:00 2001
From: yinjianfei-user <85612278+yinjianfei-user@users.noreply.github.com>
Date: Sun, 8 Sep 2024 08:17:47 +0800
Subject: [PATCH] fix-markdown-view (#6728)
* fix-markdown-view
* fix style
---
frontend/src/components/cur-dir-path/dir-path.js | 6 +++---
frontend/src/components/dir-view-mode/dir-column-file.css | 2 +-
frontend/src/components/dir-view-mode/dir-column-file.js | 2 +-
frontend/src/pages/lib-content-view/lib-content-view.js | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/frontend/src/components/cur-dir-path/dir-path.js b/frontend/src/components/cur-dir-path/dir-path.js
index c9b1be55a7..a49082023b 100644
--- a/frontend/src/components/cur-dir-path/dir-path.js
+++ b/frontend/src/components/cur-dir-path/dir-path.js
@@ -249,7 +249,7 @@ class DirPath extends React.Component {
/
)}
- {(currentPath === '/' || currentPath === '') ?
+ {(currentPath === '/' || currentPath === '' || Utils.isMarkdownFile(this.props.currentPath)) ?
:
{repoName}
}
- {pathElem}
- {this.props.isViewFile && !this.isViewMetadata() && (
+ {Utils.isMarkdownFile(this.props.currentPath) ? null : pathElem}
+ {this.props.isViewFile && !Utils.isMarkdownFile(this.props.currentPath) && !this.isViewMetadata() && (
)}
{(this.props.isViewFile && fileTags.length !== 0) &&
diff --git a/frontend/src/components/dir-view-mode/dir-column-file.css b/frontend/src/components/dir-view-mode/dir-column-file.css
index 43bbbf9753..ea223e9b2d 100644
--- a/frontend/src/components/dir-view-mode/dir-column-file.css
+++ b/frontend/src/components/dir-view-mode/dir-column-file.css
@@ -27,7 +27,7 @@
.seafile-markdown-viewer-modal-body {
padding: 0;
- height: 600px;
+ height: calc(100vh / 2 + 130px);
overflow: auto;
}
diff --git a/frontend/src/components/dir-view-mode/dir-column-file.js b/frontend/src/components/dir-view-mode/dir-column-file.js
index 8ba6afe1c2..91f7ade915 100644
--- a/frontend/src/components/dir-view-mode/dir-column-file.js
+++ b/frontend/src/components/dir-view-mode/dir-column-file.js
@@ -52,7 +52,7 @@ class DirColumnFile extends React.Component {
render() {
const { currentDirent } = this.props;
- const { name } = currentDirent;
+ const { name } = currentDirent || {};
if (this.props.isFileLoadedErr) {
return (
diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js
index ca2015278a..cb66fd6eb3 100644
--- a/frontend/src/pages/lib-content-view/lib-content-view.js
+++ b/frontend/src/pages/lib-content-view/lib-content-view.js
@@ -91,7 +91,7 @@ class LibContentView extends React.Component {
asyncOperationProgress: 0,
asyncOperatedFilesLength: 0,
viewId: '0000',
- currentDirent: null
+ currentDirent: {}
};
this.oldonpopstate = window.onpopstate;