Skip to content

Commit

Permalink
Congratulations message on beating all levels
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Oct 22, 2024
1 parent 74fca81 commit 5baa778
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion app/play/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function PlayPage() {
return true;
});

if (!filteredMaps) {
if (filteredMaps === undefined) {
return (
<div className="container mx-auto min-h-screen gap-8 py-12 pb-24">
<h1 className="mb-6 text-center text-3xl font-bold">Choose a Night</h1>
Expand Down Expand Up @@ -125,6 +125,23 @@ export default function PlayPage() {
</ToggleGroup>
</Authenticated>

{filteredMaps.length === 0 && (
<div className="py-8">
<div className="flex flex-col items-center gap-4">
<div className="flex flex-col items-center gap-2 text-center">
<h2 className="text-xl/snug text-white">Congratulations!</h2>
<p className="text-base/snug text-white">
You completed all maps, consider creating and publishing your
own map.
</p>
</div>
<Button asChild variant="outline">
<Link href="/playground">Create Map</Link>
</Button>
</div>
</div>
)}

<div className="grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-3">
{filteredMaps.map((map) => (
<Card
Expand Down

0 comments on commit 5baa778

Please sign in to comment.