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

Add tooltips and nav to bill details #20746

Merged
merged 3 commits into from
Jun 15, 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
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
esh-g marked this conversation as resolved.
Show resolved Hide resolved
* @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),
isMultipleParticipant,
);
let subscriptColor = themeColors.appBG;
if (this.props.optionIsFocused) {
subscriptColor = focusedBackgroundColor;
Expand Down