|
@@ -1,9 +1,10 @@
|
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
+import { withTranslation } from 'react-i18next';
|
|
|
import Pagination from 'react-bootstrap/lib/Pagination';
|
|
import Pagination from 'react-bootstrap/lib/Pagination';
|
|
|
|
|
|
|
|
-export default class TagsList extends React.Component {
|
|
|
|
|
|
|
+class TagsList extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
@@ -151,7 +152,8 @@ export default class TagsList extends React.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
- const tagList = this.generateTagList(this.state.tagData);
|
|
|
|
|
|
|
+ const { t } = this.props;
|
|
|
|
|
+ const messageForNoTag = this.state.tagData.length ? null : <h3>{ t('You have no tag, You can set tags on pages') }</h3>;
|
|
|
|
|
|
|
|
const paginationItems = [];
|
|
const paginationItems = [];
|
|
|
|
|
|
|
@@ -165,12 +167,18 @@ export default class TagsList extends React.Component {
|
|
|
paginationItems.push(paginations);
|
|
paginationItems.push(paginations);
|
|
|
const nextLastItems = this.generateNextLast(activePage, totalPage);
|
|
const nextLastItems = this.generateNextLast(activePage, totalPage);
|
|
|
paginationItems.push(nextLastItems);
|
|
paginationItems.push(nextLastItems);
|
|
|
|
|
+ const pagination = this.state.tagData.length ? <Pagination>{paginationItems}</Pagination> : null;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- <div>
|
|
|
|
|
- <ul className="list-group tags-list">{tagList}</ul>
|
|
|
|
|
- <div className="text-center">
|
|
|
|
|
- <Pagination>{paginationItems}</Pagination>
|
|
|
|
|
|
|
+ <div className="text-center">
|
|
|
|
|
+ <div className="tag-list">
|
|
|
|
|
+ <ul className="list-group text-left">
|
|
|
|
|
+ {this.generateTagList(this.state.tagData)}
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ {messageForNoTag}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className="tag-list-pagination">
|
|
|
|
|
+ {pagination}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
@@ -180,7 +188,10 @@ export default class TagsList extends React.Component {
|
|
|
|
|
|
|
|
TagsList.propTypes = {
|
|
TagsList.propTypes = {
|
|
|
crowi: PropTypes.object.isRequired,
|
|
crowi: PropTypes.object.isRequired,
|
|
|
|
|
+ t: PropTypes.func.isRequired, // i18next
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
TagsList.defaultProps = {
|
|
TagsList.defaultProps = {
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+export default withTranslation()(TagsList);
|