From 2ea9668f3820a7944f38679960741382e79b2576 Mon Sep 17 00:00:00 2001 From: Jonny Date: Fri, 3 May 2019 13:07:17 +0200 Subject: [PATCH] Extract the dominance shower view --- js/components/DominanceShower.js | 37 ++++++++++++++++++++++++++++++++ pages/tournament-statistics.js | 36 ++----------------------------- 2 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 js/components/DominanceShower.js diff --git a/js/components/DominanceShower.js b/js/components/DominanceShower.js new file mode 100644 index 0000000..4abcc58 --- /dev/null +++ b/js/components/DominanceShower.js @@ -0,0 +1,37 @@ +import React from 'react'; +import { + Card, + CardBody, + CardTitle, + Table +} from 'reactstrap'; + +import { findTeam } from '../utils/findTeam'; + +export class DominanceShower extends React.Component { + + render() { + return ( + + + {this.props.title} + + + + + + + + + + + + + + +
{findTeam(this.props.teams, this.props.stats.id).name}
{this.props.stats.pointsMade}{this.props.stats.pointsReceived}
Punkte erzieltPunkte kassiert
+
+
+ ); + } +} diff --git a/pages/tournament-statistics.js b/pages/tournament-statistics.js index e65710c..43b776d 100644 --- a/pages/tournament-statistics.js +++ b/pages/tournament-statistics.js @@ -2,49 +2,17 @@ import Head from 'next/head'; import React from 'react'; import { connect } from 'react-redux'; import { - Card, - CardBody, - CardTitle, Col, Container, - Row, - Table + Row } from 'reactstrap'; import { TurniereNavigation } from '../js/components/Navigation'; import { TournamentInformationView } from '../js/components/TournamentInformationView'; import { BigImage } from '../js/components/BigImage'; import { StandingsTable } from '../js/components/StandingsTable'; +import { DominanceShower } from '../js/components/DominanceShower'; import { Footer } from '../js/components/Footer'; -import { findTeam } from '../js/utils/findTeam'; - -class DominanceShower extends React.Component { - - render() { - return ( - - - {this.props.title} - - - - - - - - - - - - - - -
{findTeam(this.props.teams, this.props.stats.id).name}
{this.props.stats.pointsMade}{this.props.stats.pointsReceived}
Punkte erzieltPunkte kassiert
-
-
- ); - } -} class StatisticsTournamentPage extends React.Component {