2017-05-03 00:04:16 +00:00
|
|
|
import React from 'react';
|
2016-11-13 18:08:52 +00:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2017-03-24 02:50:30 +00:00
|
|
|
import UploadProgressContainer from '../containers/upload_progress_container';
|
2017-09-28 13:31:31 +00:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
import UploadContainer from '../containers/upload_container';
|
2019-05-03 02:34:55 +00:00
|
|
|
import SensitiveButtonContainer from '../containers/sensitive_button_container';
|
2019-08-15 13:13:26 +00:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2016-11-18 14:36:16 +00:00
|
|
|
|
2017-09-28 13:31:31 +00:00
|
|
|
export default class UploadForm extends ImmutablePureComponent {
|
2016-11-13 18:08:52 +00:00
|
|
|
|
2017-05-12 12:44:10 +00:00
|
|
|
static propTypes = {
|
2017-09-28 13:31:31 +00:00
|
|
|
mediaIds: ImmutablePropTypes.list.isRequired,
|
2017-05-12 12:44:10 +00:00
|
|
|
};
|
|
|
|
|
2016-11-13 18:08:52 +00:00
|
|
|
render () {
|
2017-09-28 13:31:31 +00:00
|
|
|
const { mediaIds } = this.props;
|
2016-11-13 18:08:52 +00:00
|
|
|
|
|
|
|
return (
|
2017-04-23 02:26:55 +00:00
|
|
|
<div className='compose-form__upload-wrapper'>
|
2019-08-15 13:13:26 +00:00
|
|
|
<UploadProgressContainer icon='upload' message={<FormattedMessage id='upload_progress.label' defaultMessage='Uploading…' />} />
|
2017-09-28 13:31:31 +00:00
|
|
|
|
|
|
|
<div className='compose-form__uploads-wrapper'>
|
|
|
|
{mediaIds.map(id => (
|
|
|
|
<UploadContainer id={id} key={id} />
|
|
|
|
))}
|
|
|
|
</div>
|
2019-05-03 02:34:55 +00:00
|
|
|
|
|
|
|
{!mediaIds.isEmpty() && <SensitiveButtonContainer />}
|
2016-11-13 18:08:52 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-04-21 18:05:35 +00:00
|
|
|
}
|