1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

change markdown preview dialog internal link (#6829)

This commit is contained in:
Michael An
2024-09-23 16:21:08 +08:00
committed by GitHub
parent 5e55cbd1fe
commit 9983d50e76
7 changed files with 16 additions and 17 deletions

View File

@@ -16,18 +16,18 @@
height: 48px;
}
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-left-name > span {
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-left-name img {
margin-right: 6px;
}
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool > span {
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool>span {
margin-left: 10px;
cursor: pointer;
color: #000;
opacity: 0.5;
}
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool > span:hover {
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool>span:hover {
opacity: 0.75;
}

View File

@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { Modal, ModalBody } from 'reactstrap';
import { mediaUrl } from '../../utils/constants';
import SeafileMarkdownViewer from '../seafile-markdown-viewer';
import InternalLinkOperation from '../operations/internal-link-operation';
import { Utils } from '../../utils/utils';
import './markdown-viewer-dialog.css';
@@ -22,6 +24,7 @@ const propTypes = {
class MarkdownViewerDialog extends React.Component {
render() {
const { repoID, filePath, fileName } = this.props;
return (
<Modal
isOpen={true}
@@ -33,7 +36,8 @@ class MarkdownViewerDialog extends React.Component {
<div className='seafile-markdown-viewer-modal-header'>
<div className='seafile-markdown-viewer-modal-header-left-name'>
<span><img src={`${mediaUrl}img/file/256/md.png`} width='24' alt='' /></span>
<span>{this.props.fileName}</span>
<span>{fileName}</span>
<InternalLinkOperation path={Utils.joinPath(filePath, fileName)} repoID={repoID} />
</div>
<div className='seafile-markdown-viewer-modal-header-right-tool'>
<span className='sf3-font sf3-font-open' onClick={this.props.openMarkdownFile}></span>
@@ -48,8 +52,8 @@ class MarkdownViewerDialog extends React.Component {
lastModified = {this.props.lastModified}
latestContributor={this.props.latestContributor}
onLinkClick={this.props.onLinkClick}
repoID={this.props.repoID}
path={this.props.filePath}
repoID={repoID}
path={filePath}
>
</SeafileMarkdownViewer>
</ModalBody>

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { isPro, gettext, mediaUrl, siteRoot } from '../../utils/constants';
import { InternalLinkOperation } from '../operations';
import InternalLinkOperation from '../operations/internal-link-operation';
const propTypes = {
toggleStar: PropTypes.func.isRequired,

View File

@@ -1,6 +0,0 @@
import InternalLinkOperation from './internal-link-operation';
import './style.css';
export {
InternalLinkOperation,
};

View File

@@ -1,5 +1,5 @@
.dialog-operation {
display: flex;
display: inline-flex;
align-items: center;
}

View File

@@ -1,7 +1,8 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../../utils/constants';
import InternalLinkDialog from '../../dialog/internal-link-dialog';
import { gettext } from '../../utils/constants';
import InternalLinkDialog from '../dialog/internal-link-dialog';
import './internal-link-operation.css';
const propTypes = {
repoID: PropTypes.string.isRequired,

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { gettext } from '../../../utils/constants';
import { InternalLinkOperation } from '../../../components/operations';
import InternalLinkOperation from '../../../components/operations/internal-link-operation';
const { repoID, filePath } = window.app.pageOptions;