gab-social/app/javascript/gabsocial/features/compose/components/gif_form.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-03-26 03:11:32 +00:00
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import ProgressBar from '../../../../components/progress_bar'
2020-03-27 22:57:03 +00:00
import Upload from '../media_upload_item'
2020-03-26 03:11:32 +00:00
import SensitiveMediaButton from '../sensitive_media_button'
2020-04-11 23:29:19 +01:00
const mapStateToProps = (state) => ({
mediaIds: state.getIn(['compose', 'media_attachments']).map(item => item.get('id')),
2020-03-26 03:11:32 +00:00
isUploading: state.getIn(['compose', 'is_uploading']),
uploadProgress: state.getIn(['compose', 'progress']),
});
2020-02-25 16:04:44 +00:00
export default
@connect(mapStateToProps)
2020-04-17 06:35:46 +01:00
class GifForm extends ImmutablePureComponent {
2019-07-02 08:10:25 +01:00
static propTypes = {
mediaIds: ImmutablePropTypes.list.isRequired,
2020-03-26 03:11:32 +00:00
isUploading: PropTypes.bool,
uploadProgress: PropTypes.number,
2019-07-02 08:10:25 +01:00
};
render () {
2020-03-26 03:11:32 +00:00
const {
mediaIds,
isUploading,
2020-04-08 02:06:59 +01:00
uploadProgress,
2020-03-26 03:11:32 +00:00
} = this.props
2019-07-02 08:10:25 +01:00
return (
2020-03-26 03:11:32 +00:00
<div className={_s.default}>
<div className={[_s.default, _s.flexRow, _s.flexWrap].join(' ')}>
2020-04-17 06:35:46 +01:00
<Upload id={id} key={id} />
2019-07-02 08:10:25 +01:00
</div>
</div>
2020-03-26 03:11:32 +00:00
)
2019-07-02 08:10:25 +01:00
}
}