mattermost-mobile/app/components/post_draft/uploads/index.js
Elias Nahum 48f1875cf1
MM-23090 MM-26078 && MM-26876 Refactor post draft component (#4621)
* Refactor post draft component
Re-styled ReadOnly channels
Remove filename from upload error

* Update canSubmit based on file attachment changes

* Fix error message for max file size

* Fix select autocomplete values on iOS

* Style readonly and refactor accessory view for iOS

* Make PostDraft scrollViewNativeID prop not required

* Update ReadOnly to have a background with 0.40 opacity

* Update max file size error message

* Fix shift+enter with HW keyboard
2020-08-06 19:39:25 -04:00

34 lines
1.2 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {handleRemoveLastFile, initUploadFiles} from '@actions/views/file_upload';
import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels';
import {getConfig} from '@mm-redux/selectors/entities/general';
import {getDimensions} from '@selectors/device';
import {checkForFileUploadingInChannel} from '@selectors/file';
import {getAllowedServerMaxFileSize} from '@utils/file';
import Uploads from './uploads';
function mapStateToProps(state, ownProps) {
const {deviceHeight} = getDimensions(state);
const channelId = getCurrentChannelId(state);
const config = getConfig(state);
return {
channelId,
channelIsLoading: state.views.channel.loading,
deviceHeight,
filesUploadingForCurrentChannel: checkForFileUploadingInChannel(state, channelId, ownProps.rootId),
maxFileSize: getAllowedServerMaxFileSize(config),
};
}
const mapDispatchToProps = {
handleRemoveLastFile,
initUploadFiles,
};
export default connect(mapStateToProps, mapDispatchToProps)(Uploads);