diff --git a/apps/portal/public/favicon.ico b/apps/portal/public/favicon.ico index d3b456c0..2b50a782 100644 Binary files a/apps/portal/public/favicon.ico and b/apps/portal/public/favicon.ico differ diff --git a/apps/portal/src/components/global/AppShell.tsx b/apps/portal/src/components/global/AppShell.tsx index fde9d3b6..c94c1f58 100644 --- a/apps/portal/src/components/global/AppShell.tsx +++ b/apps/portal/src/components/global/AppShell.tsx @@ -1,5 +1,6 @@ import clsx from 'clsx'; import Link from 'next/link'; +import { useRouter } from 'next/router'; import { signIn, signOut, useSession } from 'next-auth/react'; import type { ReactNode } from 'react'; import { Fragment, useState } from 'react'; @@ -13,6 +14,14 @@ import { XMarkIcon, } from '@heroicons/react/24/outline'; +import HomeNavigation from '~/components/global/HomeNavigation'; +import OffersNavigation from '~/components/offers/OffersNavigation'; +import QuestionsNavigation from '~/components/questions/QuestionsNavigation'; +import ResumesNavigation from '~/components/resumes/ResumesNavigation'; + +import type { ProductNavigationItems } from './ProductNavigation'; +import ProductNavigation from './ProductNavigation'; + const sidebarNavigation = [ { current: false, href: '/', icon: HomeIcon, name: 'Home' }, { current: false, href: '/resumes', icon: DocumentTextIcon, name: 'Resumes' }, @@ -39,14 +48,15 @@ function ProfileJewel() { if (session == null) { return ( - { event.preventDefault(); signIn(); }}> Sign in - + ); } @@ -65,7 +75,7 @@ function ProfileJewel() { return (
- + Open user menu {session?.user?.image == null ? ( Render some icon @@ -110,18 +120,41 @@ function ProfileJewel() { export default function AppShell({ children }: Props) { const [mobileMenuOpen, setMobileMenuOpen] = useState(false); + const router = useRouter(); + + const currentProductNavigation: Readonly<{ + navigation: ProductNavigationItems; + title: string; + }> = (() => { + const path = router.pathname; + if (path.startsWith('/resumes')) { + return ResumesNavigation; + } + + if (path.startsWith('/offers')) { + return OffersNavigation; + } + + if (path.startsWith('/questions')) { + return QuestionsNavigation; + } + + return HomeNavigation; + })(); return (
{/* Narrow sidebar */} -
+
- Your Company + + Tech Interview Handbook +
{sidebarNavigation.map((item) => ( @@ -130,8 +163,8 @@ export default function AppShell({ children }: Props) { aria-current={item.current ? 'page' : undefined} className={clsx( item.current - ? 'bg-indigo-800 text-white' - : 'text-indigo-100 hover:bg-indigo-800 hover:text-white', + ? 'bg-primary-50 text-slate-700' + : 'text-slate-700 hover:bg-slate-200', 'group flex w-full flex-col items-center rounded-md p-3 text-xs font-medium', )} href={item.href}> @@ -139,8 +172,8 @@ export default function AppShell({ children }: Props) { aria-hidden="true" className={clsx( item.current - ? 'text-white' - : 'text-indigo-300 group-hover:text-white', + ? 'text-primary-500' + : 'text-slate-500 group-hover:text-slate-700', 'h-6 w-6', )} /> @@ -177,7 +210,7 @@ export default function AppShell({ children }: Props) { leave="transition ease-in-out duration-300 transform" leaveFrom="translate-x-0" leaveTo="-translate-x-full"> - +
- Your Company + + Tech Interview Handbook +