bug: follow all fix
This commit is contained in:
parent
21d7df42bc
commit
c203c7eeed
@ -10,8 +10,10 @@ import messages from "./messages";
|
|||||||
export interface FollowListBaseProps {
|
export interface FollowListBaseProps {
|
||||||
pubkeys: HexKey[];
|
pubkeys: HexKey[];
|
||||||
title?: ReactNode | string;
|
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();
|
const publisher = useEventPublisher();
|
||||||
|
|
||||||
async function followAll() {
|
async function followAll() {
|
||||||
@ -21,14 +23,16 @@ export default function FollowListBase({ pubkeys, title }: FollowListBaseProps)
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main-content">
|
<div className="main-content">
|
||||||
|
{(showFollowAll ?? true) && (
|
||||||
<div className="flex mt10 mb10">
|
<div className="flex mt10 mb10">
|
||||||
<div className="f-grow bold">{title}</div>
|
<div className="f-grow bold">{title}</div>
|
||||||
<button className="transparent" type="button" onClick={() => followAll()}>
|
<button className="transparent" type="button" onClick={() => followAll()}>
|
||||||
<FormattedMessage {...messages.FollowAll} />
|
<FormattedMessage {...messages.FollowAll} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
{pubkeys?.map(a => (
|
{pubkeys?.map(a => (
|
||||||
<ProfilePreview pubkey={a} key={a} />
|
<ProfilePreview pubkey={a} key={a} options={{ about: showAbout }} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -218,16 +218,10 @@ export default function ProfilePage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FOLLOWS: {
|
case FOLLOWS: {
|
||||||
return (
|
return <FollowsList pubkeys={follows} showFollowAll={!isMe} showAbout={!isMe} />;
|
||||||
<div className="main-content">
|
|
||||||
{follows.map(a => (
|
|
||||||
<ProfilePreview key={a} pubkey={a.toLowerCase()} options={{ about: !isMe }} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
case FOLLOWERS: {
|
case FOLLOWERS: {
|
||||||
return <FollowsList pubkeys={followers} />;
|
return <FollowsList pubkeys={followers} showAbout={true} />;
|
||||||
}
|
}
|
||||||
case MUTED: {
|
case MUTED: {
|
||||||
return <MutedList pubkeys={muted} />;
|
return <MutedList pubkeys={muted} />;
|
||||||
|
Loading…
Reference in New Issue
Block a user