diff --git a/js/components/EditableStringList.js b/js/components/EditableStringList.js index 08bf284..2f0e84f 100644 --- a/js/components/EditableStringList.js +++ b/js/components/EditableStringList.js @@ -11,41 +11,42 @@ export default class EditableStringList extends React.Component { constructor(props) { super(props); this.state = { - entries: props.entries + teams: props.teams, + groups: props.groups }; this.add = this.add.bind(this); this.remove = this.remove.bind(this); } add(text) { - if (text === '' || this.state.entries.includes(text)) { + if (text === '' || this.props.teams.includes(text)) { return false; } - this.state.entries.push(text); - this.setState({entries: this.state.entries}); - this.props.onChange(this.state.entries); + this.props.teams.push(text); + this.setState({teams: this.state.teams}); + this.props.onTeamsChange(this.state.teams); return true; } remove(text) { - let tmp = this.state.entries.filter(item => item !== text); - this.setState({entries: tmp}); - this.props.onChange(tmp); + let tmp = this.state.teams.filter(item => item !== text); + this.setState({teams: tmp}); + this.props.onTeamsChange(tmp); } render() { - if ((typeof this.state.entries !== 'undefined') && this.state.entries.length > 0) { + if ((typeof this.state.teams !== 'undefined') && this.state.teams.length > 0) { return (