Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ac713bc
refactor splitphrase phoneError
PiyushChandra17 Jun 21, 2025
c160266
removed unneccessary dependency
PiyushChandra17 Jun 21, 2025
94593a1
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jun 24, 2025
2fda502
Merge branch 'main' of https://github.com/Expensify/App into PiyushCh…
PiyushChandra17 Jun 25, 2025
c489a54
Fix merge conflict
PiyushChandra17 Jun 25, 2025
2da19ef
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jun 25, 2025
0572fc6
added styles directly in languages
PiyushChandra17 Jun 25, 2025
bd9e72e
update font-size in link
PiyushChandra17 Jun 26, 2025
d97f961
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jun 30, 2025
81f983b
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jul 1, 2025
06bfb7d
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 1, 2025
71e2463
Fix underline link
PiyushChandra17 Jul 1, 2025
4ebf4fa
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jul 3, 2025
9b5009c
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 3, 2025
40c4114
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jul 7, 2025
a438f6f
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 8, 2025
f3edf95
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jul 11, 2025
ea6e54e
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 11, 2025
81a7cf9
updated phoneError alert text
PiyushChandra17 Jul 11, 2025
3aadcbe
Merge branch 'PiyushChandra17/refactor/splitphrase-phoneError' of htt…
PiyushChandra17 Jul 11, 2025
8d7f67d
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jul 12, 2025
e363b2d
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 14, 2025
26d1be7
Fix readable tag name
PiyushChandra17 Jul 14, 2025
f509c3d
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 15, 2025
58413ba
removed duplicate dependency
PiyushChandra17 Jul 15, 2025
ee82f4b
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 25, 2025
c954fdc
Update rbr HTML tag
PiyushChandra17 Jul 25, 2025
d3e66ec
Fix spell check
PiyushChandra17 Jul 25, 2025
313e998
Fix spell check error
PiyushChandra17 Jul 25, 2025
60a0154
Update cspell.json
PiyushChandra17 Jul 25, 2025
d1fa252
Update cspell.json 01
PiyushChandra17 Jul 25, 2025
425fb53
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 27, 2025
8a90478
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Jul 28, 2025
6c0ea75
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 29, 2025
733e161
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Jul 30, 2025
ac8661c
removed Text style
PiyushChandra17 Jul 30, 2025
f3c5cda
Fix eslint and prettier check
PiyushChandra17 Jul 30, 2025
9408892
Merge branch 'Expensify:main' into PiyushChandra17/refactor/splitphra…
PiyushChandra17 Aug 4, 2025
ced497b
Merge branch 'main' into PiyushChandra17/refactor/splitphrase-phoneError
PiyushChandra17 Aug 12, 2025
9fa03dd
Modified cpell.json && MD file
PiyushChandra17 Aug 12, 2025
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
21 changes: 6 additions & 15 deletions src/components/BookTravelButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Str} from 'expensify-common';
import type {ReactElement} from 'react';
import React, {useCallback, useEffect, useState} from 'react';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useEnvironment from '@hooks/useEnvironment';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
Expand All @@ -22,8 +23,7 @@ import Button from './Button';
import ConfirmModal from './ConfirmModal';
import DotIndicatorMessage from './DotIndicatorMessage';
import {RocketDude} from './Icon/Illustrations';
import Text from './Text';
import TextLink from './TextLink';
import RenderHTML from './RenderHTML';

