From 7da9a7547aed9a6a95af9fdc7efcd2a70611f546 Mon Sep 17 00:00:00 2001 From: Saga-sanga Date: Wed, 16 Oct 2024 14:12:39 +0530 Subject: [PATCH 1/2] feat: add theme toggle to header and set white background for light mode --- app/header.tsx | 20 +++++++++++++------- app/layout.tsx | 2 +- convex/openai.ts | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/header.tsx b/app/header.tsx index 2be764a..5267dd1 100644 --- a/app/header.tsx +++ b/app/header.tsx @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button"; import { useAuthActions } from "@convex-dev/auth/react"; import { GitHubLogoIcon } from "@radix-ui/react-icons"; import { useConvexAuth } from "convex/react"; +import { ThemeToggle } from "@/components/ThemeToggle"; function SignInWithGitHub() { const { signIn } = useAuthActions(); @@ -25,14 +26,16 @@ export default function Header() { const { isAuthenticated } = useConvexAuth(); return ( -
+
Logo SurviveTheNight
- Synced using Convex + + Synced using Convex +
- {!isAuthenticated ? ( - - ) : ( - - )} +
+ + {!isAuthenticated ? ( + + ) : ( + + )} +
); } diff --git a/app/layout.tsx b/app/layout.tsx index f221e13..06ff44d 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -29,7 +29,7 @@ export default function RootLayout({
- {children} +
{children}
diff --git a/convex/openai.ts b/convex/openai.ts index 066a8d8..1814db7 100644 --- a/convex/openai.ts +++ b/convex/openai.ts @@ -68,11 +68,11 @@ export const playMapAction = internalAction({ "R" represents rocks, which players can shoot over but zombies cannot pass through or break. "P" represents the player, who cannot move. The player's goal is to shoot and kill zombies before they reach them. "B" represents blocks that can be placed before the round begins to hinder the zombies. You can place up to two blocks on the map. - + Your goal is to place the player ("P") and two blocks ("B") in locations that maximize the player's survival by delaying the zombies' approach. You can shoot any zombie regardless of where it is on the grid. Returning a 2d grid with the player and blocks placed in the optimal locations, with the coordinates player ("P") and the blocks ("B"), also provide reasoning for the choices. - + You can't replace rocks R or zombies Z with blocks. If there is no room to place a block, do not place any.`, }, { From d71e0305d0b7adbd09a4f60d364ba0ec6415672f Mon Sep 17 00:00:00 2001 From: Saga-sanga Date: Wed, 16 Oct 2024 14:16:24 +0530 Subject: [PATCH 2/2] chore: invert github sign in button color in dark mode --- app/header.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/header.tsx b/app/header.tsx index 5267dd1..787bd43 100644 --- a/app/header.tsx +++ b/app/header.tsx @@ -15,6 +15,7 @@ function SignInWithGitHub() { variant="outline" type="button" onClick={() => void signIn("github", { redirectTo: "/" })} + className="dark:invert" > GitHub