Skip to content

Commit

Permalink
Merge pull request Expensify#32166 from dukenv0307/fix/31792
Browse files Browse the repository at this point in the history
Allow split bill for hidden user
  • Loading branch information
luacmartins authored Nov 30, 2023
2 parents b9ecec4 + 0a457f4 commit a6eb7f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/components/DisplayNames/index.native.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import DisplayNamesProps from './types';

// As we don't have to show tooltips of the Native platform so we simply render the full display names list.
function DisplayNames({accessibilityLabel, fullTitle, textStyles = [], numberOfLines = 1}: DisplayNamesProps) {
const {translate} = useLocalize();
return (
<Text
accessibilityLabel={accessibilityLabel}
style={textStyles}
numberOfLines={numberOfLines}
>
{fullTitle}
{fullTitle || translate('common.hidden')}
</Text>
);
}
Expand Down
8 changes: 6 additions & 2 deletions src/components/DisplayNames/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
import React from 'react';
import useLocalize from '@hooks/useLocalize';
import DisplayNamesWithoutTooltip from './DisplayNamesWithoutTooltip';
import DisplayNamesWithToolTip from './DisplayNamesWithTooltip';
import DisplayNamesProps from './types';

function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips}: DisplayNamesProps) {
const {translate} = useLocalize();
const title = fullTitle || translate('common.hidden');

if (!tooltipEnabled) {
return (
<DisplayNamesWithoutTooltip
textStyles={textStyles}
numberOfLines={numberOfLines}
fullTitle={fullTitle}
fullTitle={title}
/>
);
}

return (
<DisplayNamesWithToolTip
shouldUseFullTitle={shouldUseFullTitle}
fullTitle={fullTitle}
fullTitle={title}
displayNamesWithTooltips={displayNamesWithTooltips}
textStyles={textStyles}
numberOfLines={numberOfLines}
Expand Down
11 changes: 4 additions & 7 deletions src/pages/iou/steps/MoneyRequestConfirmPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ function MoneyRequestConfirmPage(props) {

const participants = useMemo(
() =>
_.chain(props.iou.participants)
.map((participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);
})
.filter((participant) => !!participant.login || !!participant.text)
.value(),
_.map(props.iou.participants, (participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);
}),
[props.iou.participants, personalDetails],
);
const isPolicyExpenseChat = useMemo(() => ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(props.report)), [props.report]);
Expand Down

0 comments on commit a6eb7f9

Please sign in to comment.