-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
remove MoneyRequestCategoryPage and refactor route #35458
Changes from 1 commit
0d3a9f4
7b3c742
104f065
826748b
27a668e
7104c7f
388615a
9437006
c19b5ff
339c584
2c9117f
fadfb4c
af9f430
dc0ed31
aec7ec0
af18508
94db212
41e3184
3e3f6f2
6438c07
b5c865f
1786cdb
adf9f13
d9ce687
58a4e27
b5c4658
ce19475
248ebc0
fb86af9
f93dda6
60c559d
c79efb5
ea47735
4b4a005
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ import lodashGet from 'lodash/get'; | |
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {withOnyx} from 'react-native-onyx'; | ||
import _ from 'underscore'; | ||
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; | ||
import CategoryPicker from '@components/CategoryPicker'; | ||
import categoryPropTypes from '@components/categoryPropTypes'; | ||
import tagPropTypes from '@components/tagPropTypes'; | ||
|
@@ -11,6 +13,7 @@ import useLocalize from '@hooks/useLocalize'; | |
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import compose from '@libs/compose'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import * as OptionsListUtils from '@libs/OptionsListUtils'; | ||
import * as ReportUtils from '@libs/ReportUtils'; | ||
import reportPropTypes from '@pages/reportPropTypes'; | ||
import * as IOU from '@userActions/IOU'; | ||
|
@@ -72,6 +75,9 @@ function IOURequestStepCategory({ | |
const isEditingSplitBill = isEditing && iouType === CONST.IOU.TYPE.SPLIT; | ||
const {category: transactionCategory} = ReportUtils.getTransactionDetails(isEditingSplitBill ? splitDraftTransaction : transaction); | ||
|
||
const isPolicyExpenseChat = ReportUtils.isGroupPolicy(report); | ||
const shouldShowCategories = isPolicyExpenseChat && (transactionCategory || OptionsListUtils.hasEnabledOptions(_.values(policyCategories))); | ||
|
||
const navigateBack = () => { | ||
Navigation.goBack(backTo); | ||
}; | ||
|
@@ -101,6 +107,10 @@ function IOURequestStepCategory({ | |
navigateBack(); | ||
}; | ||
|
||
if (!shouldShowCategories) { | ||
return <FullPageNotFoundView shouldShow />; | ||
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. What do you think about moving 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. I think that's good. 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. @DylanDylann moved not found to into |
||
} | ||
|
||
return ( | ||
<StepScreenWrapper | ||
headerTitle={translate('common.category')} | ||
|
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.
@dukenv0307 Should update to shouldShowNotFoundPage
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.
@DylanDylann Updated.