Merge pull request #472 from DrianHillman/add-context-to-new-buttons

adds context to new list item button
This commit is contained in:
Shawn Erquhart 2017-07-03 23:58:33 -04:00 committed by GitHub
commit cdf7c3a2be
2 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@
.addButtonText {
margin-left: 4px;
text-transform: lowercase;
}
.removeButton {

View File

@ -170,12 +170,14 @@ export default class ListControl extends Component {
}
renderListControl() {
const { value, forID } = this.props;
const { value, forID, field } = this.props;
const listLabel = field.get('label');
return (<div id={forID}>
{value && value.map((item, index) => this.renderItem(item, index))}
<button className={styles.addButton} onClick={this.handleAdd}>
<FontIcon value="add" className={styles.addButtonIcon} />
<span className={styles.addButtonText}>new</span>
<span className={styles.addButtonText}>new {listLabel}</span>
</button>
</div>);
}