mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-04 05:53:07 -05:00
1d3d549e96
Port 393f0a0159f8c12316e903979f6a506e44ea2b50 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
34 lines
836 B
TypeScript
34 lines
836 B
TypeScript
/* Significantly rewritten from upstream to keep the old design for now */
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
export const ContentWarning: React.FC<{
|
|
text: string;
|
|
expanded?: boolean;
|
|
onClick?: () => void;
|
|
icons?: React.ReactNode[];
|
|
}> = ({ text, expanded, onClick, icons }) => (
|
|
<p>
|
|
<span dangerouslySetInnerHTML={{ __html: text }} className='translate' />{' '}
|
|
<button
|
|
type='button'
|
|
className='status__content__spoiler-link'
|
|
onClick={onClick}
|
|
aria-expanded={expanded}
|
|
>
|
|
{expanded ? (
|
|
<FormattedMessage
|
|
id='content_warning.hide'
|
|
defaultMessage='Hide post'
|
|
/>
|
|
) : (
|
|
<FormattedMessage
|
|
id='content_warning.show_more'
|
|
defaultMessage='Show more'
|
|
/>
|
|
)}
|
|
{icons}
|
|
</button>
|
|
</p>
|
|
);
|