mirror of
https://github.com/funamitech/mastodon
synced 2024-12-13 14:18:34 +09:00
7d97e3d82f
Partially apply 500f4925a5
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
38 lines
821 B
TypeScript
38 lines
821 B
TypeScript
import { FormattedMessage } from 'react-intl';
|
|
|
|
export enum BannerVariant {
|
|
Yellow = 'yellow',
|
|
Blue = 'blue',
|
|
}
|
|
|
|
export const StatusBanner: React.FC<{
|
|
children: React.ReactNode;
|
|
variant: BannerVariant;
|
|
expanded?: boolean;
|
|
onClick?: () => void;
|
|
}> = ({ children, variant, expanded, onClick }) => (
|
|
<div
|
|
className={
|
|
variant === BannerVariant.Yellow
|
|
? 'content-warning'
|
|
: 'content-warning content-warning--filter'
|
|
}
|
|
>
|
|
{children}
|
|
|
|
<button className='link-button' onClick={onClick}>
|
|
{expanded ? (
|
|
<FormattedMessage
|
|
id='content_warning.hide'
|
|
defaultMessage='Hide post'
|
|
/>
|
|
) : (
|
|
<FormattedMessage
|
|
id='content_warning.show'
|
|
defaultMessage='Show anyway'
|
|
/>
|
|
)}
|
|
</button>
|
|
</div>
|
|
);
|