user route for getting friendships

This commit is contained in:
Mikayla Dobson
2022-11-23 11:20:44 -06:00
parent d2d38bf7dd
commit d984ea64eb
15 changed files with 112 additions and 13 deletions

View File

@@ -3,9 +3,10 @@ import { useNavigate } from "react-router-dom";
import { Button, Page } from "../components/ui";
import Divider from "../components/ui/Divider";
import { AuthContext } from "../context/AuthContext";
import { ProtectPortal } from "./types";
export default function Protect({ children = <></> }) {
const { user } = useContext(AuthContext);
const Protect: ProtectPortal = ({ children = <></> }) => {
const { user } = useAuthContext();
const navigate = useNavigate();
if (!user) {
@@ -26,4 +27,6 @@ export default function Protect({ children = <></> }) {
</Page>
)
}
}
}
export default Protect;