diff --git a/src/app/(user)/profile/page.tsx b/src/app/(user)/profile/[uid]/page.tsx similarity index 90% rename from src/app/(user)/profile/page.tsx rename to src/app/(user)/profile/[uid]/page.tsx index ceecf73..b45fd9f 100644 --- a/src/app/(user)/profile/page.tsx +++ b/src/app/(user)/profile/[uid]/page.tsx @@ -1,5 +1,3 @@ -// components/ProfilePage.tsx - import React from "react"; import Image from "next/image"; import { createSupabaseClient } from "@/lib/supabase/serverComponentClient"; @@ -10,22 +8,11 @@ import ReactMarkdown from "react-markdown"; interface Profile extends Tables<"Profiles"> {} -export default async function ProfilePage() { +export default async function ProfilePage({ params }: { params: { uid: string } }) { const supabase = createSupabaseClient(); + const uid = params.uid; - const { - data: { user }, - } = await supabase.auth.getUser(); - - if (!user) { - return ( -
-

No user found!

-
- ); - } - - const { data: profileData, error } = await getUserProfile(supabase, user.id); + const { data: profileData, error } = await getUserProfile(supabase, uid); if (error) { return ( diff --git a/src/components/navigationBar/profileBar.tsx b/src/components/navigationBar/profileBar.tsx index 41b31b9..e701ddb 100644 --- a/src/components/navigationBar/profileBar.tsx +++ b/src/components/navigationBar/profileBar.tsx @@ -32,7 +32,7 @@ const UnAuthenticatedComponents = () => { ); }; -const AuthenticatedComponents = () => { +const AuthenticatedComponents = ({ uid }: { uid: string }) => { let notifications = 100; const displayValue = notifications >= 100 ? "..." : notifications; return ( @@ -58,7 +58,7 @@ const AuthenticatedComponents = () => { - Profile + Profile Settings @@ -88,7 +88,7 @@ export function ProfileBar() { <> {sessionLoaded ? ( user ? ( - + ) : ( )