Skip to content

Commit

Permalink
Merge pull request #49315 from Expensify/aldo_use-you-if-you-are-appr…
Browse files Browse the repository at this point in the history
…over

Replace email by You
  • Loading branch information
lakchote authored Sep 18, 2024
2 parents 1a3ca5c + 18ce38b commit 839fb44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libs/NextStepUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ function parseMessage(messages: Message[] | undefined) {

messages?.forEach((part) => {
const isEmail = Str.isValidEmail(part.text);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
let tagType = part.type ?? 'span';
let content = Str.safeEscape(part.text);

if (isEmail) {
if (currentUserEmail === part.text || part.clickToCopyText === currentUserEmail) {
tagType = 'strong';
content = 'You';
} else if (isEmail) {
tagType = 'next-step-email';
content = EmailUtils.prefixMailSeparatorsWithBreakOpportunities(content);
}
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/ReportNextStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ type Message = {

/** Action for the user to take */
action?: string;

/** The text to be copied when the user clicks this section */
clickToCopyText?: string;
};

/** Model of report next step button data */
Expand Down

0 comments on commit 839fb44

Please sign in to comment.