Skip to content

Commit

Permalink
improve styling on watch page
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Oct 16, 2024
1 parent 95eef06 commit ab0a798
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 7 additions & 4 deletions app/watch/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ export default function GamePage() {
}

return (
<div className="container mx-auto min-h-screen flex flex-wrap justify-between pt-12 pb-24 gap-x-2 gap-y-8">
{results.map((result) => (
<Result key={result._id} result={result} />
))}
<div className="container mx-auto pt-12 pb-24 space-y-8">
<h1 className="text-2xl font-bold">Recent Games</h1>
<div className="flex flex-wrap justify-betweengap-x-2 gap-12">
{results.map((result) => (
<Result key={result._id} result={result} />
))}
</div>
</div>
);
}
11 changes: 8 additions & 3 deletions app/watch/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
import { ResultStatus } from "../result-status";
import { type ResultWithGame } from "@/convex/results";
import { Visualizer } from "../visualizer";
import { format } from "date-fns";

export default function Result({ result }: { result: ResultWithGame }) {
return (
<div className="flex flex-col gap-2 items-center">
<div className="flex gap-8 border rounded-xl p-4 bg-black">
{result.game !== null && (
<div className="flex gap-2">
<ResultStatus result={result} />
<div className="flex flex-col gap-2">
<div className="flex gap-2">
<ResultStatus result={result} />
<p>at {format(new Date(result._creationTime), "h:mma")}</p>
</div>
<p>Level {result.level}</p>
<p>{result.game.modelId}</p>
</div>
)}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"convex": "^1.16.0",
"date-fns": "^4.1.0",
"lucide-react": "^0.453.0",
"next": "14.2.5",
"next-themes": "^0.3.0",
Expand Down

0 comments on commit ab0a798

Please sign in to comment.