diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 6030fc68..5dcaeb9b 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -4,55 +4,55 @@ import kwoc_logo from "../assets/kwoc_logo.png"; import "../styles/Navbar.css"; import { ROUTER_PATHS, - // GH_OAUTH_URL, - // REGISTRATIONS_OPEN, + GH_OAUTH_URL, + REGISTRATIONS_OPEN, } from "../util/constants"; -// import { useAuthContext } from '../util/auth'; -// import { UserType } from '../util/types'; +import { useAuthContext } from '../util/auth'; +import { UserType } from '../util/types'; -// function LoginButton() { -// const authContext = useAuthContext(); +function LoginButton() { + const authContext = useAuthContext(); -// return ( -// <> -// {authContext.isAuthenticated ? ( -// -// -// -// ) : REGISTRATIONS_OPEN ? ( -// ["mentor", "student"].map((userType, i) => ( -// -// )) -// ) : ( -// -// LOGIN -// -// )} -// -// ); -// } + authContext.setUserType(userType as UserType); + window.location.href=GH_OAUTH_URL + }} + > + {userType.toUpperCase()} LOGIN + + )) + ) : ( + + LOGIN + + )} + + ); + } const Navbar = () => { const location = useLocation(); @@ -98,10 +98,8 @@ const Navbar = () => { ))} - {/* */} -

Registrations Coming Soon!

- - {/* */} + +

Register as Mentor

setIsOpen(!isOpen)}>{isOpen ? '✖' : '☰'}