-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathProfileMain.tsx
More file actions
45 lines (42 loc) · 1.67 KB
/
Copy pathProfileMain.tsx
File metadata and controls
45 lines (42 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import ProfileHeader from "@/components/profiles/profile-page/ProfileHeader";
import ProfileActions from "@/components/profiles/profile-page/ProfileActions";
import ProfileDescription from "@/components/profiles/profile-page/ProfileDescription";
import ProfileAttestations from "@/components/profiles/profile-page/ProfileAttestations";
import ProfileIssuedAttestations from "@/components/profiles/profile-page/ProfileIssuedAttestations";
import { useGetProfiles } from "@/hooks/profiles/use-get-profiles";
import { useMemo } from "react";
export function ProfileMain({ address }: { address: string }) {
const profilesQuery = useGetProfiles();
const profile = useMemo(() => {
const list = profilesQuery.data ?? [];
const p = list.find(
(x) => x.address.toLowerCase() === address.toLowerCase()
);
return p;
}, [profilesQuery.data, address]);
return (
<div className="max-w-4xl mx-auto p-6">
<ProfileHeader
address={address}
name={profile?.name}
description={profile?.description}
githubLogin={profile?.github_login}
twitterHandle={profile?.twitter_handle}
linkedinAccount={profile?.linkedin_account}
/>
<div className="mt-6">
<ProfileActions
address={address}
name={profile?.name}
description={profile?.description}
githubLogin={profile?.github_login}
twitterHandle={profile?.twitter_handle}
linkedinAccount={profile?.linkedin_account}
/>
</div>
<ProfileDescription description={profile?.description} />
<ProfileAttestations address={address} />
<ProfileIssuedAttestations address={address} />
</div>
);
}