bug: follow all fix
This commit is contained in:
parent
21d7df42bc
commit
c203c7eeed
@ -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>
|
||||
);
|
||||
|
@ -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} />;
|
||||
|
Loading…
x
Reference in New Issue
Block a user