2018-11-26 17:53:18 +08:00
|
|
|
import React from 'react';
|
2018-10-16 18:19:51 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2018-10-15 15:51:29 +08:00
|
|
|
import { siteRoot, gettext } from '../../utils/constants';
|
|
|
|
import { Link } from '@reach/router';
|
2018-09-15 16:14:17 +08:00
|
|
|
|
2018-10-16 18:19:51 +08:00
|
|
|
const propTypes = {
|
|
|
|
currentTab: PropTypes.string.isRequired,
|
|
|
|
children: PropTypes.oneOfType([
|
|
|
|
PropTypes.array,
|
|
|
|
PropTypes.object
|
|
|
|
]).isRequired,
|
2018-11-22 17:00:23 +08:00
|
|
|
tabItemClick: PropTypes.func.isRequired,
|
2018-10-16 18:19:51 +08:00
|
|
|
};
|
|
|
|
|
2018-09-21 14:16:15 +08:00
|
|
|
class DraftsView extends React.Component {
|
2018-09-15 16:14:17 +08:00
|
|
|
|
2018-10-15 15:51:29 +08:00
|
|
|
tabItemClick = (param) => {
|
2018-11-22 17:00:23 +08:00
|
|
|
this.props.tabItemClick(param);
|
2018-09-15 16:14:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2018-11-26 17:53:18 +08:00
|
|
|
<div className="main-panel-center">
|
|
|
|
<div className="cur-view-container">
|
2019-02-20 13:11:13 +08:00
|
|
|
<div className="cur-view-path draft-review-nav">
|
2018-12-06 11:28:16 +08:00
|
|
|
<ul className="nav">
|
|
|
|
<li className="nav-item" onClick={() => this.tabItemClick('drafts')}>
|
|
|
|
<Link className={`nav-link ${this.props.currentTab === 'drafts' ? 'active': ''}`} to={siteRoot + 'drafts/'} title={gettext('Drafts')}>{gettext('Drafts')}</Link>
|
2018-11-26 17:53:18 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
2018-11-26 14:00:32 +08:00
|
|
|
</div>
|
2018-11-26 17:53:18 +08:00
|
|
|
{this.props.children}
|
2018-11-26 14:00:32 +08:00
|
|
|
</div>
|
2018-11-26 17:53:18 +08:00
|
|
|
</div>
|
2018-09-15 16:14:17 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-16 18:19:51 +08:00
|
|
|
DraftsView.propTypes = propTypes;
|
|
|
|
|
2018-10-15 15:51:29 +08:00
|
|
|
export default DraftsView;
|