Skip to content

Commit

Permalink
hide Login
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-jain52 committed Nov 15, 2024
1 parent 159fbf9 commit 090c48f
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<Link
to={
authContext.isRegistered
? authContext.dashboardLink
: authContext.formLink
}
>
<img
className="profile-picture-navbar"
src={`https://github.com/${authContext.userData.username}.png`}
/>
</Link>
) : REGISTRATIONS_OPEN ? (
["mentor", "student"].map((userType, i) => (
<button
className='reg-button'
key={i}
onClick={(e) => {
e.preventDefault();
// return (
// <>
// {authContext.isAuthenticated ? (
// <Link
// to={
// authContext.isRegistered
// ? authContext.dashboardLink
// : authContext.formLink
// }
// >
// <img
// className="profile-picture-navbar"
// src={`https://github.com/${authContext.userData.username}.png`}
// />
// </Link>
// ) : REGISTRATIONS_OPEN ? (
// ["mentor", "student"].map((userType, i) => (
// <button
// className='reg-button'
// key={i}
// onClick={(e) => {
// e.preventDefault();

authContext.setUserType(userType as UserType);
window.location.href=GH_OAUTH_URL
}}
>
{userType.toUpperCase()} LOGIN
</button>
))
) : (
<Link
to={GH_OAUTH_URL}
>
LOGIN
</Link>
)}
</>
);
}
// authContext.setUserType(userType as UserType);
// window.location.href=GH_OAUTH_URL
// }}
// >
// {userType.toUpperCase()} LOGIN
// </button>
// ))
// ) : (
// <Link
// to={GH_OAUTH_URL}
// >
// LOGIN
// </Link>
// )}
// </>
// );
// }

const Navbar = () => {
const location = useLocation();
Expand Down Expand Up @@ -98,7 +98,7 @@ const Navbar = () => {
</li>
))}

<LoginButton />
{/* <LoginButton /> */}
<p>Registrations Coming Soon!</p>

{/* <button className='reg-button'>Registration Opens Soon!</button> */}
Expand Down

0 comments on commit 090c48f

Please sign in to comment.