mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
fix tab highlight (#2551)
This commit is contained in:
@@ -2,11 +2,17 @@ import React from 'react';
|
||||
import { siteRoot, gettext } from '../../utils/constants';
|
||||
import editUtilties from '../../utils/editor-utilties';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import PropTypes from 'prop-types';
|
||||
import Toast from '../../components/toast';
|
||||
import Loading from '../../components/loading';
|
||||
import DraftListView from '../../components/draft-list-view/draft-list-view';
|
||||
import DraftListMenu from '../../components/draft-list-view/draft-list-menu';
|
||||
|
||||
const propTypes = {
|
||||
updateDraftsList: PropTypes.func.isRequired,
|
||||
isLoadingDraft: PropTypes.bool.isRequired,
|
||||
draftList: PropTypes.arrayOf(PropTypes.object),
|
||||
};
|
||||
|
||||
class DraftContent extends React.Component {
|
||||
|
||||
@@ -131,4 +137,6 @@ class DraftContent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
DraftContent.propTypes = propTypes;
|
||||
|
||||
export default DraftContent;
|
||||
|
@@ -9,21 +9,13 @@ const propTypes = {
|
||||
PropTypes.array,
|
||||
PropTypes.object
|
||||
]).isRequired,
|
||||
tabItemClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class DraftsView extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
currentTab: this.props.currentTab
|
||||
};
|
||||
}
|
||||
|
||||
tabItemClick = (param) => {
|
||||
this.setState({
|
||||
currentTab: param
|
||||
});
|
||||
this.props.tabItemClick(param);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -31,13 +23,13 @@ class DraftsView extends React.Component {
|
||||
<div className="cur-view-container">
|
||||
<div className="cur-view-path">
|
||||
<ul className="tab-tabs-nav">
|
||||
<li className={`tab ${this.state.currentTab === 'drafts' ? 'ui-state-active': ''}`} onClick={() => this.tabItemClick('drafts')}>
|
||||
<Link className='a' to={siteRoot + 'drafts'} title={gettext('Drafts')}>
|
||||
<li className={`tab ${this.props.currentTab === 'drafts' ? 'ui-state-active': ''}`} onClick={() => this.tabItemClick('drafts')}>
|
||||
<Link className='a' to={siteRoot + 'drafts/'} title={gettext('Drafts')}>
|
||||
{gettext('Drafts')}
|
||||
</Link>
|
||||
</li>
|
||||
<li className={`tab ${this.state.currentTab === 'reviews' ? 'ui-state-active': ''}`} onClick={() => this.tabItemClick('reviews')}>
|
||||
<Link className='a' to={siteRoot + 'drafts/reviews'} title={gettext('reviews')}>
|
||||
<li className={`tab ${this.props.currentTab === 'reviews' ? 'ui-state-active': ''}`} onClick={() => this.tabItemClick('reviews')}>
|
||||
<Link className='a' to={siteRoot + 'drafts/reviews/'} title={gettext('reviews')}>
|
||||
{gettext('Reviews')}
|
||||
</Link>
|
||||
</li>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import Loading from '../../components/loading';
|
||||
import ReviewListView from '../../components/review-list-view/review-list-view';
|
||||
@@ -22,7 +21,7 @@ class ReviewContent extends React.Component {
|
||||
}
|
||||
|
||||
getReviewList = (reviewStatus) => {
|
||||
this.setState({isLoadingReviews: true})
|
||||
this.setState({isLoadingReviews: true});
|
||||
seafileAPI.listReviews(reviewStatus).then(res => {
|
||||
this.setState({
|
||||
reviewsList: res.data.data,
|
||||
|
Reference in New Issue
Block a user