From 493678c49c4295815c387bdeb64a73b6f7fd9a9e Mon Sep 17 00:00:00 2001 From: Iwueseiter <156322726+Iwueseiter@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:07:45 +0000 Subject: [PATCH] Add description on the profile page --- frontend/src/components/pages/ProfilePage.tsx | 15 ++++++++++++++- .../action-buttons/CreateProfileDialog.tsx | 3 ++- .../action-buttons/EditProfileDialog.tsx | 3 ++- .../profiles/profile-page/ProfileDescription.tsx | 16 ++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/profiles/profile-page/ProfileDescription.tsx diff --git a/frontend/src/components/pages/ProfilePage.tsx b/frontend/src/components/pages/ProfilePage.tsx index 0074f6d..8527162 100644 --- a/frontend/src/components/pages/ProfilePage.tsx +++ b/frontend/src/components/pages/ProfilePage.tsx @@ -2,16 +2,29 @@ import { AppWrapper } from "@/components/AppWrapper"; import ProfileHeader from "@/components/profiles/profile-page/ProfileHeader"; import ProfileActions from "@/components/profiles/profile-page/ProfileActions"; import ProfileAttestations from "@/components/profiles/profile-page/ProfileAttestations"; +import ProfileDescription from "@/components/profiles/profile-page/ProfileDescription"; +import { useMemo } from "react"; +import { useGetProfiles } from "@/hooks/profiles/use-get-profiles"; type Props = { address?: string }; export default function ProfilePage({ address }: Props) { + const profilesQuery = useGetProfiles(); + const profile = useMemo(() => { + const list = profilesQuery.data ?? []; + return list.find( + (x) => x.address.toLowerCase() === (address || "").toLowerCase() + ); + }, [profilesQuery.data, address]); + return (
- + + +
diff --git a/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx b/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx index 390266a..b94afc8 100644 --- a/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx +++ b/frontend/src/components/profiles/action-buttons/CreateProfileDialog.tsx @@ -93,7 +93,8 @@ export function CreateProfileButton() { Description - diff --git a/frontend/src/components/profiles/action-buttons/EditProfileDialog.tsx b/frontend/src/components/profiles/action-buttons/EditProfileDialog.tsx index f4619c6..b724fc8 100644 --- a/frontend/src/components/profiles/action-buttons/EditProfileDialog.tsx +++ b/frontend/src/components/profiles/action-buttons/EditProfileDialog.tsx @@ -100,7 +100,8 @@ export function EditProfileDialog({ Description - diff --git a/frontend/src/components/profiles/profile-page/ProfileDescription.tsx b/frontend/src/components/profiles/profile-page/ProfileDescription.tsx new file mode 100644 index 0000000..40865c8 --- /dev/null +++ b/frontend/src/components/profiles/profile-page/ProfileDescription.tsx @@ -0,0 +1,16 @@ +import React from "react"; + +interface ProfileDescriptionProps { + description?: string; +} + +export const ProfileDescription: React.FC = ({ description }) => { + if (!description) return null; + return ( +
+

{description}

+
+ ); +}; + +export default ProfileDescription;