1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

fix file count

This commit is contained in:
Michael An
2019-04-22 12:07:45 +08:00
parent 6035d53b4c
commit 17744246c3

View File

@@ -46,14 +46,15 @@ class TagListItem extends React.Component {
render() {
let color = this.props.item.color;
let drakColor = Utils.getDarkColor(color);
const fileCount = this.props.item.fileCount;
let fileTranslation = (fileCount === 1 || fileCount === 0) ? gettext('file') : gettext('files');
return (
<li className="tag-list-item">
<div className="tag-demo" style={{backgroundColor:color}} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut}>
<span className={`${this.state.showSelectedTag ? 'show-tag-selected': ''}`} style={{backgroundColor: drakColor}}></span>
<span className="tag-name">{this.props.item.name}</span>
<span className="tag-files" onClick={this.onListTaggedFiles}>
{/* todo 0 file 2 files */}
{this.props.item.fileCount}{' '}{'files'}
{fileCount}{' '}{fileTranslation}
</span>
</div>
<i className="tag-edit fa fa-pencil-alt" onClick={this.onTagUpdate}></i>