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

Make tapping the entire IOU preview component open the IOU Details modal #3541

Merged
merged 5 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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/components/ReportActionItemIOUAction.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const ReportActionItemIOUAction = ({
iouReportID={action.originalMessage.IOUReportID} iouReportID={action.originalMessage.IOUReportID}
chatReportID={chatReportID} chatReportID={chatReportID}
onPayButtonPressed={launchDetailsModal} onPayButtonPressed={launchDetailsModal}
onPreviewPressed={launchDetailsModal}
/> />
)} )}
</> </>
Expand Down
4 changes: 4 additions & 0 deletions src/components/ReportActionItemIOUPreview.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ActivityIndicator, ActivityIndicator,
TouchableOpacity, TouchableOpacity,
Text, Text,
TouchableWithoutFeedback,
} from 'react-native'; } from 'react-native';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Str from 'expensify-common/lib/str'; import Str from 'expensify-common/lib/str';
Expand Down Expand Up @@ -81,6 +82,7 @@ const ReportActionItemIOUPreview = ({
session, session,
shouldHidePayButton, shouldHidePayButton,
onPayButtonPressed, onPayButtonPressed,
onPreviewPressed,
translate, translate,
}) => { }) => {
// Usually the parent determines whether the IOU Preview is displayed. But as the iouReport total cannot be known // Usually the parent determines whether the IOU Preview is displayed. But as the iouReport total cannot be known
Expand Down Expand Up @@ -110,6 +112,7 @@ const ReportActionItemIOUPreview = ({
const ownerAvatar = lodashGet(personalDetails, [ownerEmail, 'avatar'], ''); const ownerAvatar = lodashGet(personalDetails, [ownerEmail, 'avatar'], '');
const cachedTotal = iouReport.cachedTotal ? iouReport.cachedTotal.replace(/[()]/g, '') : ''; const cachedTotal = iouReport.cachedTotal ? iouReport.cachedTotal.replace(/[()]/g, '') : '';
return ( return (
<TouchableWithoutFeedback onPress={onPreviewPressed}>
<View style={styles.iouPreviewBox}> <View style={styles.iouPreviewBox}>
{reportIsLoading {reportIsLoading
? <ActivityIndicator style={styles.iouPreviewBoxLoading} color={themeColors.text} /> ? <ActivityIndicator style={styles.iouPreviewBoxLoading} color={themeColors.text} />
Expand Down Expand Up @@ -160,6 +163,7 @@ const ReportActionItemIOUPreview = ({
</View> </View>
)} )}
</View> </View>
</TouchableWithoutFeedback>
); );
}; };


Expand Down
1 change: 1 addition & 0 deletions src/styles/styles.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ const styles = {
marginTop: 16, marginTop: 16,
maxWidth: variables.sideBarWidth, maxWidth: variables.sideBarWidth,
width: '100%', width: '100%',
cursor: 'pointer',
}, },


iouPreviewBoxLoading: { iouPreviewBoxLoading: {
Expand Down