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
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);