mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
[Glitch] Add new filter action to blur media
Port c93b2c6809 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -6,6 +6,7 @@ interface Props {
|
||||
hidden?: boolean;
|
||||
sensitive: boolean;
|
||||
uncached?: boolean;
|
||||
matchedFilters?: string[];
|
||||
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
||||
}
|
||||
|
||||
@@ -13,6 +14,7 @@ export const SpoilerButton: React.FC<Props> = ({
|
||||
hidden = false,
|
||||
sensitive,
|
||||
uncached = false,
|
||||
matchedFilters,
|
||||
onClick,
|
||||
}) => {
|
||||
let warning;
|
||||
@@ -28,6 +30,20 @@ export const SpoilerButton: React.FC<Props> = ({
|
||||
action = (
|
||||
<FormattedMessage id='status.media.open' defaultMessage='Click to open' />
|
||||
);
|
||||
} else if (matchedFilters) {
|
||||
warning = (
|
||||
<FormattedMessage
|
||||
id='filter_warning.matches_filter'
|
||||
defaultMessage='Matches filter “<span>{title}</span>”'
|
||||
values={{
|
||||
title: matchedFilters.join(', '),
|
||||
span: (chunks) => <span className='filter-name'>{chunks}</span>,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
action = (
|
||||
<FormattedMessage id='status.media.show' defaultMessage='Click to show' />
|
||||
);
|
||||
} else if (sensitive) {
|
||||
warning = (
|
||||
<FormattedMessage
|
||||
|
||||
Reference in New Issue
Block a user