Extract the findTeam-function
This commit is contained in:
parent
d557a21d90
commit
e07378ba92
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
export function findTeam(teams, id) {
|
||||||
|
for(let i = 0; i < teams.length; i++) {
|
||||||
|
if(teams[i].id === id) {
|
||||||
|
return teams[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,7 @@ import { TurniereNavigation } from '../js/components/Navigation';
|
||||||
import { TournamentInformationView } from '../js/components/TournamentInformationView';
|
import { TournamentInformationView } from '../js/components/TournamentInformationView';
|
||||||
import { BigImage } from '../js/components/BigImage';
|
import { BigImage } from '../js/components/BigImage';
|
||||||
import { Footer } from '../js/components/Footer';
|
import { Footer } from '../js/components/Footer';
|
||||||
|
import { findTeam } from '../js/utils/findTeam';
|
||||||
import { rangedmap } from '../js/utils/rangedmap';
|
import { rangedmap } from '../js/utils/rangedmap';
|
||||||
import { Order, sort } from '../js/utils/sort';
|
import { Order, sort } from '../js/utils/sort';
|
||||||
|
|
||||||
|
|
@ -43,16 +44,6 @@ class TeamRow extends React.Component {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function findTeam(teams, id) {
|
|
||||||
for(let i = 0; i < teams.length; i++) {
|
|
||||||
if(teams[i].id === id) {
|
|
||||||
return teams[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class DominanceShower extends React.Component {
|
class DominanceShower extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue