-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: migrate txn duplicate to dynamic route #89572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| import truncate from 'lodash/truncate'; | ||
| import type {OnyxEntry} from 'react-native-onyx'; | ||
| import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute'; | ||
| import CONST from '@src/CONST'; | ||
| import type {TranslationPaths} from '@src/languages/types'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES'; | ||
| import type * as OnyxTypes from '@src/types/onyx'; | ||
| import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
| import {setReviewDuplicatesKey} from './actions/Transaction'; | ||
|
|
@@ -105,19 +106,19 @@ const getReviewNavigationRoute = ( | |
| return ROUTES.TRANSACTION_DUPLICATE_REVIEW_TAG_PAGE.getRoute(threadReportID, backTo); | ||
| } | ||
| if (comparisonResult.change.description) { | ||
| return ROUTES.TRANSACTION_DUPLICATE_REVIEW_DESCRIPTION_PAGE.getRoute(threadReportID, backTo); | ||
| return createDynamicRoute(DYNAMIC_ROUTES.TRANSACTION_DUPLICATE_REVIEW_DESCRIPTION.path, ROUTES.REPORT_WITH_ID.getRoute(threadReportID)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can just calculate |
||
| } | ||
| if (comparisonResult.change.taxCode) { | ||
| return ROUTES.TRANSACTION_DUPLICATE_REVIEW_TAX_CODE_PAGE.getRoute(threadReportID, backTo); | ||
| } | ||
| if (comparisonResult.change.billable) { | ||
| return ROUTES.TRANSACTION_DUPLICATE_REVIEW_BILLABLE_PAGE.getRoute(threadReportID, backTo); | ||
| return createDynamicRoute(DYNAMIC_ROUTES.TRANSACTION_DUPLICATE_REVIEW_BILLABLE.path, ROUTES.REPORT_WITH_ID.getRoute(threadReportID)); | ||
| } | ||
| if (comparisonResult.change.reimbursable) { | ||
| return ROUTES.TRANSACTION_DUPLICATE_REVIEW_REIMBURSABLE_PAGE.getRoute(threadReportID, backTo); | ||
| return createDynamicRoute(DYNAMIC_ROUTES.TRANSACTION_DUPLICATE_REVIEW_REIMBURSABLE.path, ROUTES.REPORT_WITH_ID.getRoute(threadReportID)); | ||
| } | ||
|
|
||
| return ROUTES.TRANSACTION_DUPLICATE_CONFIRMATION_PAGE.getRoute(threadReportID, backTo); | ||
| return createDynamicRoute(DYNAMIC_ROUTES.TRANSACTION_DUPLICATE_CONFIRMATION.path, ROUTES.REPORT_WITH_ID.getRoute(threadReportID)); | ||
| }; | ||
|
|
||
| type TranslationPathOrText = { | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add the words 'Dynamic' and 'Page' to the filenames of the components associated with the migrated routes? This will help make it perfectly clear that these are dynamic pages (for example: DynamicConfirmationPage, DynamicReviewBillablePage, DynamicReviewDescriptionPage, DynamicReviewReimbursablePage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the
useMemohere. React compiler handles this memoization automatically