* MM-30164 fix safe area insets * Fix unit test setup mock for react-native-device-info * Add insets for edit profile screen * Fix about screen * Fix theme screen * Lock phone screen to portrait * fix unit tests * Fix autocomplete layout
35 lines
1 KiB
JavaScript
35 lines
1 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {editPost} from '@mm-redux/actions/posts';
|
|
import {getConfig} from '@mm-redux/selectors/entities/general';
|
|
import {getTheme} from '@mm-redux/selectors/entities/preferences';
|
|
|
|
import {MAX_MESSAGE_LENGTH_FALLBACK} from '@constants/post_draft';
|
|
import {getDimensions} from '@selectors/device';
|
|
|
|
import EditPost from './edit_post';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
const config = getConfig(state);
|
|
|
|
return {
|
|
...getDimensions(state),
|
|
maxMessageLength: (config && parseInt(config.MaxPostSize || 0, 10)) || MAX_MESSAGE_LENGTH_FALLBACK,
|
|
post: ownProps.post,
|
|
theme: getTheme(state),
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
editPost,
|
|
}, dispatch),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(EditPost);
|