Skip to content

Commit

Permalink
Merge pull request #1369 from Expensify/Rory-CleanupHOCCompose
Browse files Browse the repository at this point in the history
Use compose to chain HOCs
  • Loading branch information
Julesssss authored Feb 1, 2021
2 parents 850f824 + fa780e3 commit aa13351
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {addAction, saveReportComment, broadcastUserIsTyping} from '../../../libs
import ReportTypingIndicator from './ReportTypingIndicator';
import AttachmentModal from '../../../components/AttachmentModal';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import compose from '../../../libs/compose';

const propTypes = {
// A method to call when the form is submitted
Expand Down Expand Up @@ -242,11 +243,14 @@ class ReportActionCompose extends React.Component {
ReportActionCompose.propTypes = propTypes;
ReportActionCompose.defaultProps = defaultProps;

export default withOnyx({
comment: {
key: ({reportID}) => `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`,
},
isSidebarShown: {
key: ONYXKEYS.IS_SIDEBAR_SHOWN,
},
})(withWindowDimensions(ReportActionCompose));
export default compose(
withOnyx({
comment: {
key: ({reportID}) => `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`,
},
isSidebarShown: {
key: ONYXKEYS.IS_SIDEBAR_SHOWN,
},
}),
withWindowDimensions,
)(ReportActionCompose);

0 comments on commit aa13351

Please sign in to comment.