import {Button, Card, CardBody, Col, Collapse, Row, Table} from 'reactstrap'; import {Match} from './Match'; import React, {Component} from 'react'; import {getGroup} from '../redux/tournamentApi'; import {notify} from 'react-notify-toast'; export default class GroupStage extends Component { constructor(props) { super(props); this.state = {showMatches: this.props.showMatches}; this.toggleShowMatches = this.toggleShowMatches.bind(this); } toggleShowMatches() { this.setState({showMatches: !this.state.showMatches}); } render() { return (

Gruppenphase

{this.props.groups.map(group => )}
); } } function ShowMatchesToggleButton(props) { return (); } export class Group extends Component { constructor(props) { super(props); this.state = props.group; this.reload = this.reload.bind(this); this.onReloadSuccess = this.onReloadSuccess.bind(this); this.onReloadError = this.onReloadError.bind(this); } reload() { getGroup(this.state.id, this.onReloadSuccess, this.onReloadError); } onReloadSuccess(status, updatedGroup) { this.setState(updatedGroup); } onReloadError() { notify.show('Die Gruppe konnte nicht aktualisiert werden.', 'warning', 2000); } render() { return (

Gruppe {this.state.number}

{this.state.matches.map((match => ( )))}
); } } function GroupScoresTable(props) { return ( {props.scores.map(groupScore => )}
Team Pkt. Gew. Kas.
); } function GroupScoresTableRow(props) { return ( {props.score.team.name} {props.score.group_points} {props.score.scored_points} {props.score.received_points} ); }