1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

repair goto repo bug

This commit is contained in:
shanshuirenjia
2018-12-11 17:52:19 +08:00
parent 8efd8a45be
commit f1eb4c625f
7 changed files with 62 additions and 25 deletions

View File

@@ -1,9 +1,10 @@
import React from 'react';
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { siteRoot, gettext } from '../../utils/constants';
const propTypes = {
repoName: PropTypes.string.isRequired,
pathPrefix: PropTypes.object,
currentPath: PropTypes.string.isRequired,
onPathClick: PropTypes.func.isRequired,
};
@@ -43,10 +44,16 @@ class DirPath extends React.Component {
render() {
let { currentPath, repoName } = this.props;
let pathElem = this.turnPathToLink(currentPath);
let pathPrefix = this.props.pathPrefix !== undefined ? this.props.pathPrefix : false;
return (
<div className="path-containter">
<a href={siteRoot + 'my-libs/'} className="normal">{gettext('Libraries')}</a>
<span className="path-split">/</span>
{pathPrefix ?
pathPrefix :
<Fragment>
<a href={siteRoot + 'my-libs/'} className="normal">{gettext('Libraries')}</a>
<span className="path-split">/</span>
</Fragment>
}
{currentPath === '/' ?
<span>{repoName}</span>:
<a className="path-link" data-path="/" onClick={this.onPathClick}>{repoName}</a>