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
8 changes: 4 additions & 4 deletions src/components/OnyxProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import ComposeProviders from './ComposeProviders';
const [withNetwork, NetworkProvider] = createOnyxContext(ONYXKEYS.NETWORK);
const [withPersonalDetails, PersonalDetailsProvider] = createOnyxContext(ONYXKEYS.PERSONAL_DETAILS);
const [withCurrentDate, CurrentDateProvider] = createOnyxContext(ONYXKEYS.CURRENT_DATE);
const [
withReportActionsDrafts,
ReportActionsDraftsProvider,
] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS);
const [withReportActionsDrafts, ReportActionsDraftsProvider] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS);
const [withBlockedFromConcierge, BlockedFromConciergeProvider] = createOnyxContext(ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE);

const propTypes = {
/** Rendered child component */
Expand All @@ -26,6 +24,7 @@ const OnyxProvider = props => (
PersonalDetailsProvider,
ReportActionsDraftsProvider,
CurrentDateProvider,
BlockedFromConciergeProvider,
]}
>
{props.children}
Expand All @@ -42,4 +41,5 @@ export {
withPersonalDetails,
withReportActionsDrafts,
withCurrentDate,
withBlockedFromConcierge,
};
9 changes: 2 additions & 7 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import _ from 'underscore';
import lodashGet from 'lodash/get';
import React, {Component} from 'react';
import {withOnyx} from 'react-native-onyx';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import CONST from '../../../CONST';
Expand All @@ -24,7 +23,7 @@ import canUseTouchScreen from '../../../libs/canUseTouchscreen';
import MiniReportActionContextMenu from './ContextMenu/MiniReportActionContextMenu';
import * as ReportActionContextMenu from './ContextMenu/ReportActionContextMenu';
import * as ContextMenuActions from './ContextMenu/ContextMenuActions';
import {withNetwork, withReportActionsDrafts} from '../../../components/OnyxProvider';
import {withBlockedFromConcierge, withNetwork, withReportActionsDrafts} from '../../../components/OnyxProvider';
import RenameAction from '../../../components/ReportActionItem/RenameAction';
import InlineSystemMessage from '../../../components/InlineSystemMessage';
import styles from '../../../styles/styles';
Expand Down Expand Up @@ -242,16 +241,12 @@ ReportActionItem.defaultProps = defaultProps;
export default compose(
withWindowDimensions,
withNetwork(),
withBlockedFromConcierge({propName: 'blockedFromConcierge'}),
withReportActionsDrafts({
propName: 'draftMessage',
transformValue: (drafts, props) => {
const draftKey = `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${props.report.reportID}_${props.action.reportActionID}`;
return lodashGet(drafts, draftKey, '');
},
}),
withOnyx({
blockedFromConcierge: {
key: ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE,
},
}),
)(ReportActionItem);