import React from 'react' import PropTypes from 'prop-types' import { injectIntl } from 'react-intl' import ImmutablePropTypes from 'react-immutable-proptypes' import ImmutablePureComponent from 'react-immutable-pure-component' import StatusCard from './status_card' import { MediaGallery, Video } from '../features/ui/util/async_components' import Poll from './poll' // We use the component (and not the container) since we do not want // to use the progress bar to show download progress import Bundle from '../features/ui/util/bundle' class StatusMedia extends ImmutablePureComponent { // Avoid checking props that are functions (and whose equality will always // evaluate to false. See react-immutable-pure-component for usage. updateOnProps = [ 'status', 'isChild', 'isComment', 'cacheWidth', 'defaultWidth', 'visible', 'width', 'isComposeModalOpen', ] renderLoadingMedia() { return
} render() { const { status, isChild, isComment, onOpenMedia, onOpenVideo, width, onToggleVisibility, visible, defaultWidth, cacheWidth, isComposeModalOpen, isStatusCard, } = this.props if (!status) return null let media = null if (status.get('poll')) { media =