Skip to content

Commit

Permalink
Merge pull request Expensify#53159 from daledah/fix/52393
Browse files Browse the repository at this point in the history
fix: use display create instead of submit expense
  • Loading branch information
techievivek authored Dec 3, 2024
2 parents b80c68e + e8dd2bd commit 5bb0e9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import useLocalize from '@hooks/useLocalize';
import usePermissions from '@hooks/usePermissions';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import * as OptionsListUtils from '@libs/OptionsListUtils';
Expand Down Expand Up @@ -46,12 +47,18 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
const welcomeMessage = SidebarUtils.getWelcomeMessage(report, policy);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, policy, participantAccountIDs);
const canEditReportDescription = ReportUtils.canEditReportDescription(report, policy);
const {canUseCombinedTrackSubmit} = usePermissions();
const filteredOptions = moneyRequestOptions.filter(
(item): item is Exclude<IOUType, typeof CONST.IOU.TYPE.REQUEST | typeof CONST.IOU.TYPE.SEND | typeof CONST.IOU.TYPE.CREATE | typeof CONST.IOU.TYPE.INVOICE> =>
item !== CONST.IOU.TYPE.INVOICE,
);
const additionalText = filteredOptions
.map((item, index) => `${index === filteredOptions.length - 1 && index > 0 ? `${translate('common.or')} ` : ''}${translate(`reportActionsView.iouTypes.${item}`)}`)
.map(
(item, index) =>
`${index === filteredOptions.length - 1 && index > 0 ? `${translate('common.or')} ` : ''}${translate(
canUseCombinedTrackSubmit && item === 'submit' ? `reportActionsView.create` : `reportActionsView.iouTypes.${item}`,
)}`,
)
.join(', ');
const canEditPolicyDescription = ReportUtils.canEditPolicyDescription(policy);
const reportName = ReportUtils.getReportName(report);
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ const translations = {
welcomeToRoom: ({roomName}: WelcomeToRoomParams) => `Welcome to ${roomName}!`,
usePlusButton: ({additionalText}: UsePlusButtonParams) => `\nUse the + button to ${additionalText} an expense.`,
askConcierge: '\nAsk questions and get 24/7 realtime support.',
create: 'create',
iouTypes: {
pay: 'pay',
split: 'split',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ const translations = {
welcomeToRoom: ({roomName}: WelcomeToRoomParams) => `¡Bienvenido a ${roomName}!`,
usePlusButton: ({additionalText}: UsePlusButtonParams) => `\nUsa el botón + para ${additionalText} un gasto`,
askConcierge: 'Haz preguntas y obtén soporte en tiempo real las 24/7.',
create: 'crear',
iouTypes: {
pay: 'pagar',
split: 'dividir',
Expand Down

0 comments on commit 5bb0e9b

Please sign in to comment.