Skip to content

Commit

Permalink
Merge pull request #27439 from c3024/27265-show-workspace-name-in-QRC…
Browse files Browse the repository at this point in the history
…ode-page-for-policyExpenseChat
  • Loading branch information
dangrous authored Sep 21, 2023
2 parents c775e12 + ec6041c commit ba47a47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/ShareCodePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ class ShareCodePage extends React.Component {

render() {
const isReport = this.props.report != null && this.props.report.reportID != null;
const subtitle = ReportUtils.getChatRoomSubtitle(this.props.report);

const title = isReport ? ReportUtils.getReportName(this.props.report) : this.props.currentUserPersonalDetails.displayName;
const formattedEmail = this.props.formatPhoneNumber(this.props.session.email);
const subtitle = isReport ? ReportUtils.getParentNavigationSubtitle(this.props.report).workspaceName || ReportUtils.getChatRoomSubtitle(this.props.report) : formattedEmail;
const urlWithTrailingSlash = Url.addTrailingForwardSlash(this.props.environmentURL);
const url = isReport
? `${urlWithTrailingSlash}${ROUTES.getReportRoute(this.props.report.reportID)}`
: `${urlWithTrailingSlash}${ROUTES.getProfileRoute(this.props.session.accountID)}`;

const platform = getPlatform();
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;
const formattedEmail = this.props.formatPhoneNumber(this.props.session.email);

return (
<ScreenWrapper>
Expand All @@ -65,8 +65,8 @@ class ShareCodePage extends React.Component {
<QRShareWithDownload
ref={this.qrCodeRef}
url={url}
title={isReport ? this.props.report.reportName : this.props.currentUserPersonalDetails.displayName}
subtitle={isReport ? subtitle : formattedEmail}
title={title}
subtitle={subtitle}
logo={isReport ? expensifyLogo : UserUtils.getAvatarUrl(this.props.currentUserPersonalDetails.avatar, this.props.currentUserPersonalDetails.accountID)}
logoRatio={isReport ? CONST.QR.EXPENSIFY_LOGO_SIZE_RATIO : CONST.QR.DEFAULT_LOGO_SIZE_RATIO}
logoMarginRatio={isReport ? CONST.QR.EXPENSIFY_LOGO_MARGIN_RATIO : CONST.QR.DEFAULT_LOGO_MARGIN_RATIO}
Expand Down

0 comments on commit ba47a47

Please sign in to comment.