Skip to content

Commit

Permalink
Remove authenticated wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Oct 20, 2024
1 parent 4569c95 commit 27e98bd
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions app/play/[level]/[attempt]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import React from "react";
import * as React from "react";
import { ChevronLeftIcon } from "@radix-ui/react-icons";
import { Authenticated, useQuery } from "convex/react";
import { useQuery } from "convex/react";
import Link from "next/link";
import { Visualizer } from "@/components/Visualizer";
import { Button } from "@/components/ui/button";
Expand All @@ -28,34 +28,27 @@ export default function PlayLevelAttemptPage({
}

return (
<Authenticated>
<div className="container mx-auto flex min-h-screen flex-col items-center gap-8 py-12 pb-24">
<div className="flex w-full items-center justify-between">
<Button variant="outline" asChild className="flex items-center gap-2">
<Link href={`/play/${level}`}>
<ChevronLeftIcon /> Back To Night #{level}
</Link>
</Button>
</div>
<h1 className="text-center text-3xl font-bold">Night #{level}</h1>
<h2 className="mb-4 text-xl font-semibold">Attempt #{attemptNum}</h2>
<div className="container mx-auto flex min-h-screen flex-col items-center gap-8 py-12 pb-24">
<div className="flex w-full items-center justify-between">
<Button variant="outline" asChild className="flex items-center gap-2">
<Link href={`/play/${level}`}>
<ChevronLeftIcon /> Back To Night #{level}
</Link>
</Button>
</div>
<h1 className="text-center text-3xl font-bold">Night #{level}</h1>
<h2 className="mb-4 text-xl font-semibold">Attempt #{attemptNum}</h2>

<div className="flex flex-col items-center gap-y-2">
<Visualizer
autoReplay
autoStart
controls={false}
map={attempt.grid}
/>
<div
className={`mt-4 text-xl font-semibold ${
attempt.didWin ? "text-green-500" : "text-red-500"
}`}
>
{attempt.didWin ? "You Survived!" : "You Died!"}
</div>
<div className="flex flex-col items-center gap-y-2">
<Visualizer autoReplay autoStart controls={false} map={attempt.grid} />
<div
className={`mt-4 text-xl font-semibold ${
attempt.didWin ? "text-green-500" : "text-red-500"
}`}
>
{attempt.didWin ? "You Survived!" : "You Died!"}
</div>
</div>
</Authenticated>
</div>
);
}

0 comments on commit 27e98bd

Please sign in to comment.