Markdown refactoring

This commit is contained in:
Alex Gleason 2020-07-28 13:36:10 -05:00
parent daf039d9bb
commit b31cf22f43
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
6 changed files with 11 additions and 10 deletions

View file

@ -497,7 +497,7 @@ export function changeComposeSpoilerness() {
};
};
export function changeComposeMarkdown(value) {
export function changeComposeContentType(value) {
return {
type: COMPOSE_TYPE_CHANGE,
value,

View file

@ -49,7 +49,6 @@ class ComposeForm extends ImmutablePureComponent {
text: PropTypes.string.isRequired,
suggestions: ImmutablePropTypes.list,
spoiler: PropTypes.bool,
content_type: PropTypes.string,
privacy: PropTypes.string,
spoilerText: PropTypes.string,
focusDate: PropTypes.instanceOf(Date),

View file

@ -16,7 +16,6 @@ const mapStateToProps = state => ({
suggestions: state.getIn(['compose', 'suggestions']),
spoiler: state.getIn(['compose', 'spoiler']),
spoilerText: state.getIn(['compose', 'spoiler_text']),
content_type: state.getIn(['compose', 'text/markdown']),
privacy: state.getIn(['compose', 'privacy']),
focusDate: state.getIn(['compose', 'focusDate']),
caretPosition: state.getIn(['compose', 'caretPosition']),

View file

@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import TextIconButton from '../components/text_icon_button';
import { changeComposeMarkdown } from '../../../actions/compose';
import { changeComposeContentType } from '../../../actions/compose';
import { injectIntl, defineMessages } from 'react-intl';
const messages = defineMessages({
@ -18,7 +18,7 @@ const mapStateToProps = (state, { intl }) => ({
const mapDispatchToProps = dispatch => ({
onClick() {
dispatch(changeComposeMarkdown(this.active ? 'text/plain' : 'text/markdown'));
dispatch(changeComposeContentType(this.active ? 'text/plain' : 'text/markdown'));
},
});

View file

@ -214,8 +214,7 @@ export default function compose(state = initialState, action) {
.set('is_composing', false);
case COMPOSE_SENSITIVITY_CHANGE:
return state.withMutations(map => {
map.set('sensitive', !state.get('sensitive'));
map.set('sensitive', !state.get('sensitive'));
map.set('idempotencyKey', uuid());
});
case COMPOSE_TYPE_CHANGE:

View file

@ -1,17 +1,21 @@
.status__content {
p, li {
p,
li {
strong {
font-weight: bold;
}
}
p, li {
p,
li {
em {
font-style: italic;
}
}
ul, ol, blockquote {
ul,
ol,
blockquote {
margin-bottom: 20px;
margin-left: 15px;
}