* Fix EmojiFormatter failure * Add notification_emails.warning setting default value * Fix list spec failure and add antennas for spec response * Fix domain block spec failure to add kb custom response * Fix SearchQueryTransformer spec failure * Fix Account#matches_display_name spec failure * Fix UpdateStatusService changes mentions spec failure * Fix RuboCop Lint * Ignore brakeman warning * Fix CI failure for ignore brakeman warning * Fix migration failure * Fix README * Fix migration CI failure * Fix some spec failure * Format code for RuboCop lint failure * Fix ESlint failure * Fix haml-lint failure
28 lines
903 B
JavaScript
28 lines
903 B
JavaScript
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { changeComposeMarkdown } from '../../../actions/compose';
|
|
import TextIconButton from '../components/text_icon_button';
|
|
|
|
const messages = defineMessages({
|
|
marked: { id: 'compose_form.markdown.marked', defaultMessage: 'Markdown is enabled' },
|
|
unmarked: { id: 'compose_form.markdown.unmarked', defaultMessage: 'Markdown is disabled' },
|
|
});
|
|
|
|
const mapStateToProps = (state, { intl }) => ({
|
|
label: 'MD',
|
|
title: intl.formatMessage(state.getIn(['compose', 'markdown']) ? messages.marked : messages.unmarked),
|
|
active: state.getIn(['compose', 'markdown']),
|
|
ariaControls: 'cw-markdown-input',
|
|
});
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
onClick () {
|
|
dispatch(changeComposeMarkdown());
|
|
},
|
|
|
|
});
|
|
|
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(TextIconButton));
|