|
|
|
@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
import { changeComposeSensitivity } from 'mastodon/actions/compose';
|
|
|
|
|
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
|
|
|
|
|
import Icon from 'mastodon/components/icon';
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
marked: { id: 'compose_form.sensitive.marked', defaultMessage: 'Media is marked as sensitive' },
|
|
|
|
@ -38,9 +37,19 @@ class SensitiveButton extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className='compose-form__sensitive-button'>
|
|
|
|
|
<button className={classNames('icon-button', { active })} onClick={onClick} disabled={disabled} title={intl.formatMessage(active ? messages.marked : messages.unmarked)}>
|
|
|
|
|
<Icon id='eye-slash' /> <FormattedMessage id='compose_form.sensitive.hide' defaultMessage='Mark media as sensitive' />
|
|
|
|
|
</button>
|
|
|
|
|
<label className={classNames('icon-button', { active })} title={intl.formatMessage(active ? messages.marked : messages.unmarked)}>
|
|
|
|
|
<input
|
|
|
|
|
name='mark-sensitive'
|
|
|
|
|
type='checkbox'
|
|
|
|
|
checked={active}
|
|
|
|
|
onChange={onClick}
|
|
|
|
|
disabled={disabled}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<span className={classNames('checkbox', { active })} />
|
|
|
|
|
|
|
|
|
|
<FormattedMessage id='compose_form.sensitive.hide' defaultMessage='Mark media as sensitive' />
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|