import PropTypes from 'prop-types'; import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; import { openModal } from 'soapbox/actions/modals'; import Bundle from 'soapbox/features/ui/components/bundle'; import { MediaGallery } from 'soapbox/features/ui/util/async-components'; export default @connect() class AttachmentThumbs extends ImmutablePureComponent { static propTypes = { dispatch: PropTypes.func.isRequired, media: ImmutablePropTypes.list.isRequired, onClick: PropTypes.func, sensitive: PropTypes.bool, }; renderLoading() { return
; } onOpenMedia = (media, index) => { this.props.dispatch(openModal('MEDIA', { media, index })); } render() { const { media, onClick, sensitive } = this.props; return (
{Component => ( )} {onClick && (
)}
); } }