Only use label_singular when one item is rendered in the listControl (#1422)
This commit is contained in:
parent
b47bb66a3b
commit
f365955478
@ -262,14 +262,15 @@ export default class ListControl extends Component {
|
||||
const { value, forID, field, classNameWrapper } = this.props;
|
||||
const { itemsCollapsed } = this.state;
|
||||
const items = value || List();
|
||||
const label = field.get('label_singular') || field.get('label');
|
||||
const label = field.get('label');
|
||||
const labelSingular = field.get('label_singular') || field.get('label');
|
||||
|
||||
return (
|
||||
<div id={forID} className={c(classNameWrapper, 'nc-listControl')}>
|
||||
<TopBar
|
||||
allowAdd={field.get('allow_add', true)}
|
||||
onAdd={this.handleAdd}
|
||||
listLabel={label.toLowerCase()}
|
||||
listLabel={items.size === 1 ? labelSingular.toLowerCase() : label.toLowerCase()}
|
||||
onCollapseAllToggle={this.handleCollapseAllToggle}
|
||||
allItemsCollapsed={itemsCollapsed.every(val => val === true)}
|
||||
itemsCount={items.size}
|
||||
|
Loading…
x
Reference in New Issue
Block a user