Update WordHighScores.tsx
This commit is contained in:
parent
50ea7ce668
commit
395aaa1316
|
@ -1,42 +1,40 @@
|
|||
import * as React from "react";
|
||||
import { WordGameListItem } from "./WordService"
|
||||
import * as React from 'react';
|
||||
import { WordGameListItem } from './WordService';
|
||||
|
||||
export interface IWordHighScoresProps {
|
||||
scores: WordGameListItem[]
|
||||
scores: WordGameListItem[];
|
||||
}
|
||||
|
||||
export default class WordHighScores extends React.Component<IWordHighScoresProps, {}> {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public render(): React.ReactElement<IWordHighScoresProps> {
|
||||
let rank = 1;
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.props.scores.length>0 ?
|
||||
<h3 style={{ textDecoration: 'underline' }}>High Scores</h3> : ''
|
||||
|
||||
}
|
||||
<table style={{ marginLeft: 'Auto', marginRight: 'Auto' }}>
|
||||
<tbody>
|
||||
{
|
||||
this.props.scores.map(score => (
|
||||
<tr>
|
||||
<td><b>{rank++ + ') '}</b></td>
|
||||
<td><b>{score.Name} </b></td>
|
||||
<td><span style={{ marginLeft: '10px' }}>Score: {score.Score} </span></td>
|
||||
<td><span style={{ marginLeft: '10px' }}>Seconds: {score.Seconds}</span></td>
|
||||
</tr>
|
||||
))
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
public render(): React.ReactElement<IWordHighScoresProps> {
|
||||
let rank: number = 1;
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.props.scores.length > 0 ?
|
||||
<h3 style={{ textDecoration: 'underline' }}>High Scores</h3> : ''
|
||||
}
|
||||
<table style={{ marginLeft: 'Auto', marginRight: 'Auto' }}>
|
||||
<tbody>
|
||||
{
|
||||
this.props.scores.map(score => (
|
||||
<tr>
|
||||
<td><b>{rank++ + ') '}</b></td>
|
||||
<td><b>{score.Name} </b></td>
|
||||
<td><span style={{ marginLeft: '10px' }}>Score: {score.Score} </span></td>
|
||||
<td><span style={{ marginLeft: '10px' }}>Seconds: {score.Seconds}</span></td>
|
||||
</tr>
|
||||
))
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue