Skip to content

Commit

Permalink
Tweak & customize auto-score entry layout further
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenAsJade committed Aug 20, 2024
1 parent 4dbec21 commit bf88915
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/views/Game/GameLog.styl
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
.timestamp {
width: 12rem;
}

.field {
margin-right: 1rem;
}

.auto-score {
themed background shade5;

a.Player, .game-log-player {
themed color shade1;
}
}
}
33 changes: 25 additions & 8 deletions src/views/Game/GameLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,27 @@ export function LogData({
try {
for (const k in data) {
if (k === "player_id") {
ret.push(
<span key={k} className="field">
<Player user={data[k]} />
{data.color ? (data.color === "black" ? " (black)" : " (white)") : ""}
</span>,
);
if ("needs_sealing" in data) {
// this is an auto-score update, make that clear.
ret.push(
<span key={k} className="field game-log-player">
{"(from "}
<Player user={data[k]} rank={false} />
{")"}
</span>,
);
} else {
ret.push(
<span key={k} className="field game-log-player">
<Player user={data[k]} />
{data.color
? data.color === "black"
? " (black)"
: " (white)"
: ""}
</span>,
);
}
} else if (k === "winner") {
ret.push(
<span key={k} className="field">
Expand All @@ -220,14 +235,16 @@ export function LogData({
);
}
} else if (k === "removed") {
ret.push(
// put this near the top
ret.unshift(
<span key={k} className="field">
{data[k] ? "stones marked dead" : "stones marked alive"}
</span>,
);
} else if (k === "needs_sealing") {
// this only comes with autoscore updates
ret.push(
// put it near the top
ret.unshift(
<span key={k} className="field">
{pgettext(
"This is telling a moderator that they are looking at an update from the auto scorer",
Expand Down

0 comments on commit bf88915

Please sign in to comment.