diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index ca4baf304652..ac04ba8a5e5b 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -173,6 +173,7 @@ class ReportActionItem extends Component { hovered || this.state.isContextMenuActive || this.props.draftMessage, + this.props.action.isPending || this.props.action.error, )} > {!this.props.displayAsGroup diff --git a/src/pages/home/report/reportActionPropTypes.js b/src/pages/home/report/reportActionPropTypes.js index 54df5df52392..c4400d36c3ab 100644 --- a/src/pages/home/report/reportActionPropTypes.js +++ b/src/pages/home/report/reportActionPropTypes.js @@ -3,24 +3,31 @@ import PropTypes from 'prop-types'; import reportActionFragmentPropTypes from './reportActionFragmentPropTypes'; export default { - // Name of the action e.g. ADDCOMMENT + /** Name of the action e.g. ADDCOMMENT */ actionName: PropTypes.string, - // Person who created the action + /** Person who created the action */ person: PropTypes.arrayOf(reportActionFragmentPropTypes), - // ID of the report action + /** ID of the report action */ sequenceNumber: PropTypes.number, - // Unix timestamp + /** Unix timestamp */ timestamp: PropTypes.number, - // report action message + /** report action message */ message: PropTypes.arrayOf(reportActionFragmentPropTypes), - // Original message associated with this action + /** Original message associated with this action */ originalMessage: PropTypes.shape({ // The ID of the iou transaction IOUTransactionID: PropTypes.string, }), + + /** If the reportAction is pending, that means we have not yet sent the Report_AddComment command to the server. + This should most often occur when the client is offline. */ + isPending: PropTypes.bool, + + /** Error message that's come back from the server. */ + error: PropTypes.string, }; diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index 4da69f75d427..ab37cbe68b72 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -387,9 +387,10 @@ function getLoginPagePromoStyle() { * Generate the styles for the ReportActionItem wrapper view. * * @param {Boolean} [isHovered] + * @param {Boolean} [isPending] * @returns {Object} */ -function getReportActionItemStyle(isHovered = false) { +function getReportActionItemStyle(isHovered = false, isPending = false) { return { display: 'flex', justifyContent: 'space-between', @@ -398,6 +399,7 @@ function getReportActionItemStyle(isHovered = false) { // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android : colors.transparent, + opacity: isPending ? 0.5 : 1, cursor: 'default', }; }