Skip to content

Commit

Permalink
app routes room $roomName summary: add combined Coryat
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnord committed Aug 15, 2024
1 parent 0a76d8e commit 5aa56b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/routes/room.$roomName_.summary/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const coryats = sortedPlayers.map((player) =>
getCoryat(player.userId, state),
);
const combinedCoryat = coryats.reduce((acc, coryat) => acc + coryat, 0);

return json({
sortedPlayers,
coryats,
combinedCoryat,
game,
roomEvents,
roomId,
Expand Down Expand Up @@ -106,6 +108,10 @@ export default function PlayGame() {
))}
</div>
<h3 className="text-lg">Coryat Scores</h3>
<p>
<strong>Combined: </strong>
{formatDollars(data.combinedCoryat)}
</p>
<div className="flex flex-col gap-2 sm:grid sm:grid-cols-3">
{data.sortedPlayers.map((p, i) => (
<span>
Expand Down

0 comments on commit 5aa56b7

Please sign in to comment.