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

Commit

Permalink
fix: login cta not shown when logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Jun 26, 2024
1 parent 25688c5 commit 92cbd5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -41,6 +43,7 @@ const featuresCampaigns = [
];

export default async function Page() {
const session = await getServerSession(authOptions);
const users = await prisma.user.findMany({
include: {
platforms: {
Expand Down Expand Up @@ -71,11 +74,13 @@ export default async function Page() {
Content Creators Directory
</h2>
<div className="overflow-hidden rounded-lg bg-white shadow">
<Cta>
Are you a Content Creator?
<br />
Want to get paid?
</Cta>
{!session && (
<Cta>
Are you a Content Creator?
<br />
Want to get paid?
</Cta>
)}
<div className="p-6">
<div className="mx-auto max-w-2xl lg:text-center">
<h2 className="text-base font-semibold leading-7 text-indigo-600">
Expand Down
1 change: 0 additions & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 92cbd5a

Please sign in to comment.