Skip to content

Commit

Permalink
Add tooltips and nav to bill details
Browse files Browse the repository at this point in the history
  • Loading branch information
esh-g committed Jun 14, 2023
1 parent 9b94847 commit 685169c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,17 @@ function MoneyRequestConfirmationList(props) {
[props.session.email],
);

/**
* Navigate to details page of selected user
* @param {Object} option
*/
const navigateToUserDetail = (option) => {
if (!option.login) {
return;
}
Navigation.navigate(ROUTES.getDetailsRoute(option.login));
};

/**
* @param {String} paymentMethod
*/
Expand Down Expand Up @@ -290,12 +301,13 @@ function MoneyRequestConfirmationList(props) {
<OptionsSelector
sections={optionSelectorSections}
value=""
onSelectRow={canModifyParticipants ? toggleOption : undefined}
onSelectRow={canModifyParticipants ? toggleOption : navigateToUserDetail}
onConfirmSelection={confirm}
selectedOptions={selectedOptions}
canSelectMultipleOptions={canModifyParticipants}
disableArrowKeysActions={!canModifyParticipants}
boldStyle
showTitleTooltip
shouldTextInputAppearBelowOptions
shouldShowTextInput={false}
shouldUseStyleForChildren={false}
Expand Down
5 changes: 4 additions & 1 deletion src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ class OptionRow extends Component {
const isMultipleParticipant = lodashGet(this.props.option, 'participantsList.length', 0) > 1;

// We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips((this.props.option.participantsList || []).slice(0, 10), isMultipleParticipant);
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(
(this.props.option.participantsList || this.props.option.login ? [this.props.option] : []).slice(0, 10),

This comment has been minimized.

Copy link
@allroundexperts

allroundexperts Jun 29, 2023

Contributor

This changed caused this issue. For group chats we should be using participantList directly if available.

isMultipleParticipant,
);
let subscriptColor = themeColors.appBG;
if (this.props.optionIsFocused) {
subscriptColor = focusedBackgroundColor;
Expand Down

0 comments on commit 685169c

Please sign in to comment.