Show follow counts on profile tabs
This commit is contained in:
parent
07fc595f46
commit
6f3107659e
@ -1,7 +1,7 @@
|
|||||||
import useEventPublisher from "../feed/EventPublisher";
|
import useEventPublisher from "../feed/EventPublisher";
|
||||||
import ProfilePreview from "./ProfilePreview";
|
import ProfilePreview from "./ProfilePreview";
|
||||||
|
|
||||||
export default function FollowListBase({ pubkeys }) {
|
export default function FollowListBase({ pubkeys, title}) {
|
||||||
const publisher = useEventPublisher();
|
const publisher = useEventPublisher();
|
||||||
|
|
||||||
async function followAll() {
|
async function followAll() {
|
||||||
@ -12,7 +12,7 @@ export default function FollowListBase({ pubkeys }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="f-grow"></div>
|
<div className="f-grow">{title}</div>
|
||||||
<div className="btn" onClick={() => followAll()}>Follow All</div>
|
<div className="btn" onClick={() => followAll()}>Follow All</div>
|
||||||
</div>
|
</div>
|
||||||
{pubkeys?.map(a => <ProfilePreview pubkey={a} key={a} options={{ about: false }} />)}
|
{pubkeys?.map(a => <ProfilePreview pubkey={a} key={a} options={{ about: false }} />)}
|
||||||
|
@ -11,5 +11,5 @@ export default function FollowersList({ pubkey }) {
|
|||||||
return [...new Set(contactLists?.map(a => a.pubkey))];
|
return [...new Set(contactLists?.map(a => a.pubkey))];
|
||||||
}, [feed]);
|
}, [feed]);
|
||||||
|
|
||||||
return <FollowListBase pubkeys={pubkeys} />
|
return <FollowListBase pubkeys={pubkeys} title={`${pubkeys?.length} followers`}/>
|
||||||
}
|
}
|
@ -12,5 +12,5 @@ export default function FollowsList({ pubkey }) {
|
|||||||
return [...new Set(pTags?.flat())];
|
return [...new Set(pTags?.flat())];
|
||||||
}, [feed]);
|
}, [feed]);
|
||||||
|
|
||||||
return <FollowListBase pubkeys={pubkeys} />
|
return <FollowListBase pubkeys={pubkeys} title={`Following ${pubkeys?.length}`}/>
|
||||||
}
|
}
|
@ -84,7 +84,12 @@ export default function ProfilePage() {
|
|||||||
case ProfileTab.Notes: return <Timeline pubkeys={id} />;
|
case ProfileTab.Notes: return <Timeline pubkeys={id} />;
|
||||||
case ProfileTab.Follows: {
|
case ProfileTab.Follows: {
|
||||||
if (isMe) {
|
if (isMe) {
|
||||||
return follows.map(a => <ProfilePreview key={a} pubkey={a.toLowerCase()} options={{ about: false }} />)
|
return (
|
||||||
|
<>
|
||||||
|
<h4>Following {follows.length}</h4>
|
||||||
|
{follows.map(a => <ProfilePreview key={a} pubkey={a.toLowerCase()} options={{ about: false }} />)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return <FollowsList pubkey={id} />;
|
return <FollowsList pubkey={id} />;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user