Show "Follow" button next to accounts in a collection when logged out (#38933)

This commit is contained in:
diondiondion 2026-05-07 11:51:12 +02:00 committed by GitHub
parent f24f98ce40
commit 60a437e045
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 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>

View File

@ -796,6 +796,7 @@
"info_button.label": "Help",
"info_button.what_is_alt_text": "<h1>What is alt text?</h1> <p>Alt text provides image descriptions for people with vision impairments, low-bandwidth connections, or those seeking extra context.</p> <p>You can improve accessibility and understanding for everyone by writing clear, concise, and objective alt text.</p> <ul> <li>Capture important elements</li> <li>Summarize text in images</li> <li>Use regular sentence structure</li> <li>Avoid redundant information</li> <li>Focus on trends and key findings in complex visuals (like diagrams or maps)</li> </ul>",
"interaction_modal.action": "To interact with {name}'s post, you need to sign into your account on whatever Mastodon server you use.",
"interaction_modal.action_follow": "To follow {name}, you need to sign into your account on whatever Mastodon server you use.",
"interaction_modal.go": "Go",
"interaction_modal.no_account_yet": "Don't have an account yet?",
"interaction_modal.on_another_server": "On a different server",