Extract the findTeam-function

This commit is contained in:
Jonny 2019-05-03 12:19:27 +02:00 committed by JP1998
parent d557a21d90
commit e07378ba92
2 changed files with 10 additions and 10 deletions

9
js/utils/findTeam.js Normal file
View File

@ -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;
}

View File

@ -19,6 +19,7 @@ import { TurniereNavigation } from '../js/components/Navigation';
import { TournamentInformationView } from '../js/components/TournamentInformationView';
import { BigImage } from '../js/components/BigImage';
import { Footer } from '../js/components/Footer';
import { findTeam } from '../js/utils/findTeam';
import { rangedmap } from '../js/utils/rangedmap';
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 {
render() {