sforkowany z mirror/soapbox
Pass maxTootChars from ComposeFormContainer instead of ComposeForm
rodzic
d9e6efbe79
commit
808e05a03f
|
@ -1,5 +1,4 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import CharacterCounter from './character_counter';
|
import CharacterCounter from './character_counter';
|
||||||
import Button from '../../../components/button';
|
import Button from '../../../components/button';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
@ -32,14 +31,7 @@ const messages = defineMessages({
|
||||||
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
|
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
export default @injectIntl
|
||||||
return {
|
|
||||||
maxTootChars: state.getIn(['instance', 'max_toot_chars']),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default @connect(mapStateToProps)
|
|
||||||
@injectIntl
|
|
||||||
class ComposeForm extends ImmutablePureComponent {
|
class ComposeForm extends ImmutablePureComponent {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
|
|
|
@ -26,6 +26,7 @@ const mapStateToProps = state => ({
|
||||||
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
||||||
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
|
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
|
||||||
isModalOpen: state.get('modal').modalType === 'COMPOSE',
|
isModalOpen: state.get('modal').modalType === 'COMPOSE',
|
||||||
|
maxTootChars: state.getIn(['instance', 'max_toot_chars']),
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
|
Ładowanie…
Reference in New Issue