initial commit, boilerplate stuff
This commit is contained in:
9
src/pages/RestrictedGuest.tsx
Normal file
9
src/pages/RestrictedGuest.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Navigate } from "react-router";
|
||||
|
||||
import { useAuth } from "../hooks/useAuth.ts";
|
||||
|
||||
export function RestrictedGuest({ children }: { children: React.ReactNode }) {
|
||||
const { user } = useAuth();
|
||||
|
||||
return user ? <Navigate to="/" /> : <>{children}</>;
|
||||
}
|
||||
Reference in New Issue
Block a user