type BookTravelButtonProps = {
text: string;
Expand All @@ -49,6 +49,8 @@ function BookTravelButton({text, shouldRenderErrorMessageBelowButton = false, se
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {translate} = useLocalize();
const {environmentURL} = useEnvironment();
const phoneErrorMethodsRoute = `${environmentURL}/${ROUTES.SETTINGS_CONTACT_METHODS.getRoute(Navigation.getActiveRoute())}`;
const [activePolicyID, activePolicyIDMetadata] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
const isUserValidated = account?.validated ?? false;
Expand Down Expand Up @@ -88,18 +90,7 @@ function BookTravelButton({text, shouldRenderErrorMessageBelowButton = false, se

// The primary login of the user is where Spotnana sends the emails with booking confirmations, itinerary etc. It can't be a phone number.
if (!primaryContactMethod || Str.isSMSLogin(primaryContactMethod)) {
setErrorMessage(
<Text style={[styles.flexRow, StyleUtils.getDotIndicatorTextStyles(true)]}>
<Text style={[StyleUtils.getDotIndicatorTextStyles(true)]}>{translate('travel.phoneError.phrase1')}</Text>{' '}
<TextLink
style={[StyleUtils.getDotIndicatorTextStyles(true), styles.link]}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(Navigation.getActiveRoute()))}
>
{translate('travel.phoneError.link')}
</TextLink>
<Text style={[StyleUtils.getDotIndicatorTextStyles(true)]}>{translate('travel.phoneError.phrase2')}</Text>
</Text>,
);
setErrorMessage(<RenderHTML html={translate('travel.phoneError', {phoneErrorMethodsRoute})} />);
return;
}

Expand Down Expand Up @@ -154,10 +145,10 @@ function BookTravelButton({text, shouldRenderErrorMessageBelowButton = false, se
travelSettings?.lastTravelSignupRequestTime,
isBetaEnabled,
styles.flexRow,
styles.link,
StyleUtils,
translate,
isUserValidated,
phoneErrorMethodsRoute,
]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) {
styles.link,
{
fontSize: HTMLEngineUtils.getFontSizeOfRBRChild(tnode),
textDecorationLine: 'underline',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allgandalf To remove the underline from the link

},
];
}
Expand Down
8 changes: 3 additions & 5 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3332,11 +3333,8 @@ const translations = {
tripSummary: 'Reisezusammenfassung',
departs: 'Abfahrten',
errorMessage: 'Etwas ist schiefgelaufen. Bitte versuchen Sie es später noch einmal.',
phoneError: {
phrase1: 'Bitte',
link: 'fügen Sie eine Arbeits-E-Mail als Ihren primären Login hinzu',
phrase2: 'um Reisen zu buchen.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr>Bitte <a href="${phoneErrorMethodsRoute}">fügen Sie eine Arbeits-E-Mail als primäres Login hinzu</a>, um Reisen zu buchen.</rbr>`,
domainSelector: {
title: 'Domain',
subtitle: 'Wählen Sie eine Domain für die Einrichtung von Expensify Travel.',
Expand Down
7 changes: 2 additions & 5 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3330,11 +3331,7 @@ const translations = {
tripSummary: 'Trip summary',
departs: 'Departs',
errorMessage: 'Something went wrong. Please try again later.',
phoneError: {
phrase1: 'Please',
link: 'add a work email as your primary login',
phrase2: ' to book travel.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) => `<rbr>Please <a href="${phoneErrorMethodsRoute}">add a work email as your primary login</a> to book travel.</rbr>`,
domainSelector: {
title: 'Domain',
subtitle: 'Choose a domain for Expensify Travel setup.',
Expand Down
8 changes: 3 additions & 5 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3318,11 +3319,8 @@ const translations = {
tripSummary: 'Resumen del viaje',
departs: 'Sale',
errorMessage: 'Ha ocurrido un error. Por favor, inténtalo mas tarde.',
phoneError: {
phrase1: 'Para reservar viajes,',
link: 'añade una dirección de correo electrónico de trabajo',
phrase2: '.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr>Para reservar viajes, <a href="${phoneErrorMethodsRoute}">añade una dirección de correo electrónico de trabajo</a>.</rbr>`,
domainSelector: {
title: 'Dominio',
subtitle: 'Elige un dominio para configurar Expensify Travel.',
Expand Down
8 changes: 3 additions & 5 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3340,11 +3341,8 @@ const translations = {
tripSummary: 'Résumé du voyage',
departs: 'Départs',
errorMessage: 'Un problème est survenu. Veuillez réessayer plus tard.',
phoneError: {
phrase1: "S'il vous plaît",
link: 'ajoutez un e-mail professionnel comme identifiant principal',
phrase2: 'pour réserver un voyage.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr>Veuillez <a href="${phoneErrorMethodsRoute}">ajouter un courriel professionnel comme identifiant principal</a> pour réserver un voyage.</rbr>`,
domainSelector: {
title: 'Domaine',
subtitle: "Choisissez un domaine pour la configuration d'Expensify Travel.",
Expand Down
8 changes: 3 additions & 5 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3346,11 +3347,8 @@ const translations = {
tripSummary: 'Riepilogo del viaggio',
departs: 'Parte',
errorMessage: 'Qualcosa è andato storto. Per favore riprova più tardi.',
phoneError: {
phrase1: 'Per favore',
link: "aggiungi un'email di lavoro come login principale",
phrase2: 'per prenotare viaggi.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr><a href="${phoneErrorMethodsRoute}">Aggiungete un'e-mail di lavoro come login principale</a> per prenotare i viaggi.</rbr>`,
domainSelector: {
title: 'Dominio',
subtitle: 'Scegli un dominio per la configurazione di Expensify Travel.',
Expand Down
8 changes: 3 additions & 5 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3348,11 +3349,8 @@ const translations = {
tripSummary: '旅行概要',
departs: '出発します',
errorMessage: '問題が発生しました。後でもう一度お試しください。',
phoneError: {
phrase1: 'お願いします',
link: '勤務用メールアドレスをプライマリログインとして追加してください。',
phrase2: '旅行を予約するために。',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr>旅行予約のための<a href="${phoneErrorMethodsRoute}">プライマリログインとして、仕事の電子メールを追加して</a>ください。</rbr>`,
domainSelector: {
title: 'ドメイン',
subtitle: 'Expensify Travelのセットアップ用にドメインを選択してください。',
Expand Down
8 changes: 3 additions & 5 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3352,11 +3353,8 @@ const translations = {
tripSummary: 'Reisoverzicht',
departs: 'Vertrekt',
errorMessage: 'Er is iets misgegaan. Probeer het later opnieuw.',
phoneError: {
phrase1: 'Alstublieft',
link: 'voeg een werk e-mailadres toe als je primaire login',
phrase2: 'om te reizen boeken.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr><a href="${phoneErrorMethodsRoute}">Voeg een werkmail toe als uw primaire login</a> om reizen te boeken.</rbr>`,
domainSelector: {
title: 'Domein',
subtitle: 'Kies een domein voor de installatie van Expensify Travel.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ type SettleExpensifyCardParams = {
formattedAmount: string;
};

type PhoneErrorRouteParams = {
phoneErrorMethodsRoute: string;
};

type WorkspacesListRouteParams = {
workspacesListRoute: string;
};
Expand Down Expand Up @@ -1128,6 +1132,7 @@ export type {
AirlineParams,
RailTicketParams,
TravelTypeParams,
PhoneErrorRouteParams,
WorkspacesListRouteParams,
WorkspaceRouteParams,
BusinessTaxIDParams,
Expand Down
8 changes: 3 additions & 5 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3346,11 +3347,8 @@ const translations = {
tripSummary: 'Podsumowanie podróży',
departs: 'Odjeżdża',
errorMessage: 'Coś poszło nie tak. Spróbuj ponownie później.',
phoneError: {
phrase1: 'Proszę',
link: 'dodaj służbowy adres e-mail jako swoje główne logowanie',
phrase2: 'zarezerwować podróż.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr><a href="${phoneErrorMethodsRoute}">Dodaj służbowy adres e-mail jako główny login</a> do rezerwacji podróży.</rbr>`,
domainSelector: {
title: 'Domena',
subtitle: 'Wybierz domenę dla konfiguracji Expensify Travel.',
Expand Down
8 changes: 3 additions & 5 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3352,11 +3353,8 @@ const translations = {
tripSummary: 'Resumo da viagem',
departs: 'Parte',
errorMessage: 'Algo deu errado. Por favor, tente novamente mais tarde.',
phoneError: {
phrase1: 'Por favor',
link: 'adicione um e-mail de trabalho como seu login principal',
phrase2: 'para reservar viagens.',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) =>
`<rbr><a href="${phoneErrorMethodsRoute}">Adicione um e-mail de trabalho como seu login principal</a> para reservar viagens.</rbr>`,
domainSelector: {
title: 'Domínio',
subtitle: 'Escolha um domínio para a configuração do Expensify Travel.',
Expand Down
7 changes: 2 additions & 5 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ import type {
PayerPaidParams,
PayerSettledParams,
PaySomeoneParams,
PhoneErrorRouteParams,
PolicyAddedReportFieldOptionParams,
PolicyDisabledReportFieldAllOptionsParams,
PolicyDisabledReportFieldOptionParams,
Expand Down Expand Up @@ -3309,11 +3310,7 @@ const translations = {
tripSummary: '行程总结',
departs: '出发',
errorMessage: '出现问题。请稍后再试。',
phoneError: {
phrase1: '请',
link: '添加工作邮箱作为您的主要登录邮箱',
phrase2: '预订旅行。',
},
phoneError: ({phoneErrorMethodsRoute}: PhoneErrorRouteParams) => `<rbr>请将<a href="${phoneErrorMethodsRoute}">工作邮箱添加为</a>预订旅行的主要登录邮箱。</rbr>`,
domainSelector: {
title: '域名',
subtitle: '为 Expensify Travel 设置选择一个域名。',
Expand Down