From d579b6aa27f4be8e693bed024ca18c97fe77e785 Mon Sep 17 00:00:00 2001 From: Caner <s86215@bht-berlin.de> Date: Wed, 31 May 2023 23:14:02 +0200 Subject: [PATCH] UserPage update --- app/(content)/(user)/[userid]/page.tsx | 40 +++++++++++++++++-- .../{(user)/[userid] => }/followers/page.tsx | 7 ++-- .../[userid] => }/notifications/page.tsx | 0 prisma/schema.prisma | 4 +- 4 files changed, 42 insertions(+), 9 deletions(-) rename app/(content)/{(user)/[userid] => }/followers/page.tsx (55%) rename app/(content)/{(user)/[userid] => }/notifications/page.tsx (100%) diff --git a/app/(content)/(user)/[userid]/page.tsx b/app/(content)/(user)/[userid]/page.tsx index 69fa206..86ddc8a 100644 --- a/app/(content)/(user)/[userid]/page.tsx +++ b/app/(content)/(user)/[userid]/page.tsx @@ -1,8 +1,40 @@ +'use client' +import { useSession } from "next-auth/react"; + + export default function User({ params }: { params: { userid: string } }) { + const { data: session } = useSession(); return ( - <> - <h1>User Profile Page WIP</h1> - <p>Unique Page Params: {params.userid}</p> - </> + <div className="mt-8 px-4"> + <div className="flex-shrink-0"> + <title>{`GameUnity User`}</title> + <div className="h-10 w-10 rounded-full bg-gray-300"></div> {/* Profile picture */} + </div> + <div className="flex flex-col"> + <p className="text-white text-2xl font-semibold"> + {session?.user.name} + </p> + <div + className=" + flex + flex-row + items-center + gap-2 + mt-4 + text-neutral-500 + "> + </div> + </div> + <div className="flex flex-row items-center mt-4 gap-6"> + <div className="flex flex-row items-center gap-1"> + <p className="text-neutral-500">Following</p> + </div> + <div className="flex flex-row items-center gap-1"> + <p className="text-white">{}</p> + <p className="text-neutral-500">Followers</p> + </div> + </div> + </div> + ) } \ No newline at end of file diff --git a/app/(content)/(user)/[userid]/followers/page.tsx b/app/(content)/followers/page.tsx similarity index 55% rename from app/(content)/(user)/[userid]/followers/page.tsx rename to app/(content)/followers/page.tsx index a024dd2..7d8778f 100644 --- a/app/(content)/(user)/[userid]/followers/page.tsx +++ b/app/(content)/followers/page.tsx @@ -1,8 +1,9 @@ +import { authOptions } from "@/app/api/auth/[...nextauth]/route"; import FollowersList from "@/components/following-users"; -import { useSession } from "next-auth/react"; +import { getServerSession } from "next-auth"; -export default function Followers() { - const { data: session } = useSession(); +export default async function Followers() { + const session = await getServerSession(authOptions); if (!session) { return <div>Loading...</div>; diff --git a/app/(content)/(user)/[userid]/notifications/page.tsx b/app/(content)/notifications/page.tsx similarity index 100% rename from app/(content)/(user)/[userid]/notifications/page.tsx rename to app/(content)/notifications/page.tsx diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1fcb4c7..dbf586a 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -12,8 +12,8 @@ datasource db { model User { id Int @id @default(autoincrement()) - userName String? @unique - name String? + userName String? @unique + name String? @default("u ${id}") email String? @unique password String emailVerified DateTime? -- GitLab