mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-10 19:29:56 +00:00
* add All wikis optimize * update * optimize * select wiki info by sql * optimize publish wiki * update * optimize ui * update * Update repos.js * optimize varname * Update wiki-card-item.js --------- Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com> Co-authored-by: r350178982 <32759763+r350178982@users.noreply.github.com>
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Link } from '@gatsbyjs/reach-router';
|
|
import { siteRoot, gettext } from '../../../utils/constants';
|
|
|
|
const propTypes = {
|
|
currentItem: PropTypes.string.isRequired
|
|
};
|
|
|
|
class Nav extends React.Component {
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
this.navItems = [
|
|
{ name: 'all', urlPart: 'all-libraries', text: gettext('All') },
|
|
{ name: 'wikis', urlPart: 'all-wikis', text: gettext('Wikis') },
|
|
{ name: 'system', urlPart: 'system-library', text: gettext('System') },
|
|
{ name: 'trash', urlPart: 'trash-libraries', text: gettext('Trash') }
|
|
];
|
|
}
|
|
|
|
render() {
|
|
const { currentItem } = this.props;
|
|
return (
|
|
<div className="cur-view-path tab-nav-container">
|
|
<ul className="nav">
|
|
{this.navItems.map((item, index) => {
|
|
return (
|
|
<li className="nav-item" key={index}>
|
|
<Link to={`${siteRoot}sys/${item.urlPart}/`} className={`nav-link${currentItem == item.name ? ' active' : ''}`}>{item.text}</Link>
|
|
</li>
|
|
);
|
|
})}
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
Nav.propTypes = propTypes;
|
|
|
|
export default Nav;
|