From 41b05e446dde63de5865d393b36a712daab66805 Mon Sep 17 00:00:00 2001 From: Jonny Date: Tue, 23 Apr 2019 14:18:30 +0200 Subject: [PATCH] Add first prototype for the table view --- pages/tournament-statistics.js | 88 +++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 6 deletions(-) diff --git a/pages/tournament-statistics.js b/pages/tournament-statistics.js index 262dbab..3475daa 100644 --- a/pages/tournament-statistics.js +++ b/pages/tournament-statistics.js @@ -1,6 +1,72 @@ import Head from 'next/head'; import React from 'react'; import { connect } from 'react-redux'; +import { + Card, + CardBody, + Container, + Table +} from 'reactstrap'; + +import { TurniereNavigation } from '../js/components/Navigation'; +import { BigImage } from '../js/components/BigImage'; +import { Footer } from '../js/components/Footer'; + + +class TeamRow extends React.Component { + constructor(props) { + super(props); + } + + render() { + return ( + + {this.findTeam(this.props.teams, this.props.teamToShow.team).name} + { this.props.teamToShow.winlossdifferential } + { this.props.teamToShow.pointDifferential } + + ); + } + + + findTeam(teams, id) { + for(let i = 0; i < teams.length; i++) { + if(teams[i].id === id) { + return teams[i]; + } + } + return null; + } +} + +class StatisticsComponent extends React.Component { + + constructor(props) { + super(props); + } + + render() { + return ( + + +

Turnier-Statistiken für {this.props.data.tournament.name}

+ + + + + + + + { this.props.data.groupPhasePerformances.map((team, index) => ( + + )) } + +
Team NameMatch DifferenzPunkt Differenz
+
+
+ ); + } +} class StatisticsTournamentPage extends React.Component { @@ -165,18 +231,28 @@ class StatisticsTournamentPage extends React.Component { team: 0x1247 // Guangzhou Charge } ], - playoffPerformances: [ - ] - + mostDominantTeam: { + id: 0x1234, + pointsMade: 94, + pointsReceived: 3 + }, + leastDominantTeam: { + id: 0x1240, + pointsMade: 2, + pointsReceived: 103 + } }; return (
- Turnie.re - Turnieranzeige (Statistiken) + {tournamentStatistics.tournament.name}: turnie.re -

Turnieranzeige (Statistiken)

-

Code: {this.props.query.code}

+ + + + +
); }