Add new filter action to blur media (#34256)
This commit is contained in:
parent
2a181f56e3
commit
c93b2c6809
11 changed files with 46 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue