Mastodon/app/javascript/flavours/glitch/components/limited_account_hint.tsx
Martin Dørum 4a5cfb09ad [Glitch] Make the hidden account message less misleading
Port 78e8ee7a4316f92fa54bebf855371f3ba0a46b93 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2026-06-02 18:04:11 +02:00

37 lines
1.0 KiB
TypeScript

import { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import { revealAccount } from '@/flavours/glitch/actions/accounts_typed';
import { domain } from '@/flavours/glitch/initial_state';
import { useAppDispatch } from '@/flavours/glitch/store';
import { Button } from './button';
export const LimitedAccountHint: React.FC<{ accountId: string }> = ({
accountId,
}) => {
const dispatch = useAppDispatch();
const reveal = useCallback(() => {
dispatch(revealAccount({ id: accountId }));
}, [dispatch, accountId]);
return (
<div className='limited-account-hint'>
<p>
<FormattedMessage
id='limited_account_hint.title'
defaultMessage='This profile or server has been hidden by the moderators of {domain}.'
values={{ domain }}
/>
</p>
<Button onClick={reveal}>
<FormattedMessage
id='limited_account_hint.action'
defaultMessage='Show profile anyway'
/>
</Button>
</div>
);
};