Created a ProtectedRoute component that checks for a currentUser and renders a child component if it finds one, or redirects to the login page if no one is logged in.
Wrapped the donate, account, and account/edit pages in this component to protect those routes.
Added an isLoading(boolean) state to the userContext so that the ProtectedRoute renders the Loader if it's in the process of fetching the currentUser. This avoids an issue where logged in users where being redirected to /login when accessing account/edit because of the way nested routes behave in Next 13 (currentUser briefly returns null when the page renders)
Added a useUserContext helper function to export the userContext. This eliminates the need to import both the useContext hook and UserContext into every component that needs to access that context. Now you can just do 'const { currentUser } = useUserContext()
Updated the header component to use this useUserContext approach.