From 2acf41a913f676f0e80ee6f11eb7fb239fa40c14 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Tue, 29 Jul 2025 15:53:09 +0200 Subject: [PATCH] Add no profile warning --- app/profiles/[id]/page.tsx | 22 +++++++++++----------- app/profiles/page.tsx | 12 +++++++++--- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/profiles/[id]/page.tsx b/app/profiles/[id]/page.tsx index 61498fea..3fbf838d 100644 --- a/app/profiles/[id]/page.tsx +++ b/app/profiles/[id]/page.tsx @@ -106,12 +106,12 @@ export default function Post() {
- {user.profile.desiredConnections && ( + {user?.profile?.desiredConnections && (
< h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Connection
    - {user.profile.desiredConnections.map((value, idx) => ( + {user?.profile?.desiredConnections.map((value, idx) => (
  • )} - {user.profile.gender && ( + {user?.profile?.gender && (

    Gender

    {user.profile.gender}

    )} - {user.profile.location && ( + {user?.profile?.location && (

    Location

    {user.profile.location}

    )} - {user.profile.personalityType && ( + {user?.profile?.personalityType && (

    Personality Type

    {user.profile.personalityType}

    )} - {user.profile.conflictStyle && ( + {user?.profile?.conflictStyle && (

    Conflit Style

    {user.profile.conflictStyle}

    )} - {user.profile.intellectualInterests && ( + {user?.profile?.intellectualInterests && (
    < h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Interests @@ -168,7 +168,7 @@ export default function Post() {
    )} - {user.profile.causeAreas && ( + {user?.profile?.causeAreas && (
    < h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Cause Areas @@ -185,7 +185,7 @@ export default function Post() {
    )} - {user.profile.promptAnswers && ( + {user?.profile?.promptAnswers && (
    < h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Prompt Answers @@ -202,14 +202,14 @@ export default function Post() {
    )} - {user.profile.description && ( + {user?.profile?.description && (

    About

    {user.profile.description}

    )} - {user.profile.contactInfo && ( + {user?.profile?.contactInfo && (

    Contact

    {user.profile.contactInfo}

    diff --git a/app/profiles/page.tsx b/app/profiles/page.tsx index bc362901..2261adf7 100644 --- a/app/profiles/page.tsx +++ b/app/profiles/page.tsx @@ -50,18 +50,24 @@ export default function ProfilePage() {

    Profiles

    - {profiles.map((user) => ( + {profiles.length > 0 ? + (profiles.map((user) => (

    {user.name}

    - {user.profile.description && ( + {user?.profile?.description && (

    {user.profile.description}

    )}
    - ))} + ))) : ( +
    + There are no profiles for this search. Relax the filters or come back later. +
    + ) + }
    );