getting rid of files

This commit is contained in:
talksik
2022-03-17 11:02:08 -04:00
parent e631a47149
commit 4a6b4deec5
35 changed files with 0 additions and 863 deletions
@@ -1,22 +0,0 @@
import { Route, useNavigate } from "react-router-dom";
import { useGetUserDetails } from "../../controller/index";
export default function ProtectedRoute({ ...children }) {
const { isLoading, isError } = useGetUserDetails();
const navigate = useNavigate();
if (isLoading) return <span>please wait while we authenticate you</span>;
if (isError) {
// toast.error("Please sign in first!");
navigate("/login");
return <span>you are not allowed here!</span>;
}
// if we can successfully get user details, we are good to continue
return <>{children}</>;
}