diff --git a/app/components/guard.tsx b/app/components/guard.tsx
new file mode 100644
index 0000000..c85b6dd
--- /dev/null
+++ b/app/components/guard.tsx
@@ -0,0 +1,62 @@
+import type { PropsWithChildren } from "react";
+import { useNavigate } from "react-router";
+import { useAuth } from "~/hooks/auth";
+import { Button, Modal, Spinner } from "@heroui/react";
+
+export default function Guard({ children }: PropsWithChildren) {
+ const { user, loading, login, logout } = useAuth();
+ const navigate = useNavigate();
+
+ if (loading) {
+ return (
+
-
- {children}
+
+ {needsLogin ? {children} : children}
diff --git a/app/pages/gamemodes.tsx b/app/pages/gamemodes.tsx
index c39d7fa..b88193c 100644
--- a/app/pages/gamemodes.tsx
+++ b/app/pages/gamemodes.tsx
@@ -1,5 +1,5 @@
-import Base from "./base"
+import Base from "./base";
export function GamemodesPage() {
- return
GAMEMODES
-}
\ No newline at end of file
+ return
GAMEMODES;
+}
diff --git a/app/pages/inventory.tsx b/app/pages/inventory.tsx
index 2c7d63a..9f88ae1 100644
--- a/app/pages/inventory.tsx
+++ b/app/pages/inventory.tsx
@@ -1,5 +1,5 @@
-import Base from "./base"
+import Base from "./base";
export function InventoryPage() {
- return
INVENTORY
-}
\ No newline at end of file
+ return
INVENTORY;
+}
diff --git a/app/pages/maps.tsx b/app/pages/maps.tsx
index f34bf2c..b0879a8 100644
--- a/app/pages/maps.tsx
+++ b/app/pages/maps.tsx
@@ -1,5 +1,5 @@
import Base from "./base"
export function MapsPage() {
- return
MAPS
+ return
MAPS
}
\ No newline at end of file