import React from 'react'; import { Button, Card, CardBody, Collapse, Table } from 'reactstrap'; import { rangedmap } from '../utils/rangedmap'; import { findTeam } from '../utils/findTeam'; import { Order, sort } from '../utils/sort'; export class StandingsTable extends React.Component { constructor(props) { super(props); this.state = { showFullTable: false }; this.toggleShowFullTable = this.toggleShowFullTable.bind(this); } render() { let performances = this.props.data.group_phase_performances; /** * comparison(p1, p2) < 0 => p1 < p2 * comparison(p1, p2) = 0 => p1 = p2 * comparison(p1, p2) > 0 => p1 > p2 */ let sortedPerformances = sort(performances, (p1, p2) => p1.rank - p2.rank, Order.descending); return (

Aktuelle Rangliste

{ rangedmap(sortedPerformances, (team, index) => ( ), 0, 3) } { rangedmap(sortedPerformances, (team, index) => ( ), 3) }
# Team Name Match Differenz Punkt Differenz
); } toggleShowFullTable() { this.setState({ showFullTable: !this.state.showFullTable }); } } class TeamRow extends React.Component { constructor(props) { super(props); } render() { return ( { this.props.teamToShow.rank } {findTeam(this.props.teams, this.props.teamToShow.team).name} { this.props.teamToShow.win_loss_differential } { this.props.teamToShow.point_differential } ); } } class TableButton extends React.Component { render() { const { isFullTableShown } = this.props; if(isFullTableShown) { return ; } else { return ; } } }