import React from 'react'; import {Button, Input, InputGroup, InputGroupAddon, Table} from 'reactstrap'; export function EditableMatchTable(props) { return (
{props.match.team1.name}
{props.match.team2.name}
); } class ScoreInput extends React.Component { constructor(props) { super(props); this.state = {score: this.props.score}; this.inputScore = this.inputScore.bind(this); this.increaseScore = this.increaseScore.bind(this); this.decreaseScore = this.decreaseScore.bind(this); } inputScore(event) { const newScore = event.target.value; this.setState({score: newScore}); this.props.update(newScore); } increaseScore() { const newScore = Number(this.state.score) + 1; this.setState({score: newScore}); this.props.update(newScore); } decreaseScore() { const newScore = Number(this.state.score) - 1; this.setState({score: newScore}); this.props.update(newScore); } render() { return ( ); } }