Skip to content

Commit

Permalink
Only use label_singular when one item is rendered in the listControl (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Karlsson authored and erquhart committed Jun 12, 2018
1 parent ed82020 commit 00de762
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/EditorWidgets/List/ListControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 00de762

Please sign in to comment.