Merge pull request #15 from turniere/ticket/TURNIERE-138
Ticket/turniere 138
This commit is contained in:
commit
4490cd0774
|
|
@ -15,7 +15,7 @@ $ git clone https://github.com/turniere/turniere-frontend.git
|
||||||
Afterwards you'll have to install the used libraries using following command:
|
Afterwards you'll have to install the used libraries using following command:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn install
|
$ yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards you may simply run the developer version of the project:
|
Afterwards you may simply run the developer version of the project:
|
||||||
|
|
|
||||||
|
|
@ -31,14 +31,9 @@ class LoginErrorList extends React.Component {
|
||||||
const { error, errorMessages } = this.props;
|
const { error, errorMessages } = this.props;
|
||||||
if(error) {
|
if(error) {
|
||||||
return (
|
return (
|
||||||
<ul>
|
<ul className='text-danger mt-3'>
|
||||||
{ errorMessages.map((message, index) =>
|
{ errorMessages.map((message, index) =>
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<style jsx>{`
|
|
||||||
li {
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
{message}
|
{message}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -226,9 +226,9 @@ class CreateTournamentForm extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
createTeamArray(teamnames) {
|
createTeamArray(teamnames) {
|
||||||
var result = [];
|
let result = [];
|
||||||
|
|
||||||
for(var i = 0; i < teamnames.length; i++) {
|
for(let i = 0; i < teamnames.length; i++) {
|
||||||
result[i] = { 'name': teamnames[i] };
|
result[i] = { 'name': teamnames[i] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,17 +69,11 @@ class RegisterErrorList extends React.Component {
|
||||||
const { error, errorMessages } = this.props;
|
const { error, errorMessages } = this.props;
|
||||||
if(error) {
|
if(error) {
|
||||||
return (
|
return (
|
||||||
<ul>
|
<ul className='text-danger mt-3'>
|
||||||
{ errorMessages.map((message, index) =>
|
{ errorMessages.map((message, index) =>
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<style jsx>{`
|
|
||||||
li {
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
{message}
|
{message}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
) }
|
) }
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ class EditTeamNamesForm extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleNameInput(index, input) {
|
handleNameInput(index, input) {
|
||||||
var team = this.state.teams.slice();
|
let team = this.state.teams.slice();
|
||||||
|
|
||||||
team[index].name = input.target.value;
|
team[index].name = input.target.value;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class PrivateTournamentPage extends React.Component {
|
||||||
</Container>
|
</Container>
|
||||||
<div className='stages pt-5'>
|
<div className='stages pt-5'>
|
||||||
{playoffStages.map(stage =>
|
{playoffStages.map(stage =>
|
||||||
<Stage isSignedIn={isSignedIn} isOwner={username == ownerUsername} level={getLevelName(stage.level)} matches={stage.matches} key={stage.level}/>)}
|
<Stage isSignedIn={isSignedIn} isOwner={username === ownerUsername} level={getLevelName(stage.level)} matches={stage.matches} key={stage.level}/>)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -363,17 +363,17 @@ function convertGroup(apiGroup) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertMatch(apiMatch) {
|
function convertMatch(apiMatch) {
|
||||||
var result = {
|
let result = {
|
||||||
id: apiMatch.id,
|
id: apiMatch.id,
|
||||||
state: apiMatch.state
|
state: apiMatch.state
|
||||||
};
|
};
|
||||||
|
|
||||||
if(apiMatch.match_scores.length == 2) {
|
if(apiMatch.match_scores.length === 2) {
|
||||||
result.team1 = apiMatch.match_scores[0].team.name;
|
result.team1 = apiMatch.match_scores[0].team.name;
|
||||||
result.scoreTeam1 = apiMatch.match_scores[0].points;
|
result.scoreTeam1 = apiMatch.match_scores[0].points;
|
||||||
result.team2 = apiMatch.match_scores[1].team.name;
|
result.team2 = apiMatch.match_scores[1].team.name;
|
||||||
result.scoreTeam2 = apiMatch.match_scores[1].points;
|
result.scoreTeam2 = apiMatch.match_scores[1].points;
|
||||||
} else if(apiMatch.match_scores.length == 1) {
|
} else if(apiMatch.match_scores.length === 1) {
|
||||||
result.team1 = apiMatch.match_scores[0].team.name;
|
result.team1 = apiMatch.match_scores[0].team.name;
|
||||||
result.scoreTeam1 = apiMatch.match_scores[0].points;
|
result.scoreTeam1 = apiMatch.match_scores[0].points;
|
||||||
result.team2 = 'TBD';
|
result.team2 = 'TBD';
|
||||||
|
|
@ -424,7 +424,7 @@ class Main extends React.Component {
|
||||||
|
|
||||||
const { status, tournament } = this.state;
|
const { status, tournament } = this.state;
|
||||||
|
|
||||||
if (status == 200) {
|
if (status === 200) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head>
|
<Head>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue