From d9d37ffdd37a31ed8c6ce788c0c5cc88c7bb734a Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 31 Jul 2025 17:36:20 +0200 Subject: [PATCH] Better profile UI --- lib/client/profile.tsx | 132 ++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/lib/client/profile.tsx b/lib/client/profile.tsx index 30ae1314..fe870c11 100644 --- a/lib/client/profile.tsx +++ b/lib/client/profile.tsx @@ -48,36 +48,47 @@ export function getProfile(url: string, header: any = null) { return (
{header} -
-
-

- {userData.name} -

- - < div - className="space-y-6 pt-4 border-t border-gray-200"> - - {userData?.profile?.desiredConnections && ( -
< - h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Desired - Connections - - < ul - className="flex flex-wrap gap-2 mt-1"> - {userData?.profile?.desiredConnections.map((value: any, idx: number) => ( -
  • - {value?.connection?.name - } -
  • - )) - } - -
    - ) +
    +
    +
    +

    + {userData.name} +

    +
    +
    +
    + { + image ? ( +
    +
    + {userData.name { + // const target = e.target as HTMLImageElement; + // target.onerror = null; + // target.src = `https://ui-avatars.com/api/?name=${encodeURIComponent(profile.name || 'U')}&background=random`; + // }} + /> +
    +
    + ) : + ( +
    + + {userData.name ? userData.name.charAt(0).toUpperCase() : 'U'} + +
    + ) } +
    +
    +
    +
    { userData?.profile?.gender && ( @@ -141,8 +152,30 @@ export function getProfile(url: string, header: any = null) { ) } + + {userData?.profile?.desiredConnections?.length > 0 && ( +
    < + h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Desired Connections + + < ul + className="flex flex-wrap gap-2 mt-1"> + {userData?.profile?.desiredConnections.map((value: any, idx: number) => ( +
  • + {value?.connection?.name + } +
  • + )) + } + +
    + ) + } + { - userData?.profile?.intellectualInterests && ( + userData?.profile?.intellectualInterests?.length > 0 && (
    < h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Interests @@ -165,7 +198,7 @@ export function getProfile(url: string, header: any = null) { } { - userData?.profile?.causeAreas && ( + userData?.profile?.causeAreas?.length > 0 && (
    < h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Cause Areas @@ -209,10 +242,9 @@ export function getProfile(url: string, header: any = null) { } { - userData?.profile?.promptAnswers && ( + userData?.profile?.promptAnswers?.length > 0 && (
    < - h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Prompt - Answers + h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Prompt Answers < ul className="flex flex-wrap gap-2 mt-1"> @@ -277,40 +309,8 @@ export function getProfile(url: string, header: any = null) {
    - -
    -
    - { - image ? ( -
    -
    - {userData.name { - // const target = e.target as HTMLImageElement; - // target.onerror = null; - // target.src = `https://ui-avatars.com/api/?name=${encodeURIComponent(profile.name || 'U')}&background=random`; - // }} - /> -
    -
    - ) : - ( -
    - - {userData.name ? userData.name.charAt(0).toUpperCase() : 'U'} - -
    - ) - }
    -
    )