From 47b777dbaf80be9701a01ff949f061b57f5af6dc Mon Sep 17 00:00:00 2001 From: Joseph Yu <39754176+joseph082@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:44:27 -0700 Subject: [PATCH 1/6] Create Paths global --- lib/globals.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/globals.js b/lib/globals.js index edbacbf..8b555d7 100644 --- a/lib/globals.js +++ b/lib/globals.js @@ -412,3 +412,9 @@ export const Durations = [ { label: 'Summer', value: 'SUMMER' }, { label: 'Year Round', value: 'YEAR_ROUND' }, ]; + +export const Paths = { + LandingPage: '/', + PostsPage: '/posts', + ManagePostsPage: '/manage-posts', +}; From 7ae36c04334da6c05bf108cefcb5435dc9341ebb Mon Sep 17 00:00:00 2001 From: Joseph Yu <39754176+joseph082@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:58:43 -0700 Subject: [PATCH 2/6] Use Paths global --- components/NavBar.jsx | 8 +- components/ResearcherSidebar.jsx | 7 +- pages/account-type.jsx | 5 +- pages/api/applications/[jobId]/apply.js | 3 +- pages/api/jobs/[jobId]/close.js | 3 +- pages/api/jobs/[jobId]/edit.js | 3 +- pages/api/jobs/create.js | 3 +- pages/job/[jobId]/edit.jsx | 6 +- pages/job/create.jsx | 4 +- pages/researcher/profile/create.jsx | 4 +- pages/student/profile/add.jsx | 457 ++++++++++++------------ 11 files changed, 257 insertions(+), 246 deletions(-) diff --git a/components/NavBar.jsx b/components/NavBar.jsx index 4ee83eb..0473612 100644 --- a/components/NavBar.jsx +++ b/components/NavBar.jsx @@ -3,6 +3,7 @@ import { Fragment } from 'react'; import { useSession, signOut } from 'next-auth/react'; import { Menu, Transition } from '@headlessui/react'; import { useEffect, useState } from 'react'; +import { Paths } from '@lib/globals'; export default function NavBar({ pathname }) { const { data: session } = useSession(); @@ -31,7 +32,7 @@ export default function NavBar({ pathname }) { return (