Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: remove login link from footer if authenticated (#10362)
Browse files Browse the repository at this point in the history
* Footer Contribution

* Links bug fix in Statistics page

* before fix

* original footer

* fixed footer
  • Loading branch information
MalekAchich authored Jun 8, 2024
1 parent a09dae4 commit 55e5e38
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import va from "@vercel/analytics";

import { useSession } from 'next-auth/react';
import {
FaLinkedin,
FaGithub,
Expand All @@ -15,12 +15,15 @@ import { BASE_GITHUB_PROJECT_URL, BASE_GITHUB_URL } from "@constants/index";
import LogoWide from "@public/logos/LogoWide";

export default function Footer() {
const { data: session, status } = useSession();
const loading = status === 'loading';
const navigation = {
solutions: [
{ name: "Search", href: "/search", external: false },
{ name: "Events", href: "/events", external: false },
{ name: "Map", href: "/map", external: false },
{ name: "Login", href: "/auth/signin", external: false },
// Only include the "Login" link if the user is not logged in
...(!session && !loading ? [{ name: "Login", href: "/auth/signin", external: false }] : []),
{
name: "Open Source Roadmap",
href: "/docs/open-source-roadmap",
Expand Down

0 comments on commit 55e5e38

Please sign in to comment.