mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
Lib view mode improve (#2968)
* optimized column style * update heading icon font-size * improve code style
This commit is contained in:
@@ -107,6 +107,7 @@ class FileContentView extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className="cur-view-content">
|
<div className="cur-view-content">
|
||||||
<WikiMarkdownViewer
|
<WikiMarkdownViewer
|
||||||
|
isTOCShow={false}
|
||||||
isFileLoading={this.props.isFileLoading}
|
isFileLoading={this.props.isFileLoading}
|
||||||
markdownContent={this.props.content}
|
markdownContent={this.props.content}
|
||||||
lastModified = {this.props.lastModified}
|
lastModified = {this.props.lastModified}
|
||||||
|
@@ -12,7 +12,8 @@ const propTypes = {
|
|||||||
latestContributor: PropTypes.string.isRequired,
|
latestContributor: PropTypes.string.isRequired,
|
||||||
lastModified: PropTypes.string.isRequired,
|
lastModified: PropTypes.string.isRequired,
|
||||||
onLinkClick: PropTypes.func.isRequired,
|
onLinkClick: PropTypes.func.isRequired,
|
||||||
isWiki: PropTypes.bool
|
isWiki: PropTypes.bool,
|
||||||
|
isTOCShow: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
const contentClass = 'wiki-page-content';
|
const contentClass = 'wiki-page-content';
|
||||||
@@ -152,10 +153,14 @@ class WikiMarkdownViewer extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderMarkdown = () => {
|
renderMarkdown = () => {
|
||||||
|
let isTOCShow = true;
|
||||||
|
if (this.props.isTOCShow === false) {
|
||||||
|
isTOCShow = false;
|
||||||
|
}
|
||||||
if (this.props.isWiki) {
|
if (this.props.isWiki) {
|
||||||
return (
|
return (
|
||||||
<MarkdownViewer
|
<MarkdownViewer
|
||||||
showTOC={true}
|
showTOC={isTOCShow}
|
||||||
markdownContent={this.props.markdownContent}
|
markdownContent={this.props.markdownContent}
|
||||||
activeTitleIndex={this.state.activeTitleIndex}
|
activeTitleIndex={this.state.activeTitleIndex}
|
||||||
onContentRendered={this.onContentRendered}
|
onContentRendered={this.onContentRendered}
|
||||||
@@ -166,7 +171,7 @@ class WikiMarkdownViewer extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MarkdownViewer
|
<MarkdownViewer
|
||||||
showTOC={true}
|
showTOC={isTOCShow}
|
||||||
markdownContent={this.props.markdownContent}
|
markdownContent={this.props.markdownContent}
|
||||||
activeTitleIndex={this.state.activeTitleIndex}
|
activeTitleIndex={this.state.activeTitleIndex}
|
||||||
onContentRendered={this.onContentRendered}
|
onContentRendered={this.onContentRendered}
|
||||||
|
@@ -50,6 +50,10 @@
|
|||||||
font-size: 0.8125rem;
|
font-size: 0.8125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.heading-icon .action-icon {
|
||||||
|
font-size: 1.125rem;
|
||||||
|
}
|
||||||
|
|
||||||
/*tree view */
|
/*tree view */
|
||||||
.tree-view {
|
.tree-view {
|
||||||
padding: 0 12px 0 0;
|
padding: 0 12px 0 0;
|
||||||
@@ -65,6 +69,7 @@
|
|||||||
|
|
||||||
.tree-node-inner-hover {
|
.tree-node-inner-hover {
|
||||||
background-color: rgb(255,239,178);
|
background-color: rgb(255,239,178);
|
||||||
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-node-inner .tree-node-text {
|
.tree-node-inner .tree-node-text {
|
||||||
@@ -79,7 +84,6 @@
|
|||||||
.tree-node-inner .left-icon {
|
.tree-node-inner .left-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display:flex;
|
display:flex;
|
||||||
justify-content:center;
|
|
||||||
align-items:center;
|
align-items:center;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -107,7 +111,7 @@
|
|||||||
.tree-node-inner .right-icon {
|
.tree-node-inner .right-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 1rem;
|
right: 0.5rem;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 1.5rem;
|
width: 1.5rem;
|
||||||
color: #888;
|
color: #888;
|
||||||
@@ -151,6 +155,30 @@
|
|||||||
font-size: 0.9375rem;
|
font-size: 0.9375rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* todo optimized */
|
||||||
|
.cur-view-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cur-view-content .wiki-page-container{
|
||||||
|
margin: -0.625rem -1rem -1.25rem;
|
||||||
|
padding: 0.625rem 1rem 1.25rem;
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cur-view-content .wiki-page-content {
|
||||||
|
/* width: calc(100% - 160px); */
|
||||||
|
flex: 1;
|
||||||
|
padding-right: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dir-main-content .wiki-page-content .article {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.dir-main-content .wiki-page-content .ml-2 {
|
.dir-main-content .wiki-page-content .ml-2 {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
@@ -160,9 +188,57 @@
|
|||||||
color:#eb8205;
|
color:#eb8205;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* todo optimized */
|
.wiki-page-content a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wiki-side-nav .wiki-page-content a {
|
||||||
|
color: #212529;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wiki-page-ops {
|
||||||
|
position: fixed;
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.wiki-page-ops:before {
|
||||||
|
content:'';
|
||||||
|
border-left:1px solid #ddd;
|
||||||
|
position:absolute;
|
||||||
|
top:3px;
|
||||||
|
left:-16px;
|
||||||
|
bottom:3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wiki-page-list-item {
|
||||||
|
word-break:break-all;
|
||||||
|
line-height:1.6;
|
||||||
|
margin:3px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wiki-page-link,
|
||||||
|
.wiki-page-link:hover {
|
||||||
|
font-size:1.15em;
|
||||||
|
font-weight:normal;
|
||||||
|
color:#444;
|
||||||
|
margin-left:5px;
|
||||||
|
}
|
||||||
|
|
||||||
#wiki-page-last-modified {
|
#wiki-page-last-modified {
|
||||||
padding: 40px 10px;
|
padding: 40px 10px;
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wiki-md-viewer-rendered-content.article h1 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index-edit {
|
||||||
|
position: absolute;
|
||||||
|
right: 0.25rem;
|
||||||
|
top: 0.25rem;
|
||||||
|
}
|
||||||
|
@@ -105,6 +105,7 @@
|
|||||||
|
|
||||||
.tree-node-inner-hover {
|
.tree-node-inner-hover {
|
||||||
background-color: rgb(255,239,178);
|
background-color: rgb(255,239,178);
|
||||||
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-node-inner .tree-node-text {
|
.tree-node-inner .tree-node-text {
|
||||||
|
@@ -32,7 +32,7 @@ class LibContentView extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
currentMode: cookie.load('seafile-view-mode'),
|
currentMode: cookie.load('seafile-view-mode') || 'list',
|
||||||
path: '',
|
path: '',
|
||||||
pathExist: true,
|
pathExist: true,
|
||||||
isViewFile: false,
|
isViewFile: false,
|
||||||
|
Reference in New Issue
Block a user