diff --git a/apps/portal/src/components/global/AppShell.tsx b/apps/portal/src/components/global/AppShell.tsx index 3c36e0d9..a0a44b84 100644 --- a/apps/portal/src/components/global/AppShell.tsx +++ b/apps/portal/src/components/global/AppShell.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import Link from 'next/link'; import { useRouter } from 'next/router'; -import { signIn, signOut, useSession } from 'next-auth/react'; +import { signOut, useSession } from 'next-auth/react'; import type { ReactNode } from 'react'; import { Fragment, useState } from 'react'; import { Menu, Transition } from '@headlessui/react'; @@ -19,12 +19,14 @@ import GoogleAnalytics from './GoogleAnalytics'; import MobileNavigation from './MobileNavigation'; import type { ProductNavigationItems } from './ProductNavigation'; import ProductNavigation from './ProductNavigation'; +import loginPageHref from '../shared/loginPageHref'; type Props = Readonly<{ children: ReactNode; }>; function ProfileJewel() { + const router = useRouter(); const { data: session, status } = useSession(); const isSessionLoading = status === 'loading'; @@ -32,25 +34,20 @@ function ProfileJewel() { return null; } + const loginHref = loginPageHref(); if (session == null) { - return ( - { - event.preventDefault(); - signIn(); - }}> - Sign in + return router.pathname !== loginHref.pathname ? ( + + Log In - ); + ) : null; } const userNavigation = [ { href: '/profile', name: 'Profile' }, { href: '/api/auth/signout', - name: 'Sign out', + name: 'Log out', onClick: (event: MouseEvent) => { event.preventDefault(); signOut(); diff --git a/apps/portal/src/components/global/HomeNavigation.ts b/apps/portal/src/components/global/HomeNavigation.ts index 96739432..d9316ee3 100644 --- a/apps/portal/src/components/global/HomeNavigation.ts +++ b/apps/portal/src/components/global/HomeNavigation.ts @@ -1,22 +1,21 @@ -import type { ProductNavigationItems } from '~/components/global/ProductNavigation'; - -const navigation: ProductNavigationItems = [ - { href: '/offers', name: 'Offers' }, - { href: '/questions', name: 'Question Bank' }, - { - children: [ - { href: '/resumes', name: 'View Resumes' }, - { href: '/resumes/submit', name: 'Submit Resume' }, - ], - href: '#', - name: 'Resumes', - }, -]; +// Not using this for now. +// const navigation: ProductNavigationItems = [ +// { href: '/offers', name: 'Offers' }, +// { href: '/questions', name: 'Question Bank' }, +// { +// children: [ +// { href: '/resumes', name: 'View Resumes' }, +// { href: '/resumes/submit', name: 'Submit Resume' }, +// ], +// href: '#', +// name: 'Resumes', +// }, +// ]; const config = { googleAnalyticsMeasurementID: 'G-DBLZDQ2ZZN', - navigation, - showGlobalNav: true, + navigation: [], + showGlobalNav: false, title: 'Tech Interview Handbook', titleHref: '/', }; diff --git a/apps/portal/src/components/offers/profile/ProfileComments.tsx b/apps/portal/src/components/offers/profile/ProfileComments.tsx index 70e388c7..44181afa 100644 --- a/apps/portal/src/components/offers/profile/ProfileComments.tsx +++ b/apps/portal/src/components/offers/profile/ProfileComments.tsx @@ -12,6 +12,7 @@ import { import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import ExpandableCommentCard from '~/components/offers/profile/comments/ExpandableCommentCard'; import Tooltip from '~/components/offers/util/Tooltip'; +import loginPageHref from '~/components/shared/loginPageHref'; import { copyProfileLink } from '~/utils/offers/link'; import { trpc } from '~/utils/trpc'; @@ -195,7 +196,7 @@ export default function ProfileComments({ diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentVoteButtons.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentVoteButtons.tsx index 9c2435e6..c7956fbe 100644 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentVoteButtons.tsx +++ b/apps/portal/src/components/resumes/comments/comment/ResumeCommentVoteButtons.tsx @@ -8,6 +8,7 @@ import { import { Vote } from '@prisma/client'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; +import loginPageHref from '~/components/shared/loginPageHref'; import { trpc } from '~/utils/trpc'; @@ -63,7 +64,7 @@ export default function ResumeCommentVoteButtons({ const onVote = async (value: Vote, setAnimation: (_: boolean) => void) => { if (!userId) { - router.push('/api/auth/signin'); + router.push(loginPageHref()); return; } diff --git a/apps/portal/src/components/resumes/shared/ResumeSignInButton.tsx b/apps/portal/src/components/resumes/shared/ResumeSignInButton.tsx index c470dffb..ce390fb7 100644 --- a/apps/portal/src/components/resumes/shared/ResumeSignInButton.tsx +++ b/apps/portal/src/components/resumes/shared/ResumeSignInButton.tsx @@ -1,5 +1,7 @@ import clsx from 'clsx'; -import { signIn } from 'next-auth/react'; +import Link from 'next/link'; + +import loginPageHref from '~/components/shared/loginPageHref'; type Props = Readonly<{ className?: string; @@ -10,15 +12,11 @@ export default function ResumeSignInButton({ text, className }: Props) { return (
- { - event.preventDefault(); - signIn(); - }}> - Sign in - {' '} + + Log in + {' '} {text}
+ Get your resumes peer-reviewed, discuss solutions to tech interview + questions, get offer data points. +
+