|
@@ -8,38 +8,38 @@ const { checkTemplatePath } = templateChecker;
|
|
|
export class PageListMeta extends React.Component {
|
|
export class PageListMeta extends React.Component {
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
- const { pageData, pageMeta } = this.props;
|
|
|
|
|
|
|
+ const { page } = this.props;
|
|
|
|
|
|
|
|
// top check
|
|
// top check
|
|
|
let topLabel;
|
|
let topLabel;
|
|
|
- if (isTopPage(pageData.path)) {
|
|
|
|
|
|
|
+ if (isTopPage(page.path)) {
|
|
|
topLabel = <span className="badge badge-info">TOP</span>;
|
|
topLabel = <span className="badge badge-info">TOP</span>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// template check
|
|
// template check
|
|
|
let templateLabel;
|
|
let templateLabel;
|
|
|
- if (checkTemplatePath(pageData.path)) {
|
|
|
|
|
|
|
+ if (checkTemplatePath(page.path)) {
|
|
|
templateLabel = <span className="badge badge-info">TMPL</span>;
|
|
templateLabel = <span className="badge badge-info">TMPL</span>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let commentCount;
|
|
let commentCount;
|
|
|
- if (pageData.commentCount > 0) {
|
|
|
|
|
- commentCount = <span><i className="icon-bubble" />{pageData.commentCount}</span>;
|
|
|
|
|
|
|
+ if (page.commentCount > 0) {
|
|
|
|
|
+ commentCount = <span><i className="icon-bubble" />{page.commentCount}</span>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let likerCount;
|
|
let likerCount;
|
|
|
- if (pageData.liker.length > 0) {
|
|
|
|
|
- likerCount = <span><i className="icon-like" />{pageData.liker.length}</span>;
|
|
|
|
|
|
|
+ if (page.liker.length > 0) {
|
|
|
|
|
+ likerCount = <span><i className="icon-like" />{page.liker.length}</span>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let locked;
|
|
let locked;
|
|
|
- if (pageData.grant !== 1) {
|
|
|
|
|
|
|
+ if (page.grant !== 1) {
|
|
|
locked = <span><i className="icon-lock" /></span>;
|
|
locked = <span><i className="icon-lock" /></span>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let bookmarkCount;
|
|
let bookmarkCount;
|
|
|
- if (pageMeta.bookmarkCount > 0) {
|
|
|
|
|
- bookmarkCount = <span><i className="icon-star" />{pageMeta.bookmarkCount}</span>;
|
|
|
|
|
|
|
+ if (this.props.bookmarkCount > 0) {
|
|
|
|
|
+ bookmarkCount = <span><i className="icon-star" />{this.props.bookmarkCount}</span>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -58,8 +58,8 @@ export class PageListMeta extends React.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
PageListMeta.propTypes = {
|
|
PageListMeta.propTypes = {
|
|
|
- pageData: PropTypes.object.isRequired,
|
|
|
|
|
- pageMeta: PropTypes.object.isRequired,
|
|
|
|
|
|
|
+ page: PropTypes.object.isRequired,
|
|
|
|
|
+ bookmarkCount: PropTypes.number,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
PageListMeta.defaultProps = {
|
|
PageListMeta.defaultProps = {
|