From 92cbd5a6eb1550abd11785cb9bd30e5b050f9d65 Mon Sep 17 00:00:00 2001 From: Eddie Jaoude Date: Wed, 26 Jun 2024 08:04:57 +0100 Subject: [PATCH] fix: login cta not shown when logged in --- src/app/page.js | 15 ++++++++++----- src/components/Header.js | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/page.js b/src/app/page.js index 5f69d6a..186fc28 100644 --- a/src/app/page.js +++ b/src/app/page.js @@ -6,9 +6,11 @@ import { LockClosedIcon, WifiIcon, } from "@heroicons/react/24/outline"; +import { getServerSession } from "next-auth"; import prisma from "@/models/db"; +import { authOptions } from "@/app/api/auth/[...nextauth]/route"; import Items from "@/components/list/Items"; import Cta from "@/components/Cta"; import REACH from "@/config/reach"; @@ -41,6 +43,7 @@ const featuresCampaigns = [ ]; export default async function Page() { + const session = await getServerSession(authOptions); const users = await prisma.user.findMany({ include: { platforms: { @@ -71,11 +74,13 @@ export default async function Page() { Content Creators Directory
- - Are you a Content Creator? -
- Want to get paid? -
+ {!session && ( + + Are you a Content Creator? +
+ Want to get paid? +
+ )}

diff --git a/src/components/Header.js b/src/components/Header.js index e0978ed..871ada2 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -13,7 +13,6 @@ import { TransitionChild, } from "@headlessui/react"; import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline"; -import { MagnifyingGlassIcon } from "@heroicons/react/20/solid"; import { signIn, signOut } from "next-auth/react"; import Image from "next/image"; import Link from "next/link";