Skip to content

Commit

Permalink
Merge pull request #29659 from Expensify/georgia-fixSmartScanBanner
Browse files Browse the repository at this point in the history
[CP Staging] - Only show Pending Banner for ECard Transactions

(cherry picked from commit 5a5b890)
  • Loading branch information
mountiny authored and OSBotify committed Oct 16, 2023
1 parent e3ac764 commit ad68cc1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ const CONST = {
HAND_ICON_HEIGHT: 152,
HAND_ICON_WIDTH: 200,
SHUTTER_SIZE: 90,
MAX_REPORT_PREVIEW_RECEIPTS: 3,
},
REPORT: {
MAXIMUM_PARTICIPANTS: 8,
Expand Down
2 changes: 1 addition & 1 deletion src/components/MoneyRequestHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction,
}, [parentReportAction, setIsDeleteModalVisible]);

const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);
const isPending = TransactionUtils.isPending(transaction);
const isPending = TransactionUtils.isExpensifyCardTransaction(transaction) && TransactionUtils.isPending(transaction);

const canModifyRequest = isActionOwner && !isSettled && !isApproved && !ReportActionsUtils.isDeletedAction(parentReportAction);

Expand Down
6 changes: 4 additions & 2 deletions src/components/ReportActionItem/ReportActionItemImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ const defaultProps = {
*/

function ReportActionItemImages({images, size, total, isHovered}) {
const numberOfShownImages = size || images.length;
const shownImages = images.slice(0, size);
// Calculate the number of images to be shown, limited by the value of 'size' (if defined)
// or the total number of images.
const numberOfShownImages = Math.min(size || images.length, images.length);
const shownImages = images.slice(0, numberOfShownImages);
const remaining = (total || images.length) - size;
const MAX_REMAINING = 9;

Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/ReportPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ function ReportPreview(props) {
{hasReceipts && (
<ReportActionItemImages
images={lastThreeReceipts}
size={3}
total={transactionsWithReceipts.length}
isHovered={props.isHovered || isScanning}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
/>
)}
<View style={styles.reportPreviewBoxBody}>
Expand Down
6 changes: 1 addition & 5 deletions src/pages/iou/SplitBillDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ONYXKEYS from '../../ONYXKEYS';
import CONST from '../../CONST';
import * as OptionsListUtils from '../../libs/OptionsListUtils';
import personalDetailsPropType from '../personalDetailsPropType';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
import compose from '../../libs/compose';
import reportActionPropTypes from '../home/report/reportActionPropTypes';
import reportPropTypes from '../reportPropTypes';
Expand Down Expand Up @@ -61,8 +60,6 @@ const propTypes = {
/** Currently logged in user email */
email: PropTypes.string,
}).isRequired,

...withLocalizePropTypes,
};

const defaultProps = {
Expand Down Expand Up @@ -112,7 +109,7 @@ function SplitBillDetailsPage(props) {
return (
<ScreenWrapper testID={SplitBillDetailsPage.displayName}>
<FullPageNotFoundView shouldShow={_.isEmpty(reportID) || _.isEmpty(reportAction) || _.isEmpty(props.transaction)}>
<HeaderWithBackButton title={props.translate('common.details')} />
<HeaderWithBackButton title={translate('common.details')} />
<View
pointerEvents="box-none"
style={[styles.containerWithSpaceBetween]}
Expand Down Expand Up @@ -155,7 +152,6 @@ SplitBillDetailsPage.defaultProps = defaultProps;
SplitBillDetailsPage.displayName = 'SplitBillDetailsPage';

export default compose(
withLocalize,
withReportAndReportActionOrNotFound,
withOnyx({
report: {
Expand Down

0 comments on commit ad68cc1

Please sign in to comment.