From d6a7e38e565b2b8146637d68b17221e2ae893cec Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 31 May 2022 12:49:24 -0500 Subject: [PATCH] DetailedStatus: use StatusMedia component --- .../status/components/detailed-status.tsx | 93 ++----------------- 1 file changed, 8 insertions(+), 85 deletions(-) diff --git a/app/soapbox/features/status/components/detailed-status.tsx b/app/soapbox/features/status/components/detailed-status.tsx index 093e0a896..f0b34ea4a 100644 --- a/app/soapbox/features/status/components/detailed-status.tsx +++ b/app/soapbox/features/status/components/detailed-status.tsx @@ -5,18 +5,14 @@ import { FormattedMessage, injectIntl, WrappedComponentProps as IntlProps } from import { FormattedDate } from 'react-intl'; import Icon from 'soapbox/components/icon'; -import MediaGallery from 'soapbox/components/media_gallery'; +import StatusMedia from 'soapbox/components/status-media'; import StatusReplyMentions from 'soapbox/components/status-reply-mentions'; import StatusContent from 'soapbox/components/status_content'; import { HStack, Text } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import QuotedStatus from 'soapbox/features/status/containers/quoted_status_container'; +import scheduleIdleTask from 'soapbox/features/ui/util/schedule_idle_task'; -import Audio from '../../audio'; -import scheduleIdleTask from '../../ui/util/schedule_idle_task'; -import Video from '../../video'; - -import Card from './card'; import StatusInteractionBar from './status-interaction-bar'; import type { List as ImmutableList } from 'immutable'; @@ -114,90 +110,12 @@ class DetailedStatus extends ImmutablePureComponent 0 && firstAttachment) { - if (size === 1 && firstAttachment.type === 'video') { - const video = firstAttachment; - if (video.external_video_id && status.card?.html) { - const { mediaWrapperWidth } = this.state; - - const getHeight = (): number => { - const width = Number(video.meta.getIn(['original', 'width'])); - const height = Number(video.meta.getIn(['original', 'height'])); - return Number(mediaWrapperWidth) / (width / height); - }; - - const height = getHeight(); - - media = ( -
-
-
- ); - } else { - media = ( -