diff --git a/frontend/src/components/pages/ProfilePage.tsx b/frontend/src/components/pages/ProfilePage.tsx index bf61232..1cd15fc 100644 --- a/frontend/src/components/pages/ProfilePage.tsx +++ b/frontend/src/components/pages/ProfilePage.tsx @@ -2,17 +2,30 @@ 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"; import ProfileIssuedAttestations from "../profiles/profile-page/ProfileIssuedAttestations"; 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;