|
|
@ -4,12 +4,13 @@ import { changeComposeSpoilerness } from '../../../actions/compose';
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
const messages = defineMessages({
|
|
|
|
title: { id: 'compose_form.spoiler', defaultMessage: 'Hide text behind warning' },
|
|
|
|
marked: { id: 'compose_form.spoiler.marked', defaultMessage: 'Text is hidden behind warning' },
|
|
|
|
|
|
|
|
unmarked: { id: 'compose_form.spoiler.unmarked', defaultMessage: 'Text is not hidden' },
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state, { intl }) => ({
|
|
|
|
const mapStateToProps = (state, { intl }) => ({
|
|
|
|
label: 'CW',
|
|
|
|
label: 'CW',
|
|
|
|
title: intl.formatMessage(messages.title),
|
|
|
|
title: intl.formatMessage(state.getIn(['compose', 'spoiler']) ? messages.marked : messages.unmarked),
|
|
|
|
active: state.getIn(['compose', 'spoiler']),
|
|
|
|
active: state.getIn(['compose', 'spoiler']),
|
|
|
|
ariaControls: 'cw-spoiler-input',
|
|
|
|
ariaControls: 'cw-spoiler-input',
|
|
|
|
});
|
|
|
|
});
|
|
|
|