Skip to content

Commit

Permalink
Remove unused attachment placeholder code
Browse files Browse the repository at this point in the history
  • Loading branch information
cubuspl42 committed Aug 21, 2023
1 parent 03cf0b1 commit 82713e6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ function ReportActionItem(props) {
<View
style={StyleUtils.getReportActionItemStyle(
hovered || isWhisper || isContextMenuActive || props.draftMessage,
// TODO: Is `action.isLoading` ever truthy?
(props.network.isOffline && props.action.isLoading) || props.action.error,
)}
>
Expand Down
19 changes: 0 additions & 19 deletions src/pages/home/report/ReportActionItemFragment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo} from 'react';
import {ActivityIndicator, View} from 'react-native';
import PropTypes from 'prop-types';
import Str from 'expensify-common/lib/str';
import reportActionFragmentPropTypes from './reportActionFragmentPropTypes';
Expand Down Expand Up @@ -46,9 +45,6 @@ const propTypes = {
source: PropTypes.string,
}),

/** Does this fragment belong to a reportAction that has not yet loaded? */
loading: PropTypes.bool,

/** The reportAction's source */
source: PropTypes.oneOf(['Chronos', 'email', 'ios', 'android', 'web', 'email', '']),

Expand Down Expand Up @@ -78,7 +74,6 @@ const defaultProps = {
type: '',
source: '',
},
loading: false,
isSingleLine: false,
source: '',
style: [],
Expand All @@ -89,20 +84,6 @@ const defaultProps = {
function ReportActionItemFragment(props) {
switch (props.fragment.type) {
case 'COMMENT': {
// If this is an attachment placeholder, return the placeholder component
if (props.isAttachment && props.loading) {
return Str.isImage(props.attachmentInfo.name) ? (
<RenderHTML html={`<comment><img src="${props.attachmentInfo.source}" data-expensify-preview-modal-disabled="true"/></comment>`} />
) : (
<View style={[styles.chatItemAttachmentPlaceholder]}>
<ActivityIndicator
size="large"
color={themeColors.textSupporting}
style={[styles.flex1]}
/>
</View>
);
}
const {html, text} = props.fragment;

// Threaded messages display "[Deleted message]" instead of being hidden altogether.
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/report/ReportActionItemMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function ReportActionItemMessage(props) {
pendingAction={props.action.pendingAction}
source={lodashGet(props.action, 'originalMessage.source')}
accountID={props.action.actorAccountID}
loading={props.action.isLoading}
style={props.style}
/>
))
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/report/ReportActionItemSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ function ReportActionItemSingle(props) {
accountID={actorAccountID}
fragment={fragment}
isAttachment={props.action.isAttachment}
isLoading={props.action.isLoading}
delegateAccountID={props.action.delegateAccountID}
isSingleLine
actorIcon={icon}
Expand Down

0 comments on commit 82713e6

Please sign in to comment.