Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2659,6 +2659,8 @@ const CONST = {
MANUAL: 'manual',
SCAN: 'scan',
PER_DIEM: 'per-diem',
DISTANCE_MAP: 'distance-map',
DISTANCE_MANUAL: 'distance-manual',
Comment on lines +2662 to +2663

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 do we have 3 distance request types now? Can we just have distance and distance-manual please? 'distance' can imply map, for the sake of simplicity and backwards compatibility.

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.

We need a different name here because we want to treat this differently then the already existing flow. As an example, check this. If we use the same name, we'd be redirecting the user to the old flow.

I also think that since we'll be removing the old flow, this naming convention makes more sense. We are prefixing our current flows with MONEY_REQUEST_. Since the distance flow has two sub flows, prefixing those with DISTANCE_ would be better.

},
EXPENSE_TYPE: {
DISTANCE: 'distance',
Expand All @@ -2667,6 +2669,8 @@ const CONST = {
PER_DIEM: 'per-diem',
EXPENSIFY_CARD: 'expensifyCard',
PENDING_EXPENSIFY_CARD: 'pendingExpensifyCard',
DISTANCE_MAP: 'distance-map',
DISTANCE_MANUAL: 'distance-manual',
},
REPORT_ACTION_TYPE: {
PAY: 'pay',
Expand Down Expand Up @@ -5081,6 +5085,8 @@ const CONST = {
SCAN: 'scan',
DISTANCE: 'distance',
PER_DIEM: 'per-diem',
DISTANCE_MAP: 'distance-map',
DISTANCE_MANUAL: 'distance-manual',
},

STATUS_TEXT_MAX_LENGTH: 100,
Expand Down
15 changes: 15 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,21 @@ const ROUTES = {
label ? `${backTo || state ? '&' : '?'}label=${encodeURIComponent(label)}` : ''
}` as const,
},
DISTANCE_REQUEST_CREATE: {
Comment thread
allroundexperts marked this conversation as resolved.
route: ':action/:iouType/start/:transactionID/:reportID/distance-new/:backToReport?',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backToReport?: string) =>
`${action as string}/${iouType as string}/start/${transactionID}/${reportID}/distance-new/${backToReport ?? ''}` as const,
},
DISTANCE_REQUEST_CREATE_TAB_MAP: {
route: 'map/:backToReport?',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backToReport?: string) =>
`${action as string}/${iouType as string}/start/${transactionID}/${reportID}/distance-new/map/${backToReport ?? ''}` as const,
},
DISTANCE_REQUEST_CREATE_TAB_MANUAL: {
route: 'manual/:backToReport?',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backToReport?: string) =>
`${action as string}/${iouType as string}/start/${transactionID}/${reportID}/distance-new/manual/${backToReport ?? ''}` as const,
},
IOU_SEND_ADD_BANK_ACCOUNT: 'pay/new/add-bank-account',
IOU_SEND_ADD_DEBIT_CARD: 'pay/new/add-debit-card',
IOU_SEND_ENABLE_PAYMENTS: 'pay/new/enable-payments',
Expand Down
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ const SCREENS = {
EDIT_REPORT: 'Money_Request_Edit_Report',
SPLIT_EXPENSE: 'Money_Request_Split_Expense',
SPLIT_EXPENSE_EDIT: 'Money_Request_Split_Expense_Edit',
DISTANCE_CREATE: 'Money_Request_Distance_Create',
STEP_DISTANCE_MAP: 'Money_Request_Step_Distance_Map',
STEP_DISTANCE_MANUAL: 'Money_Request_Step_Distance_Manual',
},

TRANSACTION_DUPLICATE: {
Expand Down
6 changes: 6 additions & 0 deletions src/libs/IOUUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import {getCurrency, getTagArrayFromName} from './TransactionUtils';

let lastLocationPermissionPrompt: string;
Onyx.connect({

Check warning on line 18 in src/libs/IOUUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_LAST_LOCATION_PERMISSION_PROMPT,
callback: (val) => (lastLocationPermissionPrompt = val ?? ''),
});
Expand All @@ -30,6 +30,12 @@
case CONST.IOU.REQUEST_TYPE.DISTANCE:
Navigation.goBack(ROUTES.MONEY_REQUEST_CREATE_TAB_DISTANCE.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID), {compareParams: false});
break;
case CONST.IOU.REQUEST_TYPE.DISTANCE_MAP:
Navigation.goBack(ROUTES.DISTANCE_REQUEST_CREATE_TAB_MAP.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID), {compareParams: false});
break;
case CONST.IOU.REQUEST_TYPE.DISTANCE_MANUAL:
Navigation.goBack(ROUTES.DISTANCE_REQUEST_CREATE_TAB_MANUAL.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID), {compareParams: false});
break;
Comment on lines +33 to +38

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.

Can you please explain why this logic is needed vs only calling goBack without params?

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.

This is following the current convention that we have for other request types like scan, manual and distance. It is basically just a fallback in case the go back is not possible.

case CONST.IOU.REQUEST_TYPE.SCAN:
Navigation.goBack(ROUTES.MONEY_REQUEST_CREATE_TAB_SCAN.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID), {compareParams: false});
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNa
[SCREENS.MONEY_REQUEST.RECEIPT_VIEW_MODAL]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepScan/ReceiptViewModal').default,
[SCREENS.MONEY_REQUEST.SPLIT_EXPENSE]: () => require<ReactComponentModule>('../../../../pages/iou/SplitExpensePage').default,
[SCREENS.MONEY_REQUEST.SPLIT_EXPENSE_EDIT]: () => require<ReactComponentModule>('../../../../pages/iou/SplitExpenseEditPage').default,
[SCREENS.MONEY_REQUEST.DISTANCE_CREATE]: () => require<ReactComponentModule>('../../../../pages/iou/request/DistanceRequestStartPage').default,
[SCREENS.MONEY_REQUEST.STEP_DISTANCE_MAP]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepDistanceMap').default,
[SCREENS.MONEY_REQUEST.STEP_DISTANCE_MANUAL]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepDistanceManual').default,
});

const TravelModalStackNavigator = createModalStackNavigator<TravelNavigatorParamList>({
Expand Down
12 changes: 12 additions & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,18 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
},
},
},
[SCREENS.MONEY_REQUEST.DISTANCE_CREATE]: {
path: ROUTES.DISTANCE_REQUEST_CREATE.route,
exact: true,
screens: {
map: {
path: ROUTES.DISTANCE_REQUEST_CREATE_TAB_MAP.route,
},
manual: {
path: ROUTES.DISTANCE_REQUEST_CREATE_TAB_MANUAL.route,
},
},
},
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_ROOT]: ROUTES.SETTINGS_CATEGORIES_ROOT.route,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_ROOT]: ROUTES.SETTINGS_TAGS_ROOT.route,
[SCREENS.MONEY_REQUEST.EDIT_REPORT]: ROUTES.MONEY_REQUEST_EDIT_REPORT.route,
Expand Down
29 changes: 29 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,35 @@ type MoneyRequestNavigatorParamList = {
pageIndex: string;
transactionID: string;
};
[SCREENS.MONEY_REQUEST.DISTANCE_CREATE]: {
iouType: IOUType;
reportID: string;
transactionID: string;

// These are not used in the screen, but are needed for the navigation
// for IOURequestStepDistanceManual and IOURequestStepDistanceMap components
backTo: never;
action: never;
currency: never;
pageIndex?: string;
backToReport?: string;
};
[SCREENS.MONEY_REQUEST.STEP_DISTANCE_MANUAL]: {
action: IOUAction;
iouType: IOUType;
transactionID: string;
reportID: string;
backTo: Routes;
backToReport?: string;
};
[SCREENS.MONEY_REQUEST.STEP_DISTANCE_MAP]: {
action: IOUAction;
iouType: IOUType;
transactionID: string;
reportID: string;
backTo: Routes;
backToReport?: string;
};
};

type WorkspaceConfirmationNavigatorParamList = {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/TransactionUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

let allTransactions: OnyxCollection<Transaction> = {};

Onyx.connect({

Check warning on line 103 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -112,7 +112,7 @@
});

let allTransactionDrafts: OnyxCollection<Transaction> = {};
Onyx.connect({

Check warning on line 115 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -121,7 +121,7 @@
});

let allReports: OnyxCollection<Report> = {};
Onyx.connect({

Check warning on line 124 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -130,7 +130,7 @@
});

let allTransactionViolations: OnyxCollection<TransactionViolations> = {};
Onyx.connect({

Check warning on line 133 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => (allTransactionViolations = value),
Expand All @@ -138,7 +138,7 @@

let currentUserEmail = '';
let currentUserAccountID = -1;
Onyx.connect({

Check warning on line 141 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (val) => {
currentUserEmail = val?.email ?? '';
Expand All @@ -149,7 +149,7 @@
function isDistanceRequest(transaction: OnyxEntry<Transaction>): boolean {
// This is used during the expense creation flow before the transaction has been saved to the server
if (lodashHas(transaction, 'iouRequestType')) {
return transaction?.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE;
return transaction?.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE || transaction?.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE_MAP;
}

// This is the case for transaction objects once they have been saved to the server
Expand Down
20 changes: 18 additions & 2 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@
};

let allPersonalDetails: OnyxTypes.PersonalDetailsList = {};
Onyx.connect({

Check warning on line 633 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand Down Expand Up @@ -670,13 +670,13 @@
};

let allBetas: OnyxEntry<OnyxTypes.Beta[]>;
Onyx.connect({

Check warning on line 673 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETAS,
callback: (value) => (allBetas = value),
});

let allTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 679 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -690,7 +690,7 @@
});

let allTransactionDrafts: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 693 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -931,7 +931,7 @@
let requestCategory: string | null = null;

// Add initial empty waypoints when starting a distance expense
if (newIouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE) {
if (newIouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE || newIouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE_MAP) {
comment.waypoints = {
waypoint0: {keyForList: 'start_waypoint'},
waypoint1: {keyForList: 'stop_waypoint'},
Expand Down Expand Up @@ -1014,6 +1014,20 @@
}
}

function startDistanceRequest(iouType: ValueOf<typeof CONST.IOU.TYPE>, reportID: string, requestType?: IOURequestType, skipConfirmation = false, backToReport?: string) {
clearMoneyRequest(CONST.IOU.OPTIMISTIC_TRANSACTION_ID, skipConfirmation);
switch (requestType) {
case CONST.IOU.REQUEST_TYPE.DISTANCE_MAP:
Navigation.navigate(ROUTES.DISTANCE_REQUEST_CREATE_TAB_MAP.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, reportID, backToReport));
return;
case CONST.IOU.REQUEST_TYPE.DISTANCE_MANUAL:
Navigation.navigate(ROUTES.DISTANCE_REQUEST_CREATE_TAB_MANUAL.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, reportID, backToReport));
return;
default:
Navigation.navigate(ROUTES.DISTANCE_REQUEST_CREATE.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, reportID, backToReport));
}
}

function setMoneyRequestAmount(transactionID: string, amount: number, currency: string, shouldShowOriginalAmount = false) {
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {amount, currency, shouldShowOriginalAmount});
}
Expand Down Expand Up @@ -3349,7 +3363,8 @@
}

// STEP 3: Build an optimistic transaction with the receipt
const isDistanceRequest = existingTransaction && existingTransaction.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE;
const isDistanceRequest =
existingTransaction && (existingTransaction.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE || existingTransaction.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE_MAP);
let optimisticTransaction = buildOptimisticTransaction({
existingTransactionID,
existingTransaction,
Expand Down Expand Up @@ -12153,5 +12168,6 @@
updateSplitExpenseField,
reopenReport,
retractReport,
startDistanceRequest,
};
export type {GPSPoint as GpsPoint, IOURequestType, StartSplitBilActionParams, CreateTrackExpenseParams, RequestMoneyInformation, ReplaceReceipt};
17 changes: 17 additions & 0 deletions src/pages/iou/request/DistanceRequestStartPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type SCREENS from '@src/SCREENS';
import type {SelectedTabRequest} from '@src/types/onyx';
import type {WithWritableReportOrNotFoundProps} from './step/withWritableReportOrNotFound';

type DistanceRequestStartPageProps = WithWritableReportOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.DISTANCE_CREATE> & {
// eslint-disable-next-line react/no-unused-prop-types
defaultSelectedTab: SelectedTabRequest;
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function DistanceRequestStartPage(props: DistanceRequestStartPageProps) {
return null;
}

DistanceRequestStartPage.displayName = 'DistanceRequestStartPage';

export default DistanceRequestStartPage;
8 changes: 6 additions & 2 deletions src/pages/iou/request/IOURequestRedirectToStartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useEffect} from 'react';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ScreenWrapper from '@components/ScreenWrapper';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportUtils from '@libs/ReportUtils';
import {generateReportID} from '@libs/ReportUtils';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
Expand All @@ -27,13 +27,17 @@ function IOURequestRedirectToStartPage({
Navigation.dismissModal();

// Redirect the person to the right start page using a random reportID
const optimisticReportID = ReportUtils.generateReportID();
const optimisticReportID = generateReportID();
if (iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE) {
Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE_TAB_DISTANCE.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, optimisticReportID));
} else if (iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL) {
Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE_TAB_MANUAL.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, optimisticReportID));
} else if (iouRequestType === CONST.IOU.REQUEST_TYPE.SCAN) {
Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE_TAB_SCAN.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, optimisticReportID));
} else if (iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE_MAP) {
Navigation.navigate(ROUTES.DISTANCE_REQUEST_CREATE_TAB_MAP.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, optimisticReportID));
} else if (iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE_MANUAL) {
Navigation.navigate(ROUTES.DISTANCE_REQUEST_CREATE_TAB_MANUAL.getRoute(CONST.IOU.ACTION.CREATE, iouType, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, optimisticReportID));
Comment on lines +37 to +40

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.

@allroundexperts Why did you use Redirect logic here? I can see in docs you created a different component for the same.

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.

I created a new component first, but it was a lot of duplicated code. In the end, I decided that adding it in the already existing component would be a better approach.

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.

@allroundexperts This approach will cause a problem if I use distance-map in the URL in the normal create page. Can you please separate the code as mentioned in the doc?

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.

Not really. It will redirect you to the new page.

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.

Unless I am mistaken. But let me know.

}

// This useEffect should only run on mount which is why there are no dependencies being passed in the second parameter
Expand Down
3 changes: 2 additions & 1 deletion src/pages/iou/request/step/IOURequestStepAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {SelectedTabRequest} from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
import type Transaction from '@src/types/onyx/Transaction';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -324,7 +325,7 @@ function IOURequestStepAmount({
shouldKeepUserInput={transaction?.shouldShowOriginalAmount}
onCurrencyButtonPress={navigateToCurrencySelectionPage}
onSubmitButtonPress={saveAmountAndCurrency}
selectedTab={iouRequestType}
selectedTab={iouRequestType as SelectedTabRequest}
chatReportID={reportID}
/>
</StepScreenWrapper>
Expand Down
38 changes: 38 additions & 0 deletions src/pages/iou/request/step/IOURequestStepDistanceManual.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type {OnyxEntry} from 'react-native-onyx';
import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails';
import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails';
import type SCREENS from '@src/SCREENS';
import type Transaction from '@src/types/onyx/Transaction';
import withFullTransactionOrNotFound from './withFullTransactionOrNotFound';
import type {WithWritableReportOrNotFoundProps} from './withWritableReportOrNotFound';
import withWritableReportOrNotFound from './withWritableReportOrNotFound';

type IOURequestStepDistanceManualProps = WithCurrentUserPersonalDetailsProps &
WithWritableReportOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.STEP_DISTANCE_MANUAL | typeof SCREENS.MONEY_REQUEST.DISTANCE_CREATE> & {
/** The transaction object being modified in Onyx */
transaction: OnyxEntry<Transaction>;
};

function IOURequestStepDistanceManual({
report,
route: {
params: {action, iouType, reportID, transactionID, backTo, backToReport},
},
transaction,
currentUserPersonalDetails,
}: IOURequestStepDistanceManualProps) {
return null;
}

IOURequestStepDistanceManual.displayName = 'IOURequestStepDistanceManual';

const IOURequestStepDistanceManualWithOnyx = IOURequestStepDistanceManual;

const IOURequestStepDistanceManualWithCurrentUserPersonalDetails = withCurrentUserPersonalDetails(IOURequestStepDistanceManualWithOnyx);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepDistanceManualWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepDistanceManualWithCurrentUserPersonalDetails, true);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepDistanceManualWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepDistanceManualWithWritableReportOrNotFound);

export default IOURequestStepDistanceManualWithFullTransactionOrNotFound;
Loading
Loading