Skip to content
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

[NoQA] Update ReportScreen to display MoneyRequest Reports #18538

Merged
merged 1 commit into from
May 9, 2023
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
23 changes: 17 additions & 6 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import getIsReportFullyVisible from '../../libs/getIsReportFullyVisible';
import EmojiPicker from '../../components/EmojiPicker/EmojiPicker';
import * as EmojiPickerAction from '../../libs/actions/EmojiPickerAction';
import TaskHeaderView from './TaskHeaderView';
import MoneyRequestHeader from '../../components/MoneyRequestHeader';

const propTypes = {
/** Navigation route context info provided by react navigation */
Expand Down Expand Up @@ -275,12 +276,22 @@ class ReportScreen extends React.Component {
errors={addWorkspaceRoomOrChatErrors}
shouldShowErrorMessages={false}
>
<HeaderView
reportID={reportID}
onNavigationMenuButtonClicked={() => Navigation.navigate(ROUTES.HOME)}
personalDetails={this.props.personalDetails}
report={this.props.report}
/>
{ReportUtils.isMoneyRequestReport(this.props.report)
? (
<MoneyRequestHeader
report={this.props.report}
policies={this.props.policies}
personalDetails={this.props.personalDetails}
/>
)
: (
<HeaderView
reportID={reportID}
onNavigationMenuButtonClicked={() => Navigation.navigate(ROUTES.HOME)}
personalDetails={this.props.personalDetails}
report={this.props.report}
/>
)}
</OfflineWithFeedback>
{Boolean(this.props.accountManagerReportID) && ReportUtils.isConciergeChatReport(this.props.report) && this.state.isBannerVisible && (
<Banner
Expand Down
5 changes: 5 additions & 0 deletions src/pages/home/report/ReportActionItemCreated.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ const defaultProps = {

const ReportActionItemCreated = (props) => {
const icons = ReportUtils.getIcons(props.report, props.personalDetails);

if (ReportUtils.isMoneyRequestReport(props.report.reportID)) {
return null;
}

return (
<OfflineWithFeedback
pendingAction={lodashGet(props.report, 'pendingFields.addWorkspaceRoom') || lodashGet(props.report, 'pendingFields.createChat')}
Expand Down