Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused attachment placeholder code #25557

Merged
merged 11 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
cubuspl42 marked this conversation as resolved.
Show resolved Hide resolved
)}
>
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