bug: follow all fix

This commit is contained in:
Kieran 2023-02-25 21:27:01 +00:00
parent 21d7df42bc
commit c203c7eeed
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 14 additions and 16 deletions

View File

@ -10,8 +10,10 @@ import messages from "./messages";
export interface FollowListBaseProps {
pubkeys: HexKey[];
title?: ReactNode | string;
showFollowAll?: boolean;
showAbout?: boolean;
}
export default function FollowListBase({ pubkeys, title }: FollowListBaseProps) {
export default function FollowListBase({ pubkeys, title, showFollowAll, showAbout }: FollowListBaseProps) {
const publisher = useEventPublisher();
async function followAll() {
@ -21,14 +23,16 @@ export default function FollowListBase({ pubkeys, title }: FollowListBaseProps)
return (
<div className="main-content">
<div className="flex mt10 mb10">
<div className="f-grow bold">{title}</div>
<button className="transparent" type="button" onClick={() => followAll()}>
<FormattedMessage {...messages.FollowAll} />
</button>
</div>
{(showFollowAll ?? true) && (
<div className="flex mt10 mb10">
<div className="f-grow bold">{title}</div>
<button className="transparent" type="button" onClick={() => followAll()}>
<FormattedMessage {...messages.FollowAll} />
</button>
</div>
)}
{pubkeys?.map(a => (
<ProfilePreview pubkey={a} key={a} />
<ProfilePreview pubkey={a} key={a} options={{ about: showAbout }} />
))}
</div>
);

View File

@ -218,16 +218,10 @@ export default function ProfilePage() {
}
case FOLLOWS: {
return (
<div className="main-content">
{follows.map(a => (
<ProfilePreview key={a} pubkey={a.toLowerCase()} options={{ about: !isMe }} />
))}
</div>
);
return <FollowsList pubkeys={follows} showFollowAll={!isMe} showAbout={!isMe} />;
}
case FOLLOWERS: {
return <FollowsList pubkeys={followers} />;
return <FollowsList pubkeys={followers} showAbout={true} />;
}
case MUTED: {
return <MutedList pubkeys={muted} />;