Skip to content

Commit

Permalink
Merge pull request #27420 from tienifr/fix/26657
Browse files Browse the repository at this point in the history
fix: 26657 Another error message for a short time when opening archived chat from search bar
  • Loading branch information
robertjchen authored Oct 5, 2023
2 parents 76c971b + 5c54721 commit 49da40c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/ArchivedReportFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import reportPropTypes from '../pages/reportPropTypes';
import * as ReportActionsUtils from '../libs/ReportActionsUtils';
import styles from '../styles/styles';
import * as PersonalDetailsUtils from '../libs/PersonalDetailsUtils';
import ArchivedReportFooterSkeletonView from './ArchivedReportFooterSkeletonView';

const propTypes = {
/** The reason this report was archived */
Expand Down Expand Up @@ -50,6 +51,9 @@ const defaultProps = {
};

function ArchivedReportFooter(props) {
if (!props.reportClosedAction.reportActionID) {
return <ArchivedReportFooterSkeletonView />;
}
const archiveReason = lodashGet(props.reportClosedAction, 'originalMessage.reason', CONST.REPORT.ARCHIVE_REASON.DEFAULT);
let displayName = PersonalDetailsUtils.getDisplayNameOrDefault(props.personalDetails, [props.report.ownerAccountID, 'displayName']);

Expand Down
48 changes: 48 additions & 0 deletions src/components/ArchivedReportFooterSkeletonView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import PropTypes from 'prop-types';
import React from 'react';
import SkeletonViewContentLoader from 'react-content-loader/native';
import {View} from 'react-native';
import {Rect} from 'react-native-svg';
import compose from '../libs/compose';
import styles from '../styles/styles';
import themeColors from '../styles/themes/default';
import withLocalize from './withLocalize';
import withWindowDimensions from './withWindowDimensions';

const propTypes = {
/** Whether to animate the skeleton view */
shouldAnimate: PropTypes.bool,
};

const defaultTypes = {
shouldAnimate: true,
};

function ArchivedReportFooterSkeletonView(props) {
return (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.archivedReportFooter, styles.hoveredComponentBG]}>
<SkeletonViewContentLoader
animate={props.shouldAnimate}
width={styles.w100.width}
height={48}
backgroundColor={themeColors.skeletonLHNIn}
foregroundColor={themeColors.skeletonLHNOut}
>
<Rect
x="0"
y="0"
width="100%"
height="48"
rx="8"
ry="8"
/>
</SkeletonViewContentLoader>
</View>
);
}

ArchivedReportFooterSkeletonView.propTypes = propTypes;
ArchivedReportFooterSkeletonView.defaultProps = defaultTypes;

ArchivedReportFooterSkeletonView.displayName = 'ArchivedReportFooterSkeletonView';
export default compose(withWindowDimensions, withLocalize)(ArchivedReportFooterSkeletonView);

0 comments on commit 49da40c

Please sign in to comment.