Skip to content

Commit

Permalink
change loader
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Sep 15, 2023
1 parent 694c423 commit 35076a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useState, useRef, useMemo} from 'react';
import {ActivityIndicator, View} from 'react-native';
import PropTypes from 'prop-types';
import Animated, {useSharedValue, useAnimatedStyle, withTiming} from 'react-native-reanimated';
import _ from 'underscore';
import InvertedFlatList from '../../../components/InvertedFlatList';
Expand All @@ -21,6 +22,7 @@ import reportPropTypes from '../../reportPropTypes';
import useLocalize from '../../../hooks/useLocalize';
import useNetwork from '../../../hooks/useNetwork';
import DateUtils from '../../../libs/DateUtils';
import themeColors from '../../../styles/themes/default';
import FloatingMessageCounter from './FloatingMessageCounter';
import useReportScrollManager from '../../../hooks/useReportScrollManager';

Expand Down Expand Up @@ -323,13 +325,6 @@ function ReportActionsList({

return null;
}}
ListHeaderComponent={() => {
if (report.isLoadingOlderReportActions) {
return <ReportActionsSkeletonView containerHeight={CONST.CHAT_SKELETON_VIEW.AVERAGE_ROW_HEIGHT * 3} />;
}

return null;
}}
keyboardShouldPersistTaps="handled"
onLayout={(event) => {
setSkeletonViewHeight(event.nativeEvent.layout.height);
Expand All @@ -339,6 +334,14 @@ function ReportActionsList({
extraData={extraData}
/>
</Animated.View>
{report.isLoadingNewerReportActions ? (
<View style={[styles.alignItemsCenter, styles.justifyContentCenter, styles.bottomReportLoader]}>
<ActivityIndicator
color={themeColors.spinner}
size="small"
/>
</View>
) : null}
</>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3959,6 +3959,9 @@ const styles = (theme) => ({
height: 30,
width: '100%',
},
bottomReportLoader: {
height: 40,
},
});

// For now we need to export the styles function that takes the theme as an argument
Expand Down

0 comments on commit 35076a4

Please sign in to comment.