-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more servers and better error handling on UI
- Loading branch information
1 parent
ebd0708
commit 5f90a1c
Showing
5 changed files
with
59 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
|
||
export default ({ serverInfo }) => ( | ||
<> | ||
<header> | ||
<h2>{serverInfo.name}</h2> | ||
<p | ||
onCopy={() => { | ||
window._gaq.push(["_trackEvent", "copy ip", serverInfo.name]); | ||
}} | ||
> | ||
connect {serverInfo.connect} | ||
</p> | ||
<p> | ||
<strong>mapa: </strong> | ||
{serverInfo.map} | ||
</p> | ||
</header> | ||
|
||
{serverInfo.players.length === 0 && ( | ||
<p className="noPlayers"> | ||
<em>Nenhum jogador :(</em> | ||
</p> | ||
)} | ||
|
||
{serverInfo.players.length > 0 && ( | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>nickname</th> | ||
<th>score</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{serverInfo.players | ||
.sort(({ score: scoreA }, { score: scoreB }) => scoreB - scoreA) | ||
.map(({ name, score, time }) => ( | ||
<tr key={name + time}> | ||
<td>{name}</td> | ||
<td>{score}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
)} | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters