[Glitch] Show "Follow" button next to accounts in a collection when logged out

Port 60a437e045fbd6a19a51f3f0edb7e8ea3dd0228a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion 2026-05-07 11:51:12 +02:00 committed by Claire
parent 98780106cb
commit f532c9f179
2 changed files with 20 additions and 8 deletions

View File

@ -138,12 +138,16 @@ export const CollectionAccountsList: React.FC<{
const renderAccountItemButton = useCallback(
({ relationship, accountId }: RenderButtonOptions) => {
if (!me || !relationship) {
// Show follow button when logged out (it will trigger the remote interaction modal)
return <AccountListItemFollowButton accountId={accountId} />;
}
// When viewing your own collection, only show the Follow button
// for accounts you're not following anymore.
const withoutButton =
!relationship ||
(collectionOwnerId === me &&
(relationship.following || relationship.requested));
collectionOwnerId === me &&
(relationship.following || relationship.requested);
if (withoutButton) return null;

View File

@ -483,11 +483,19 @@ const InteractionModal: React.FC<{
/>
</h3>
<p>
<FormattedMessage
id='interaction_modal.action'
defaultMessage="To interact with {name}'s post, you need to sign into your account on whatever Mastodon server you use."
values={{ name }}
/>
{intent === 'follow' ? (
<FormattedMessage
id='interaction_modal.action_follow'
defaultMessage='To follow {name}, you need to sign into your account on whatever Mastodon server you use.'
values={{ name }}
/>
) : (
<FormattedMessage
id='interaction_modal.action'
defaultMessage="To interact with {name}'s post, you need to sign into your account on whatever Mastodon server you use."
values={{ name }}
/>
)}
</p>
</div>