mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-04 05:53:07 -05:00
b7afca0f05
* Remove option to have media outside of CWs Upstream adopted the media-in-CW design glitch-soc originally had. * Move poll to StatusContent * Refactor status media icons * Rename `forceFilter` to `showDespiteFilter` for consistency with upstream * Change media and status content markup to match upstream's * Add mention placeholders back
26 lines
660 B
TypeScript
26 lines
660 B
TypeScript
import type { IconName } from './media_icon';
|
|
import { MediaIcon } from './media_icon';
|
|
import { StatusBanner, BannerVariant } from './status_banner';
|
|
|
|
export const ContentWarning: React.FC<{
|
|
text: string;
|
|
expanded?: boolean;
|
|
onClick?: () => void;
|
|
icons?: IconName[];
|
|
}> = ({ text, expanded, onClick, icons }) => (
|
|
<StatusBanner
|
|
expanded={expanded}
|
|
onClick={onClick}
|
|
variant={BannerVariant.Warning}
|
|
>
|
|
{icons?.map((icon) => (
|
|
<MediaIcon
|
|
className='status__content__spoiler-icon'
|
|
icon={icon}
|
|
key={`icon-${icon}`}
|
|
/>
|
|
))}
|
|
<p dangerouslySetInnerHTML={{ __html: text }} />
|
|
</StatusBanner>
|
|
);
|