[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:
parent
98780106cb
commit
f532c9f179
@ -138,12 +138,16 @@ export const CollectionAccountsList: React.FC<{
|
|||||||
|
|
||||||
const renderAccountItemButton = useCallback(
|
const renderAccountItemButton = useCallback(
|
||||||
({ relationship, accountId }: RenderButtonOptions) => {
|
({ 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
|
// When viewing your own collection, only show the Follow button
|
||||||
// for accounts you're not following anymore.
|
// for accounts you're not following anymore.
|
||||||
const withoutButton =
|
const withoutButton =
|
||||||
!relationship ||
|
collectionOwnerId === me &&
|
||||||
(collectionOwnerId === me &&
|
(relationship.following || relationship.requested);
|
||||||
(relationship.following || relationship.requested));
|
|
||||||
|
|
||||||
if (withoutButton) return null;
|
if (withoutButton) return null;
|
||||||
|
|
||||||
|
|||||||
@ -483,11 +483,19 @@ const InteractionModal: React.FC<{
|
|||||||
/>
|
/>
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
<FormattedMessage
|
{intent === 'follow' ? (
|
||||||
id='interaction_modal.action'
|
<FormattedMessage
|
||||||
defaultMessage="To interact with {name}'s post, you need to sign into your account on whatever Mastodon server you use."
|
id='interaction_modal.action_follow'
|
||||||
values={{ name }}
|
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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user